• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    NV_vertex_attrib_integer_64bit
4
5Name Strings
6
7    GL_NV_vertex_attrib_integer_64bit
8
9Contact
10
11    Jeff Bolz, NVIDIA (jbolz 'at' nvidia.com)
12
13Contributors
14
15    Pat Brown, NVIDIA
16
17Status
18
19    Shipping
20
21Version
22
23    Last Modified Date:         03/21/2010
24    Revision:                   4
25
26Number
27
28    392
29
30Dependencies
31
32    This extension is written against the OpenGL 3.2 specification
33    (Compatibility Profile).
34
35    This extension is written against version 1.50 (revision 09) of the OpenGL
36    Shading Language Specification.
37
38    OpenGL 3.0 and GLSL 1.30 are required.
39
40    NV_gpu_shader5 or equivalent functionality is required.
41
42    This extension requires EXT_vertex_attrib_64bit.
43
44    This extension interacts with NV_vertex_buffer_unified_memory.
45
46    This extension interacts with NV_gpu_program5 and NV_gpu_shader5.
47
48    This extension interacts with EXT_vertex_attrib_64bit.
49
50Overview
51
52    This extension provides support for specifying vertex attributes with
53    64-bit integer components, analagous to the 64-bit floating point support
54    added in EXT_vertex_attrib_64bit.
55
56    Additionally, it provides the VertexAttribLFormatNV entry point to specify
57    bindless vertex attribute arrays with 64-bit integer or floating-point
58    components in conjunction with the NV_vertex_buffer_unified_memory
59    extension.
60
61
62New Procedures and Functions
63
64    void VertexAttribL1i64NV(uint index, int64EXT x);
65    void VertexAttribL2i64NV(uint index, int64EXT x, int64EXT y);
66    void VertexAttribL3i64NV(uint index, int64EXT x, int64EXT y,
67                             int64EXT z);
68    void VertexAttribL4i64NV(uint index, int64EXT x, int64EXT y,
69                             int64EXT z, int64EXT w);
70    void VertexAttribL1i64vNV(uint index, const int64EXT *v);
71    void VertexAttribL2i64vNV(uint index, const int64EXT *v);
72    void VertexAttribL3i64vNV(uint index, const int64EXT *v);
73    void VertexAttribL4i64vNV(uint index, const int64EXT *v);
74
75    void VertexAttribL1ui64NV(uint index, uint64EXT x);
76    void VertexAttribL2ui64NV(uint index, uint64EXT x, uint64EXT y);
77    void VertexAttribL3ui64NV(uint index, uint64EXT x, uint64EXT y,
78                              uint64EXT z);
79    void VertexAttribL4ui64NV(uint index, uint64EXT x, uint64EXT y,
80                              uint64EXT z, uint64EXT w);
81    void VertexAttribL1ui64vNV(uint index, const uint64EXT *v);
82    void VertexAttribL2ui64vNV(uint index, const uint64EXT *v);
83    void VertexAttribL3ui64vNV(uint index, const uint64EXT *v);
84    void VertexAttribL4ui64vNV(uint index, const uint64EXT *v);
85
86    void GetVertexAttribLi64vNV(uint index, enum pname, int64EXT *params);
87    void GetVertexAttribLui64vNV(uint index, enum pname, uint64EXT *params);
88
89    void VertexAttribLFormatNV(uint index, int size, enum type, sizei stride);
90
91    (note:  VertexAttribLFormatNV is provided only if
92    NV_vertex_buffer_unified_memory is supported.)
93
94
95New Tokens
96
97    Accepted by the <type> parameter of VertexAttribLPointerEXT,
98    VertexArrayVertexAttribLOffsetEXT, and VertexAttribLFormatNV:
99
100        INT64_NV                                        0x140E
101        UNSIGNED_INT64_NV                               0x140F
102
103
104Additions to Chapter 2 of the OpenGL 3.2 (Compatibility Profile) Specification
105(OpenGL Operation)
106
107    Modify Section 2.7, Vertex Specification (p. 24)
108
109    (delete third paragraph, p. 33, beginning with "The resulting attribute
110    values are undefined")
111
112    (rework the description of the VertexAttribI* commands, and add support
113    for new VertexAttribL* commands, p. 33)
114
115    To load values into a generic shader attribute declared as a signed or
116    unsigned integer or integer vector, except for 64-bit integer types, use
117    the commands
118
119      void VertexAttribI{1,2,3,4}{i,ui}( uint index, T values );
120      void VertexAttribI{1,2,3,4}{i,ui}v( uint index, T values );
121      void VertexAttribI4{b,s,ub,us}v( uint index, T values );
122
123    These commands specify values that are extended to full signed or unsigned
124    integers, then loaded into the generic attribute at slot index in the same
125    fashion as described above.
126
127    To load values into a generic shader attribute declared as a double,
128    64-bit signed integer, 64-bit unsigned integer, or into vectors or
129    matrices thereof, use the commands
130
131      void VertexAttribL{1,2,3,4}dEXT(uint index, T values);
132      void VertexAttribL{1,2,3,4}dvEXT(uint index, T values);
133      void VertexAttribL{1,2,3,4}{i64,ui64}EXT(uint index, T values);
134      void VertexAttribL{1,2,3,4}{i64,ui64}vEXT(uint index, T values);
135
136    These commands specify one, two, three or four values.  Note that attribute
137    variables declared with "double" types must be loaded with
138    VertexAttribL*d{v}EXT; loading attributes with VertexAttrib*d{v} will
139    produce undefined results. Similarly, attributes declared with 64-bit
140    integer types must be loaded with VertexAttribL*{i64,ui64}{v}.
141
142    For all VertexAttrib* commands, the error INVALID_VALUE is generated if
143    <index> is greater than or equal to MAX_VERTEX_ATTRIBS.
144
145    The full set of VertexAttrib* commands specify generic attributes with
146    components one of six data types:
147
148      * floating-point values (VertexAttrib*),
149      * signed or unsigned integers (VertexAttribI*),
150      * double-precision floating-point values (VertexAttribL*d*), and
151      * 64-bit signed or unsigned integers (VertexAttribL*{i64,ui64}*).
152
153    The values loaded into a shader attribute variable bound to generic
154    attribute <index> are undefined if the data type of the attribute
155    components specified by the most recent VertexAttrib* command do not match
156    the data type of the variable.
157
158
159    Modify Section 2.8, Vertex Arrays, p. 34
160
161    (insert new paragraph after first paragraph, p. 37)
162
163    The command
164
165      void VertexAttribLPointerEXT(uint index, int size, enum type,
166                                   sizei stride, const void *pointer);
167
168    specifies state for a generic vertex attribute array associated with a
169    shader attribute variable declared with 64-bit double precision components.
170    <type> must be one of DOUBLE, INT64_NV, or UNSIGNED_INT64_NV, specifying
171    components of type double, int64EXT, and uint64EXT, respectively. <index>,
172    <size>, and <stride> behave as defined in all other vertex commands; <size>
173    may be one, two, three or four.
174
175    Each component of an array specified by VertexAttribLPointerEXT will be
176    encoded into one or more generic attribute components as specified for the
177    VertexAttribL* commands in Section 2.7.  The error INVALID_VALUE is
178    generated if <index> is greater than or equal to MAX_VERTEX_ATTRIBS.
179
180
181    Modify "Add to Section 2.9" edits from NV_vertex_buffer_unified_memory
182
183    (add to following to the list of *FormatNV commands)
184
185        void VertexAttribLFormatNV(uint index, int size, enum type,
186                                   sizei stride);
187
188
189    Modify Section 2.14.3, Vertex Attributes, p. 86
190
191    (replace last paragraph, p. 86)
192
193    When an attribute variable declared using one of the scalar or vector data
194    types enumerated in Table X.1 and is bound to a generic attribute index
195    <i>, its value(s) are taken from the components of generic attribute <i>.
196    Scalars are extracted from the x component; two-, three-, and
197    four-component vectors are extracted from the, (x, y), (x, y, z), or (x,
198    y, z, w) components, respectively.
199
200      Data type                         Command
201      -------------------------------   ----------------------------------
202      int    int8_t  int16_t  int32_t   VertexAttribI1i
203      ivec2  i8vec2  i16vec2  i32vec2   VertexAttribI2i
204      ivec3  i8vec3  i16vec3  i32vec3   VertexAttribI3i
205      ivec4  i8vec4  i16vec4  i32vec4   VertexAttribI4i
206
207      uint   uint8_t uint16_t uint32_t  VertexAttribI1ui
208      ivec2  i8vec2  i16vec2  u32vec2   VertexAttribI2ui
209      ivec3  i8vec3  i16vec3  u32vec3   VertexAttribI3ui
210      uvec4  u8vec4  u16vec4  u32vec4   VertexAttribI4ui
211
212      float  int16_t  int32_t           VertexAttrib1{f,b,s,i,ub,us,ui,d}
213      vec2   f16vec2  f32vec2           VertexAttrib2{f,b,s,i,ub,us,ui,d}
214      vec3   f16vec3  f32vec3           VertexAttrib3{f,b,s,i,ub,us,ui,d}
215      vec4   f16vec4  f32vec4           VertexAttrib4{f,b,s,i,ub,us,ui,d}
216
217      double    float64_t               VertexAttribL1dEXT
218      dvec2     f64vec2                 VertexAttribL2dEXT
219      dvec3     f64vec3                 VertexAttribL3dEXT
220      dvec4     f64vec4                 VertexAttribL4dEXT
221
222      int64_t                           VertexAttribL1i64NV
223      i64vec2                           VertexAttribL2i64NV
224      i64vec3                           VertexAttribL3i64NV
225      i64vec4                           VertexAttribL4i64NV
226
227      uint64_t                          VertexAttribL1ui64NV
228      u64vec2                           VertexAttribL2ui64NV
229      u64vec3                           VertexAttribL3ui64NV
230      u64vec4                           VertexAttribL4ui64NV
231
232      Table X.1:  Scalar and vector vertex attribute types and VertexAttrib*
233      commands used to set the values of the corresponding generic attribute.
234
235    For the 64-bit types listed in Table X.1, no default attribute values are
236    provided if the values of the vertex attribute variable are specified with
237    fewer components than required for the attribute variable.  For example,
238    the fourth component of a variable of type dvec4 will be undefined if
239    specified using VertexAttribL3dvEXT or using a vertex array specified with
240    VertexAttribLPointerEXT and a size of three.
241
242
243Additions to Chapter 3 of the OpenGL 3.2 (Compatibility Profile) Specification
244(Rasterization)
245
246    None.
247
248Additions to Chapter 4 of the OpenGL 3.2 (Compatibility Profile) Specification
249(Per-Fragment Operations and the Frame Buffer)
250
251    None.
252
253Additions to Chapter 5 of the OpenGL 3.2 (Compatibility Profile) Specification
254(Special Functions)
255
256    None.
257
258Additions to Chapter 6 of the OpenGL 3.2 (Compatibility Profile) Specification
259(State and State Requests)
260
261    Modify Section 6.1.15, Shader and Program Queries, p. 384
262
263    (add to the last list of commands, p. 387)
264
265      void GetVertexAttribLi64vNV(uint index, enum pname, int64EXT *params);
266      void GetVertexAttribLui64vNV(uint index, enum pname, uint64EXT *params);
267
268    (modify the third paragraph, p. 388) The query CURRENT_VERTEX_ATTRIB
269    returns the current value for the generic attribute
270    <index>. GetVertexAttribdv and GetVertexAttribfv read and return the
271    current attribute values as four single-precision floating-point values;
272    GetVertexAttribiv reads them as floating-point values and converts them to
273    four integer values; GetVertexAttribIiv reads and returns them as signed
274    integers; GetVertexAttribIuiv reads and returns them as four unsigned
275    integers; GetVertexAttribLdvEXT reads and returns them as four double-
276    precision floating-point values.  GetVertexAttribLi64vNV reads and returns
277    them as four 64-bit signed integer values.  GetVertexAttribLui64vNV reads
278    and returns them as four 64-bit unsigned integer values.  The results of
279    the query are undefined if the current attribute values are read using one
280    data type but were specified using a different one.  The error
281    INVALID_OPERATION is generated if index is zero, as there is no current
282    value for generic attribute zero.
283
284
285Additions to Appendix A of the OpenGL 3.2 (Compatibility Profile)
286Specification (Invariance)
287
288    None.
289
290Additions to the AGL/GLX/WGL Specifications
291
292    None.
293
294GLX Protocol
295
296    TBD
297
298Dependencies on NV_vertex_buffer_unified_memory
299
300    If NV_vertex_buffer_unified_memory is not supported, remove the
301    VertexAttribLFormatNV command.
302
303Dependencies on NV_gpu_program5 and NV_gpu_shader5
304
305    This extension provides the ability to specify the values of vertex
306    attributes with 64-bit components.  To use these vertex attributes,
307    separate extensions are required to read the values.  The NV_gpu_program5
308    extension provides support for 64-bit integer inputs in assembly programs;
309    NV_gpu_shader5 provides similar support for GLSL vertex shaders.  To
310    enable this capability in a GLSL vertex shader on implementations
311    supporting NV_gpu_shader5, it is necessary to include
312
313      #extension GL_NV_gpu_shader5 : enable
314
315    in the vertex shader text.  The NV_vertex_attrib_integer_64bit extension
316    does not provide any separate new GLSL capabilities and can not be used
317    with "#extension".
318
319    64-bit components are not supported by the fixed-function vertex
320    processing pipeline stage.
321
322Dependencies on EXT_vertex_attrib_64bit
323
324    If EXT_vertex_attrib_64bit is supported, vertex shaders are permitted to
325    use 64-bit floating-point components for their inputs.
326
327    Even if an application only uses 64-bit floating-point values in their
328    vertex shader, this extension may still be useful.  In particular, it
329    provides the VertexAttribLFormatNV function, which allows the "bindless"
330    vertex attribute array support provided by the
331    NV_vertex_buffer_unified_memory extension to be used with 64-bit
332    components, integer or floating-point.
333
334Errors
335
336    None.
337
338New State
339
340    None.
341
342New Implementation Dependent State
343
344    None.
345
346Issues
347
348    (1) What GLSL "#extension" should be required to enable 64-bit integer
349        vertex sahder inputs.
350
351      RESOLVED:  NV_gpu_shader5 provides general-purpose support for 64-bit
352      integer types in shaders, and we have written it to explicitly permit
353      64-bit integer vertex shader inputs.  Since this is the only GLSL
354      capability required for this extension and NV_gpu_shader5 or equivalent
355      functionality is required, there is no separate "#extension" provided
356      for just this extension.
357
358
359Revision History
360
361    Rev.    Date    Author    Changes
362    ----  --------  --------  -----------------------------------------
363     4    03/21/10  pbrown    Minor wording updates to the spec overview,
364                              dependencies, issues, and body.
365
366     3    03/08/10  pbrown    Rename to "NV_vertex_attrib_integer_64bit" to
367                              avoid possible confusion with the floating-
368                              point EXT_vertex_attrib_64bit.  The previous
369                              spec name was "NV_vertex_attrib_64bit".
370
371     2       --     jbolz     Rewrite as (u)int64-only extension of EXT.
372
373     1       --     pbrown    Internal revisions.
374
375
376