15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_vertex_program4 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci (none) 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciStatus 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Shipping for GeForce 8 Series (November 2006) 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Last Modified Date: 12/14/09 205bd8deadSopenharmony_ci NVIDIA Revision: 7 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciNumber 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci 325 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciDependencies 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci OpenGL 1.1 is required. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci This extension is written against the OpenGL 2.0 specification. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci ARB_vertex_program is required. 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci NV_gpu_program4 is required. This extension is supported if 355bd8deadSopenharmony_ci "GL_NV_gpu_program4" is found in the extension string. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci NVX_instanced_arrays affects the definition of this extension. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciOverview 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci This extension builds on the common assembly instruction set 425bd8deadSopenharmony_ci infrastructure provided by NV_gpu_program4, adding vertex program-specific 435bd8deadSopenharmony_ci features. 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci This extension provides the ability to specify integer vertex attributes 465bd8deadSopenharmony_ci that are passed to vertex programs using integer data types, rather than 475bd8deadSopenharmony_ci being converted to floating-point values as in existing vertex attribute 485bd8deadSopenharmony_ci functions. The set of input and output bindings provided includes all 495bd8deadSopenharmony_ci bindings supported by ARB_vertex_program. This extension provides 505bd8deadSopenharmony_ci additional input bindings identifying the index of the vertex when vertex 515bd8deadSopenharmony_ci arrays are used ("vertex.id") and the instance number when instanced 525bd8deadSopenharmony_ci arrays are used ("vertex.instance", requires EXT_draw_instanced). It 535bd8deadSopenharmony_ci also provides output bindings allowing vertex programs to directly specify 545bd8deadSopenharmony_ci clip distances (for user clipping) plus a set of generic attributes that 555bd8deadSopenharmony_ci allow programs to pass a greater number of attributes to subsequent 565bd8deadSopenharmony_ci pipeline stages than is possible using only the pre-defined fixed-function 575bd8deadSopenharmony_ci vertex outputs. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci By and large, programs written to ARB_vertex_program can be ported 605bd8deadSopenharmony_ci directly by simply changing the program header from "!!ARBvp1.0" to 615bd8deadSopenharmony_ci "!!NVvp4.0", and then modifying instructions to take advantage of the 625bd8deadSopenharmony_ci expanded feature set. There are a small number of areas where this 635bd8deadSopenharmony_ci extension is not a functional superset of previous vertex program 645bd8deadSopenharmony_ci extensions, which are documented in the NV_gpu_program4 specification. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciNew Procedures and Functions 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci void VertexAttribI1iEXT(uint index, int x); 695bd8deadSopenharmony_ci void VertexAttribI2iEXT(uint index, int x, int y); 705bd8deadSopenharmony_ci void VertexAttribI3iEXT(uint index, int x, int y, int z); 715bd8deadSopenharmony_ci void VertexAttribI4iEXT(uint index, int x, int y, int z, int w); 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ci void VertexAttribI1uiEXT(uint index, uint x); 745bd8deadSopenharmony_ci void VertexAttribI2uiEXT(uint index, uint x, uint y); 755bd8deadSopenharmony_ci void VertexAttribI3uiEXT(uint index, uint x, uint y, uint z); 765bd8deadSopenharmony_ci void VertexAttribI4uiEXT(uint index, uint x, uint y, uint z, uint w); 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci void VertexAttribI1ivEXT(uint index, const int *v); 795bd8deadSopenharmony_ci void VertexAttribI2ivEXT(uint index, const int *v); 805bd8deadSopenharmony_ci void VertexAttribI3ivEXT(uint index, const int *v); 815bd8deadSopenharmony_ci void VertexAttribI4ivEXT(uint index, const int *v); 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci void VertexAttribI1uivEXT(uint index, const uint *v); 845bd8deadSopenharmony_ci void VertexAttribI2uivEXT(uint index, const uint *v); 855bd8deadSopenharmony_ci void VertexAttribI3uivEXT(uint index, const uint *v); 865bd8deadSopenharmony_ci void VertexAttribI4uivEXT(uint index, const uint *v); 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci void VertexAttribI4bvEXT(uint index, const byte *v); 895bd8deadSopenharmony_ci void VertexAttribI4svEXT(uint index, const short *v); 905bd8deadSopenharmony_ci void VertexAttribI4ubvEXT(uint index, const ubyte *v); 915bd8deadSopenharmony_ci void VertexAttribI4usvEXT(uint index, const ushort *v); 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci void VertexAttribIPointerEXT(uint index, int size, enum type, 945bd8deadSopenharmony_ci sizei stride, const void *pointer); 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci void GetVertexAttribIivEXT(uint index, enum pname, int *params); 975bd8deadSopenharmony_ci void GetVertexAttribIuivEXT(uint index, enum pname, uint *params); 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci (note: all these functions are shared with the EXT_gpu_shader4 1005bd8deadSopenharmony_ci extension.) 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ciNew Tokens 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci Accepted by the <pname> parameters of GetVertexAttribdv, 1055bd8deadSopenharmony_ci GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIivEXT, and 1065bd8deadSopenharmony_ci GetVertexAttribIuivEXT: 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci (note: this token is shared with the EXT_gpu_shader4 extension.) 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation) 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci Modify Section 2.7 (Vertex Specification), p.20 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci (insert before last paragraph, p.22) The commands 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci void VertexAttribI[1234]{i,ui}EXT(uint index, T values); 1195bd8deadSopenharmony_ci void VertexAttribI[1234]{i,ui}vEXT(uint index, T values); 1205bd8deadSopenharmony_ci void VertexAttribI4{b,s,ub,us}vEXT(uint index, T values); 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci specify fixed-point coordinates that are not converted to floating-point 1235bd8deadSopenharmony_ci values, but instead are represented as signed or unsigned integer values. 1245bd8deadSopenharmony_ci Vertex programs that use integer instructions may read these attributes 1255bd8deadSopenharmony_ci using integer data types. A vertex program that attempts to read a vertex 1265bd8deadSopenharmony_ci attribute as a float will get undefined results if the attribute was 1275bd8deadSopenharmony_ci specified as an integer, and vice versa. 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci (modify second paragraph, p.23) Setting generic vertex attribute zero 1305bd8deadSopenharmony_ci specifies a vertex; the four vertex coordinates are taken from the values 1315bd8deadSopenharmony_ci of attribute zero. A Vertex2, Vertex3, or Vertex4 command is completely 1325bd8deadSopenharmony_ci equivalent to the corresponding VertexAttrib* or VertexAttribI* command 1335bd8deadSopenharmony_ci with an index of zero. ... 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci (insert at end of function list, p.24) 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci void VertexAttribIPointerEXT(uint index, int size, enum type, 1385bd8deadSopenharmony_ci sizei stride, const void *pointer); 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci (modify last paragraph, p.24) The <index> parameter in the 1415bd8deadSopenharmony_ci VertexAttribPointer and VertexAttribIPointerEXT commands identify the 1425bd8deadSopenharmony_ci generic vertex attribute array being described. The error INVALID_VALUE 1435bd8deadSopenharmony_ci is generated if <index> is greater than or equal to MAX_VERTEX_ATTRIBS. 1445bd8deadSopenharmony_ci Generic attribute arrays with integer <type> arguments can be handled in 1455bd8deadSopenharmony_ci one of three ways: converted to float by normalizing to [0,1] or [-1,1] 1465bd8deadSopenharmony_ci as specified in table 2.9, converted directly to float, or left as integer 1475bd8deadSopenharmony_ci values. Data for an array specified by VertexAttribPointer will be 1485bd8deadSopenharmony_ci converted to floating-point by normalizing if the <normalized> parameter 1495bd8deadSopenharmony_ci is TRUE, and converted directly to floating-point otherwise. Data for an 1505bd8deadSopenharmony_ci array specified by VertexAttribIPointerEXT will always be left as integer 1515bd8deadSopenharmony_ci values. 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci (modify Table 2.4, p. 25) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci Integer 1565bd8deadSopenharmony_ci Command Sizes Handling Types 1575bd8deadSopenharmony_ci ---------------------- ------- --------- ----------------- 1585bd8deadSopenharmony_ci VertexPointer 2,3,4 cast ... 1595bd8deadSopenharmony_ci NormalPointer 3 normalize ... 1605bd8deadSopenharmony_ci ColorPointer 3,4 normalize ... 1615bd8deadSopenharmony_ci SecondaryColorPointer 3 normalize ... 1625bd8deadSopenharmony_ci IndexPointer 1 cast ... 1635bd8deadSopenharmony_ci FogCoordPointer 1 n/a ... 1645bd8deadSopenharmony_ci TexCoordPointer 1,2,3,4 cast ... 1655bd8deadSopenharmony_ci EdgeFlagPointer 1 integer ... 1665bd8deadSopenharmony_ci VertexAttribPointer 1,2,3,4 flag ... 1675bd8deadSopenharmony_ci VertexAttribIPointerEXT 1,2,3,4 integer byte, ubyte, short, 1685bd8deadSopenharmony_ci ushort, int, uint 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Table 2.4: Vertex array sizes (values per vertex) and data types. The 1715bd8deadSopenharmony_ci "integer handling" column indicates how fixed-point data types are 1725bd8deadSopenharmony_ci handled: "cast" means that they converted to floating-point directly, 1735bd8deadSopenharmony_ci "normalize" means that they are converted to floating-point by 1745bd8deadSopenharmony_ci normalizing to [0,1] (for unsigned types) or [-1,1] (for signed types), 1755bd8deadSopenharmony_ci "integer" means that they remain as integer values, and "flag" means 1765bd8deadSopenharmony_ci that either "cast" or "normalized" applies, depending on the setting of 1775bd8deadSopenharmony_ci the <normalized> flag in VertexAttribPointer. 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci (modify end of pseudo-code, pp. 27-28) 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci for (j = 1; j < genericAttributes; j++) { 1825bd8deadSopenharmony_ci if (generic vertex attribute j array enabled) { 1835bd8deadSopenharmony_ci if (generic vertex attribute j array is a pure integer array) { 1845bd8deadSopenharmony_ci VertexAttribI[size][type]vEXT(j, generic vertex attribute j 1855bd8deadSopenharmony_ci array element i); 1865bd8deadSopenharmony_ci } else if (generic vertex attribute j array normalization flag 1875bd8deadSopenharmony_ci is set and <type> is not FLOAT or DOUBLE) { 1885bd8deadSopenharmony_ci VertexAttrib[size]N[type]v(j, generic vertex attribute j 1895bd8deadSopenharmony_ci array element i); 1905bd8deadSopenharmony_ci } else { 1915bd8deadSopenharmony_ci VertexAttrib[size][type]v(j, generic vertex attribute j 1925bd8deadSopenharmony_ci array element i); 1935bd8deadSopenharmony_ci } 1945bd8deadSopenharmony_ci } 1955bd8deadSopenharmony_ci } 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci if (generic vertex attribute 0 array enabled) { 1985bd8deadSopenharmony_ci if (generic vertex attribute 0 array is a pure integer array) { 1995bd8deadSopenharmony_ci VertexAttribI[size][type]vEXT(0, generic vertex attribute 0 2005bd8deadSopenharmony_ci array element i); 2015bd8deadSopenharmony_ci } else if (generic vertex attribute 0 array normalization flag 2025bd8deadSopenharmony_ci is set and <type> is not FLOAT or DOUBLE) { 2035bd8deadSopenharmony_ci VertexAttrib[size]N[type]v(0, generic vertex attribute 0 2045bd8deadSopenharmony_ci array element i); 2055bd8deadSopenharmony_ci } else { 2065bd8deadSopenharmony_ci VertexAttrib[size][type]v(0, generic vertex attribute 0 2075bd8deadSopenharmony_ci array element i); 2085bd8deadSopenharmony_ci } 2095bd8deadSopenharmony_ci } 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci Modify Section 2.X, GPU Programs 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci (insert after second paragraph) 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci Vertex Programs 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci Vertex programs are used to compute the transformed attributes of a 2185bd8deadSopenharmony_ci vertex, in lieu of the set of fixed-function operations described in 2195bd8deadSopenharmony_ci sections 2.10 through 2.13. Vertex programs are run on a single vertex at 2205bd8deadSopenharmony_ci a time, and the state of neighboring vertices is not available. The 2215bd8deadSopenharmony_ci inputs available to a vertex program are the vertex attributes described 2225bd8deadSopenharmony_ci in section 2.7. The results of the program are the attributes of a 2235bd8deadSopenharmony_ci transformed vertex, which include (among other things) a transformed 2245bd8deadSopenharmony_ci position, colors, and texture coordinates. The vertices transformed by a 2255bd8deadSopenharmony_ci vertex program are then processed normally by the remainder of the GL 2265bd8deadSopenharmony_ci pipeline. 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci Modify Section 2.X.2, Program Grammar 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci (replace third paragraph) 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci Vertex programs are required to begin with the header string "!!NVvp4.0". 2335bd8deadSopenharmony_ci This header string identifies the subsequent program body as being a 2345bd8deadSopenharmony_ci vertex program and indicates that it should be parsed according to the 2355bd8deadSopenharmony_ci base NV_gpu_program4 grammar plus the additions below. Program string 2365bd8deadSopenharmony_ci parsing begins with the character immediately following the header string. 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci (add the following grammar rules to the NV_gpu_program4 base grammar) 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci <resultUseW> ::= <resultVarName> <arrayMem> <optWriteMask> 2415bd8deadSopenharmony_ci | <resultColor> <optWriteMask> 2425bd8deadSopenharmony_ci | <resultColor> "." <colorType> <optWriteMask> 2435bd8deadSopenharmony_ci | <resultColor> "." <faceType> <optWriteMask> 2445bd8deadSopenharmony_ci | <resultColor> "." <faceType> "." <colorType> 2455bd8deadSopenharmony_ci "." <optWriteMask> 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ci <resultUseD> ::= <resultColor> 2485bd8deadSopenharmony_ci | <resultColor> "." <colorType> 2495bd8deadSopenharmony_ci | <resultColor> "." <faceType> 2505bd8deadSopenharmony_ci | <resultColor> "." <faceType> "." <colorType> 2515bd8deadSopenharmony_ci | <resultMulti> 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci <attribBasic> ::= <vtxPrefix> "position" 2545bd8deadSopenharmony_ci | <vtxPrefix> "weight" <optArrayMemAbs> 2555bd8deadSopenharmony_ci | <vtxPrefix> "normal" 2565bd8deadSopenharmony_ci | <vtxPrefix> "fogcoord" 2575bd8deadSopenharmony_ci | <attribTexCoord> <optArrayMemAbs> 2585bd8deadSopenharmony_ci | <attribGeneric> <arrayMemAbs> 2595bd8deadSopenharmony_ci | <vtxPrefix> "id" 2605bd8deadSopenharmony_ci | <vtxPrefix> "instance" 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci <attribColor> ::= <vtxPrefix> "color" 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci <attribMulti> ::= <attribTexCoord> <arrayRange> 2655bd8deadSopenharmony_ci | <attribGeneric> <arrayRange> 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci <attribTexCoord> ::= <vtxPrefix> "texcoord" 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci <attribGeneric> ::= <vtxPrefix> "attrib" 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci <vtxPrefix> ::= "vertex" "." 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci <resultBasic> ::= <resPrefix> "position" 2745bd8deadSopenharmony_ci | <resPrefix> "fogcoord" 2755bd8deadSopenharmony_ci | <resPrefix> "pointsize" 2765bd8deadSopenharmony_ci | <resultTexCoord> <optArrayMemAbs> 2775bd8deadSopenharmony_ci | <resultClip> <arrayMemAbs> 2785bd8deadSopenharmony_ci | <resultGeneric> <arrayMemAbs> 2795bd8deadSopenharmony_ci | <resPrefix> "id" 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci <resultColor> ::= <resPrefix> "color" 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci <resultMulti> ::= <resultTexCoord> <arrayRange> 2845bd8deadSopenharmony_ci | <resultClip> <arrayRange> 2855bd8deadSopenharmony_ci | <resultGeneric> <arrayRange> 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci <resultTexCoord> ::= <resPrefix> "texcoord" 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ci <resultClip> ::= <resPrefix> "clip" 2905bd8deadSopenharmony_ci 2915bd8deadSopenharmony_ci <resultGeneric> ::= <resPrefix> "attrib" 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci <resPrefix> ::= "result" "." 2945bd8deadSopenharmony_ci 2955bd8deadSopenharmony_ci (add the following subsection to Section 2.X.3.2, Program Attribute 2965bd8deadSopenharmony_ci Variables) 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ci Vertex program attribute variables describe the attributes of the vertex 2995bd8deadSopenharmony_ci being transformed, as specified by the application. The set of available 3005bd8deadSopenharmony_ci bindings is enumerated in Table X.X. Except where otherwise noted, all 3015bd8deadSopenharmony_ci vertex program attribute bindings are four-component floating-point 3025bd8deadSopenharmony_ci vectors. 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci Vertex Attribute Binding Components Underlying State 3055bd8deadSopenharmony_ci ------------------------ ---------- ------------------------------ 3065bd8deadSopenharmony_ci vertex.position (x,y,z,w) object coordinates 3075bd8deadSopenharmony_ci vertex.normal (x,y,z,1) normal 3085bd8deadSopenharmony_ci vertex.color (r,g,b,a) primary color 3095bd8deadSopenharmony_ci vertex.color.primary (r,g,b,a) primary color 3105bd8deadSopenharmony_ci vertex.color.secondary (r,g,b,a) secondary color 3115bd8deadSopenharmony_ci vertex.fogcoord (f,0,0,1) fog coordinate 3125bd8deadSopenharmony_ci vertex.texcoord (s,t,r,q) texture coordinate, unit 0 3135bd8deadSopenharmony_ci vertex.texcoord[n] (s,t,r,q) texture coordinate, unit n 3145bd8deadSopenharmony_ci vertex.attrib[n] (x,y,z,w) generic vertex attribute n 3155bd8deadSopenharmony_ci vertex.id (id,-,-,-) vertex identifier (integer) 3165bd8deadSopenharmony_ci vertex.instance (i,-,-,-) primitive instance number (integer) 3175bd8deadSopenharmony_ci vertex.texcoord[n..o] (x,y,z,w) array of texture coordinates 3185bd8deadSopenharmony_ci vertex.attrib[n..o] (x,y,z,w) array of generic vertex attributes 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci Table X.X, Vertex Program Attribute Bindings. <n> and <o> refer to 3215bd8deadSopenharmony_ci integer constants. Only the "vertex.texcoord" and "vertex.attrib" 3225bd8deadSopenharmony_ci bindings are available in arrays. 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci NVIDIA Note: The "vertex.weight" and "vertex.matrixindex" bindings 3255bd8deadSopenharmony_ci described in ARB_vertex_program use state provided only by extensions 3265bd8deadSopenharmony_ci not supported by NVIDIA implementations and are not available. 3275bd8deadSopenharmony_ci 3285bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.position", the "x", "y", "z" 3295bd8deadSopenharmony_ci and "w" components of the vertex attribute variable are filled with the 3305bd8deadSopenharmony_ci "x", "y", "z", and "w" components, respectively, of the vertex position. 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.normal", the "x", "y", and 3335bd8deadSopenharmony_ci "z" components of the vertex attribute variable are filled with the "x", 3345bd8deadSopenharmony_ci "y", and "z" components, respectively, of the vertex normal. The "w" 3355bd8deadSopenharmony_ci component is filled with 1. 3365bd8deadSopenharmony_ci 3375bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.color" or 3385bd8deadSopenharmony_ci "vertex.color.primary", the "x", "y", "z", and "w" components of the 3395bd8deadSopenharmony_ci vertex attribute variable are filled with the "r", "g", "b", and "a" 3405bd8deadSopenharmony_ci components, respectively, of the vertex color. 3415bd8deadSopenharmony_ci 3425bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.color.secondary", the "x", 3435bd8deadSopenharmony_ci "y", "z", and "w" components of the vertex attribute variable are filled 3445bd8deadSopenharmony_ci with the "r", "g", "b", and "a" components, respectively, of the vertex 3455bd8deadSopenharmony_ci secondary color. 3465bd8deadSopenharmony_ci 3475bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.fogcoord", the "x" component 3485bd8deadSopenharmony_ci of the vertex attribute variable is filled with the vertex fog coordinate. 3495bd8deadSopenharmony_ci The "y", "z", and "w" coordinates are filled with 0, 0, and 1, 3505bd8deadSopenharmony_ci respectively. 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.texcoord" or 3535bd8deadSopenharmony_ci "vertex.texcoord[n]", the "x", "y", "z", and "w" components of the vertex 3545bd8deadSopenharmony_ci attribute variable are filled with the "s", "t", "r", and "q" components, 3555bd8deadSopenharmony_ci respectively, of the vertex texture coordinate set <n>. If "[n]" is 3565bd8deadSopenharmony_ci omitted, texture coordinate set zero is used. 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.instance", the "x" component 3595bd8deadSopenharmony_ci of the vertex attribute variable is filled with the integer instance 3605bd8deadSopenharmony_ci number for the primitive to which the vertex belongs. The "y", "z", and 3615bd8deadSopenharmony_ci "w" components are undefined. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.attrib[n]", the "x", "y", 3645bd8deadSopenharmony_ci "z" and "w" components of the generic vertex attribute variable are filled 3655bd8deadSopenharmony_ci with the "x", "y", "z", and "w" components, respectively, of generic 3665bd8deadSopenharmony_ci vertex attribute <n>. Note that "vertex.attrib[0]" and "vertex.position" 3675bd8deadSopenharmony_ci are equivalent. Generic vertex attribute bindings are typeless, and can 3685bd8deadSopenharmony_ci be interpreted as having floating-point, signed integer, or unsigned 3695bd8deadSopenharmony_ci integer values, depending on how they are used in the program text. If a 3705bd8deadSopenharmony_ci vertex attribute is read using a data type different from the one used to 3715bd8deadSopenharmony_ci specify the generic attribute, the values corresponding to the binding are 3725bd8deadSopenharmony_ci undefined. 3735bd8deadSopenharmony_ci 3745bd8deadSopenharmony_ci As described in section 2.7, setting a generic vertex attribute may leave 3755bd8deadSopenharmony_ci a corresponding conventional vertex attribute undefined, and vice versa. 3765bd8deadSopenharmony_ci To prevent inadvertent use of attribute pairs with undefined attributes, a 3775bd8deadSopenharmony_ci vertex program will fail to load if it binds both a conventional vertex 3785bd8deadSopenharmony_ci attribute and a generic vertex attribute listed in the same row of Table 3795bd8deadSopenharmony_ci X.X. 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci Conventional Attribute Binding Generic Attribute Binding 3825bd8deadSopenharmony_ci ------------------------------ ------------------------- 3835bd8deadSopenharmony_ci vertex.position vertex.attrib[0] 3845bd8deadSopenharmony_ci vertex.normal vertex.attrib[2] 3855bd8deadSopenharmony_ci vertex.color vertex.attrib[3] 3865bd8deadSopenharmony_ci vertex.color.primary vertex.attrib[3] 3875bd8deadSopenharmony_ci vertex.color.secondary vertex.attrib[4] 3885bd8deadSopenharmony_ci vertex.fogcoord vertex.attrib[5] 3895bd8deadSopenharmony_ci vertex.texcoord vertex.attrib[8] 3905bd8deadSopenharmony_ci vertex.texcoord[0] vertex.attrib[8] 3915bd8deadSopenharmony_ci vertex.texcoord[1] vertex.attrib[9] 3925bd8deadSopenharmony_ci vertex.texcoord[2] vertex.attrib[10] 3935bd8deadSopenharmony_ci vertex.texcoord[3] vertex.attrib[11] 3945bd8deadSopenharmony_ci vertex.texcoord[4] vertex.attrib[12] 3955bd8deadSopenharmony_ci vertex.texcoord[5] vertex.attrib[13] 3965bd8deadSopenharmony_ci vertex.texcoord[6] vertex.attrib[14] 3975bd8deadSopenharmony_ci vertex.texcoord[7] vertex.attrib[15] 3985bd8deadSopenharmony_ci vertex.texcoord[n] vertex.attrib[8+n] 3995bd8deadSopenharmony_ci 4005bd8deadSopenharmony_ci Table X.X: Invalid Vertex Attribute Binding Pairs. Vertex programs 4015bd8deadSopenharmony_ci may not bind both attributes listed in any row. The <n> in the last row 4025bd8deadSopenharmony_ci matches the number of any valid texture unit. 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci If a vertex attribute binding matches "vertex.texcoord[n..o]" or 4055bd8deadSopenharmony_ci "vertex.attrib[n..o]", a sequence of 1+<o>-<n> texture coordinate bindings 4065bd8deadSopenharmony_ci are created. For texture coordinates, it is as though the sequence 4075bd8deadSopenharmony_ci "vertex.texcoord[n], vertex.texcoord[n+1], ... vertex.texcoord[o]" were 4085bd8deadSopenharmony_ci specfied. These bindings are available only in explicit declarations of 4095bd8deadSopenharmony_ci array variables. A program will fail to load if <n> is greater than <o>. 4105bd8deadSopenharmony_ci 4115bd8deadSopenharmony_ci When doing vertex array rendering using buffer objects, a vertex ID is 4125bd8deadSopenharmony_ci also available. If a vertex attribute binding matches "vertex.id", the 4135bd8deadSopenharmony_ci "x" component of this vertex attribute is filled with the integer index 4145bd8deadSopenharmony_ci <i> implicitly passed to ArrayElement() to specify the vertex. The vertex 4155bd8deadSopenharmony_ci ID is defined if and only if: 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci * the vertex comes from a vertex array command that specifies a complete 4185bd8deadSopenharmony_ci primitive (e.g., DrawArrays, DrawElements), 4195bd8deadSopenharmony_ci 4205bd8deadSopenharmony_ci * all enabled vertex arrays have non-zero buffer object bindings, and 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci * the vertex does not come from a display list (even if the display list 4235bd8deadSopenharmony_ci was compiled using DrawArrays/DrawElements using buffer objects). 4245bd8deadSopenharmony_ci 4255bd8deadSopenharmony_ci The "y", "z", and "w" components of the vertex attribute are always 4265bd8deadSopenharmony_ci undefined. 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ci (add the following subsection to section 2.X.3.5, Program Results.) 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci Vertex programs produce vertices, and the set of result variables 4315bd8deadSopenharmony_ci available to such programs correspond to the attributes of a transformed 4325bd8deadSopenharmony_ci vertex. The set of allowable result variable bindings for vertex and 4335bd8deadSopenharmony_ci fragment programs is given in Table X.4. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci Binding Components Description 4365bd8deadSopenharmony_ci ----------------------------- ---------- ---------------------------- 4375bd8deadSopenharmony_ci result.position (x,y,z,w) position in clip coordinates 4385bd8deadSopenharmony_ci result.color (r,g,b,a) front-facing primary color 4395bd8deadSopenharmony_ci result.color.primary (r,g,b,a) front-facing primary color 4405bd8deadSopenharmony_ci result.color.secondary (r,g,b,a) front-facing secondary color 4415bd8deadSopenharmony_ci result.color.front (r,g,b,a) front-facing primary color 4425bd8deadSopenharmony_ci result.color.front.primary (r,g,b,a) front-facing primary color 4435bd8deadSopenharmony_ci result.color.front.secondary (r,g,b,a) front-facing secondary color 4445bd8deadSopenharmony_ci result.color.back (r,g,b,a) back-facing primary color 4455bd8deadSopenharmony_ci result.color.back.primary (r,g,b,a) back-facing primary color 4465bd8deadSopenharmony_ci result.color.back.secondary (r,g,b,a) back-facing secondary color 4475bd8deadSopenharmony_ci result.fogcoord (f,*,*,*) fog coordinate 4485bd8deadSopenharmony_ci result.pointsize (s,*,*,*) point size 4495bd8deadSopenharmony_ci result.texcoord (s,t,r,q) texture coordinate, unit 0 4505bd8deadSopenharmony_ci result.texcoord[n] (s,t,r,q) texture coordinate, unit n 4515bd8deadSopenharmony_ci result.attrib[n] (x,y,z,w) generic interpolant n 4525bd8deadSopenharmony_ci result.clip[n] (d,*,*,*) clip plane distance 4535bd8deadSopenharmony_ci result.texcoord[n..o] (s,t,r,q) texture coordinates n thru o 4545bd8deadSopenharmony_ci result.attrib[n..o] (x,y,z,w) generic interpolants n thru o 4555bd8deadSopenharmony_ci result.clip[n..o] (d,*,*,*) clip distances n thru o 4565bd8deadSopenharmony_ci result.id (id,*,*,*) vertex id 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci Table X.4: Vertex Program Result Variable Bindings. Components labeled 4595bd8deadSopenharmony_ci "*" are unused. 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci If a result variable binding matches "result.position", updates to the 4625bd8deadSopenharmony_ci "x", "y", "z", and "w" components of the result variable modify the "x", 4635bd8deadSopenharmony_ci "y", "z", and "w" components, respectively, of the transformed vertex's 4645bd8deadSopenharmony_ci clip coordinates. Final window coordinates will be generated for the 4655bd8deadSopenharmony_ci vertex as described in section 2.14.4.4. 4665bd8deadSopenharmony_ci 4675bd8deadSopenharmony_ci If a result variable binding match begins with "result.color", updates to 4685bd8deadSopenharmony_ci the "x", "y", "z", and "w" components of the result variable modify the 4695bd8deadSopenharmony_ci "r", "g", "b", and "a" components, respectively, of the corresponding 4705bd8deadSopenharmony_ci vertex color attribute in Table X.4. Color bindings that do not specify 4715bd8deadSopenharmony_ci "front" or "back" are consided to refer to front-facing colors. Color 4725bd8deadSopenharmony_ci bindings that do not specify "primary" or "secondary" are considered to 4735bd8deadSopenharmony_ci refer to primary colors. 4745bd8deadSopenharmony_ci 4755bd8deadSopenharmony_ci If a result variable binding matches "result.fogcoord", updates to the "x" 4765bd8deadSopenharmony_ci component of the result variable set the transformed vertex's fog 4775bd8deadSopenharmony_ci coordinate. Updates to the "y", "z", and "w" components of the result 4785bd8deadSopenharmony_ci variable have no effect. 4795bd8deadSopenharmony_ci 4805bd8deadSopenharmony_ci If a result variable binding matches "result.pointsize", updates to the 4815bd8deadSopenharmony_ci "x" component of the result variable set the transformed vertex's point 4825bd8deadSopenharmony_ci size. Updates to the "y", "z", and "w" components of the result variable 4835bd8deadSopenharmony_ci have no effect. 4845bd8deadSopenharmony_ci 4855bd8deadSopenharmony_ci If a result variable binding matches "result.texcoord" or 4865bd8deadSopenharmony_ci "result.texcoord[n]", updates to the "x", "y", "z", and "w" components of 4875bd8deadSopenharmony_ci the result variable set the "s", "t", "r" and "q" components, 4885bd8deadSopenharmony_ci respectively, of the transformed vertex's texture coordinates for texture 4895bd8deadSopenharmony_ci unit <n>. If "[n]" is omitted, texture unit zero is selected. 4905bd8deadSopenharmony_ci 4915bd8deadSopenharmony_ci If a result variable binding matches "result.attrib[n]", updates to the 4925bd8deadSopenharmony_ci "x", "y", "z", and "w" components of the result variable set the "x", "y", 4935bd8deadSopenharmony_ci "z", and "w" components of the generic interpolant <n>. Generic 4945bd8deadSopenharmony_ci interpolants may be used by subsequent geometry or fragment program 4955bd8deadSopenharmony_ci invocations, but are not available to fixed-function fragment processing. 4965bd8deadSopenharmony_ci 4975bd8deadSopenharmony_ci If a result variable binding matches "result.clip[n]", updates to the "x" 4985bd8deadSopenharmony_ci component of the result variable set the clip distance for clip plane <n>. 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci If a result variable binding matches "result.texcoord[n..o]", 5015bd8deadSopenharmony_ci "result.attrib[n..o]", or "result.clip[n..o]", a sequence of 1+<o>-<n> 5025bd8deadSopenharmony_ci bindings is created. For texture coordinates, it is as though the 5035bd8deadSopenharmony_ci sequence "result.texcoord[n], result.texcoord[n+1], 5045bd8deadSopenharmony_ci ... result.texcoord[o]" were specfied. This binding is available only in 5055bd8deadSopenharmony_ci explicit declarations of array variables. A program will fail to load if 5065bd8deadSopenharmony_ci <n> is greater than <o>. 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci If a result variable binding matches "result.id", updates to the "x" 5095bd8deadSopenharmony_ci component of the result variable provide a integer vertex identifier 5105bd8deadSopenharmony_ci available to geometry programs using the "vertex[m].id" attribute binding. 5115bd8deadSopenharmony_ci If a geometry program using vertex IDs is active and a vertex program is 5125bd8deadSopenharmony_ci active, the vertex program must write "result.id" or the vertex ID number 5135bd8deadSopenharmony_ci is undefined. 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci (add the following subsection to section 2.X.6, Program Options.) 5165bd8deadSopenharmony_ci 5175bd8deadSopenharmony_ci Section 2.X.6.Y, Vertex Program Options 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ci + Position-Invariant Vertex Programs (ARB_position_invariant) 5205bd8deadSopenharmony_ci 5215bd8deadSopenharmony_ci If a vertex program specifies the "ARB_position_invariant" option, the 5225bd8deadSopenharmony_ci program is used to generate all transformed vertex attributes except for 5235bd8deadSopenharmony_ci position. Instead, clip coordinates are computed as specified in section 5245bd8deadSopenharmony_ci 2.10. Additionally, user clipping is performed as described in section 5255bd8deadSopenharmony_ci 2.11. Use of position-invariant vertex programs should generally 5265bd8deadSopenharmony_ci guarantee that the transformed position of a vertex should be the same 5275bd8deadSopenharmony_ci whether vertex program mode is enabled or disabled, allowing for correct 5285bd8deadSopenharmony_ci mixed multi-pass rendering semantics. 5295bd8deadSopenharmony_ci 5305bd8deadSopenharmony_ci When the position-invariant option is specified in a vertex program, 5315bd8deadSopenharmony_ci vertex programs can no longer declare (explicitly or implicitly) a result 5325bd8deadSopenharmony_ci variable bound to "result.position". A semantic restriction is added to 5335bd8deadSopenharmony_ci indicate that a vertex program will fail to load if the number of 5345bd8deadSopenharmony_ci instructions it contains exceeds the implementation-dependent limit minus 5355bd8deadSopenharmony_ci four. 5365bd8deadSopenharmony_ci 5375bd8deadSopenharmony_ci (add the following subsection to section 2.X.7, Program Declarations.) 5385bd8deadSopenharmony_ci 5395bd8deadSopenharmony_ci Section 2.X.7.Y, Vertex Program Declarations 5405bd8deadSopenharmony_ci 5415bd8deadSopenharmony_ci No declarations are supported at present for vertex programs. 5425bd8deadSopenharmony_ci 5435bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization) 5445bd8deadSopenharmony_ci 5455bd8deadSopenharmony_ci None. 5465bd8deadSopenharmony_ci 5475bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment 5485bd8deadSopenharmony_ciOperations and the Frame Buffer) 5495bd8deadSopenharmony_ci 5505bd8deadSopenharmony_ci None. 5515bd8deadSopenharmony_ci 5525bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions) 5535bd8deadSopenharmony_ci 5545bd8deadSopenharmony_ci None. 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and 5575bd8deadSopenharmony_ciState Requests) 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ci Modify Section 6.1.14, Shader and Program Queries (p. 256) 5605bd8deadSopenharmony_ci 5615bd8deadSopenharmony_ci (modify 2nd paragraph, p.259) The commands 5625bd8deadSopenharmony_ci 5635bd8deadSopenharmony_ci ... 5645bd8deadSopenharmony_ci void GetVertexAttribIivEXT(uint index, enum pname, int *params); 5655bd8deadSopenharmony_ci void GetVertexAttribIuivEXT(uint index, enum pname, uint *params); 5665bd8deadSopenharmony_ci 5675bd8deadSopenharmony_ci obtain the... <pname> must be one of VERTEX_ATTRIB_ARRAY_ENABLED, 5685bd8deadSopenharmony_ci ... VERTEX_ATTRIB_ARRAY_NORMALIZED, VERTEX_ATTRIB_ARRAY_INTEGER_EXT, or 5695bd8deadSopenharmony_ci CURRENT_VERTEX_ATTRIB. ... 5705bd8deadSopenharmony_ci 5715bd8deadSopenharmony_ci (split 3rd paragraph, p.259) ... The size, stride, type, normalized flag, 5725bd8deadSopenharmony_ci and unconverted integer flag are set by the commands VertexAttribPointer 5735bd8deadSopenharmony_ci and VertexAttribIPointerEXT. The normalized flag is always set to FALSE by 5745bd8deadSopenharmony_ci by VertexAttribIPointerEXT. The unconverted integer flag is always set to 5755bd8deadSopenharmony_ci FALSE by VertexAttribPointer and TRUE by VertexAttribIPointerEXT. 5765bd8deadSopenharmony_ci 5775bd8deadSopenharmony_ci The query CURRENT_VERTEX_ATTRIB returns the current value for the generic 5785bd8deadSopenharmony_ci attribute <index>. GetVertexAttribdv and GetVertexAttribfv read and 5795bd8deadSopenharmony_ci return the current attribute values as floating-point values; 5805bd8deadSopenharmony_ci GetVertexAttribiv reads them as floating-point values and converts them to 5815bd8deadSopenharmony_ci integer values; GetVertexAttribIivEXT reads and returns them a signed 5825bd8deadSopenharmony_ci integers; GetVertexAttribIuivEXT reads and returns them as unsigned 5835bd8deadSopenharmony_ci integers. The results of the query are undefined if the current attribute 5845bd8deadSopenharmony_ci values are read using one data type but specified using a different one. 5855bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if <index> is zero. 5865bd8deadSopenharmony_ci 5875bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 5885bd8deadSopenharmony_ci 5895bd8deadSopenharmony_ci None 5905bd8deadSopenharmony_ci 5915bd8deadSopenharmony_ciGLX Protocol 5925bd8deadSopenharmony_ci 5935bd8deadSopenharmony_ci The following rendering commands are sent to the server as part of a 5945bd8deadSopenharmony_ci glXRender request: 5955bd8deadSopenharmony_ci 5965bd8deadSopenharmony_ci VertexAttribI1ivEXT 5975bd8deadSopenharmony_ci 2 12 rendering command length 5985bd8deadSopenharmony_ci 2 278 rendering command opcode 5995bd8deadSopenharmony_ci 4 CARD32 index 6005bd8deadSopenharmony_ci 4 INT32 v[0] 6015bd8deadSopenharmony_ci 6025bd8deadSopenharmony_ci VertexAttribI2ivEXT 6035bd8deadSopenharmony_ci 2 16 rendering command length 6045bd8deadSopenharmony_ci 2 279 rendering command opcode 6055bd8deadSopenharmony_ci 4 CARD32 index 6065bd8deadSopenharmony_ci 4 INT32 v[0] 6075bd8deadSopenharmony_ci 4 INT32 v[1] 6085bd8deadSopenharmony_ci 6095bd8deadSopenharmony_ci VertexAttribI3ivEXT 6105bd8deadSopenharmony_ci 2 20 rendering command length 6115bd8deadSopenharmony_ci 2 280 rendering command opcode 6125bd8deadSopenharmony_ci 4 CARD32 index 6135bd8deadSopenharmony_ci 4 INT32 v[0] 6145bd8deadSopenharmony_ci 4 INT32 v[1] 6155bd8deadSopenharmony_ci 4 INT32 v[2] 6165bd8deadSopenharmony_ci 6175bd8deadSopenharmony_ci VertexAttribI4ivEXT 6185bd8deadSopenharmony_ci 2 24 rendering command length 6195bd8deadSopenharmony_ci 2 281 rendering command opcode 6205bd8deadSopenharmony_ci 4 CARD32 index 6215bd8deadSopenharmony_ci 4 INT32 v[0] 6225bd8deadSopenharmony_ci 4 INT32 v[1] 6235bd8deadSopenharmony_ci 4 INT32 v[2] 6245bd8deadSopenharmony_ci 4 INT32 v[3] 6255bd8deadSopenharmony_ci 6265bd8deadSopenharmony_ci VertexAttribI1uivEXT 6275bd8deadSopenharmony_ci 2 12 rendering command length 6285bd8deadSopenharmony_ci 2 282 rendering command opcode 6295bd8deadSopenharmony_ci 4 CARD32 index 6305bd8deadSopenharmony_ci 4 CARD32 v[0] 6315bd8deadSopenharmony_ci 6325bd8deadSopenharmony_ci VertexAttribI2uivEXT 6335bd8deadSopenharmony_ci 2 16 rendering command length 6345bd8deadSopenharmony_ci 2 283 rendering command opcode 6355bd8deadSopenharmony_ci 4 CARD32 index 6365bd8deadSopenharmony_ci 4 CARD32 v[0] 6375bd8deadSopenharmony_ci 4 CARD32 v[1] 6385bd8deadSopenharmony_ci 6395bd8deadSopenharmony_ci VertexAttribI3uivEXT 6405bd8deadSopenharmony_ci 2 20 rendering command length 6415bd8deadSopenharmony_ci 2 284 rendering command opcode 6425bd8deadSopenharmony_ci 4 CARD32 index 6435bd8deadSopenharmony_ci 4 CARD32 v[0] 6445bd8deadSopenharmony_ci 4 CARD32 v[1] 6455bd8deadSopenharmony_ci 4 CARD32 v[2] 6465bd8deadSopenharmony_ci 6475bd8deadSopenharmony_ci VertexAttribI4uivEXT 6485bd8deadSopenharmony_ci 2 24 rendering command length 6495bd8deadSopenharmony_ci 2 285 rendering command opcode 6505bd8deadSopenharmony_ci 4 CARD32 index 6515bd8deadSopenharmony_ci 4 CARD32 v[0] 6525bd8deadSopenharmony_ci 4 CARD32 v[1] 6535bd8deadSopenharmony_ci 4 CARD32 v[2] 6545bd8deadSopenharmony_ci 4 CARD32 v[3] 6555bd8deadSopenharmony_ci 6565bd8deadSopenharmony_ci VertexAttribI4bvEXT 6575bd8deadSopenharmony_ci 2 12 rendering command length 6585bd8deadSopenharmony_ci 2 286 rendering command opcode 6595bd8deadSopenharmony_ci 4 CARD32 index 6605bd8deadSopenharmony_ci 1 INT8 v[0] 6615bd8deadSopenharmony_ci 1 INT8 v[1] 6625bd8deadSopenharmony_ci 1 INT8 v[2] 6635bd8deadSopenharmony_ci 1 INT8 v[3] 6645bd8deadSopenharmony_ci 6655bd8deadSopenharmony_ci VertexAttribI4svEXT 6665bd8deadSopenharmony_ci 2 16 rendering command length 6675bd8deadSopenharmony_ci 2 287 rendering command opcode 6685bd8deadSopenharmony_ci 4 CARD32 index 6695bd8deadSopenharmony_ci 2 INT16 v[0] 6705bd8deadSopenharmony_ci 2 INT16 v[1] 6715bd8deadSopenharmony_ci 2 INT16 v[2] 6725bd8deadSopenharmony_ci 2 INT16 v[3] 6735bd8deadSopenharmony_ci 6745bd8deadSopenharmony_ci VertexAttribI4ubvEXT 6755bd8deadSopenharmony_ci 2 12 rendering command length 6765bd8deadSopenharmony_ci 2 288 rendering command opcode 6775bd8deadSopenharmony_ci 4 CARD32 index 6785bd8deadSopenharmony_ci 1 CARD8 v[0] 6795bd8deadSopenharmony_ci 1 CARD8 v[1] 6805bd8deadSopenharmony_ci 1 CARD8 v[2] 6815bd8deadSopenharmony_ci 1 CARD8 v[3] 6825bd8deadSopenharmony_ci 6835bd8deadSopenharmony_ci VertexAttribI4usvEXT 6845bd8deadSopenharmony_ci 2 16 rendering command length 6855bd8deadSopenharmony_ci 2 289 rendering command opcode 6865bd8deadSopenharmony_ci 4 CARD32 index 6875bd8deadSopenharmony_ci 2 CARD16 v[0] 6885bd8deadSopenharmony_ci 2 CARD16 v[1] 6895bd8deadSopenharmony_ci 2 CARD16 v[2] 6905bd8deadSopenharmony_ci 2 CARD16 v[3] 6915bd8deadSopenharmony_ci 6925bd8deadSopenharmony_ci The following non-rendering commands are added. 6935bd8deadSopenharmony_ci 6945bd8deadSopenharmony_ci GetVertexAttribIivEXT 6955bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 6965bd8deadSopenharmony_ci 1 184 GLX opcode 6975bd8deadSopenharmony_ci 2 4 request length 6985bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 6995bd8deadSopenharmony_ci 4 CARD32 index 7005bd8deadSopenharmony_ci 4 ENUM pname 7015bd8deadSopenharmony_ci => 7025bd8deadSopenharmony_ci 1 1 reply 7035bd8deadSopenharmony_ci 1 unused 7045bd8deadSopenharmony_ci 2 CARD16 sequence number 7055bd8deadSopenharmony_ci 4 m reply length, m=(n==1?0:n) 7065bd8deadSopenharmony_ci 4 unused 7075bd8deadSopenharmony_ci 4 CARD32 n 7085bd8deadSopenharmony_ci 7095bd8deadSopenharmony_ci if (n=1) this follows: 7105bd8deadSopenharmony_ci 7115bd8deadSopenharmony_ci 4 INT32 params 7125bd8deadSopenharmony_ci 12 unused 7135bd8deadSopenharmony_ci 7145bd8deadSopenharmony_ci otherwise this follows: 7155bd8deadSopenharmony_ci 7165bd8deadSopenharmony_ci 16 unused 7175bd8deadSopenharmony_ci n*4 LISTofINT32 params 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ci GetVertexAttribIuivEXT 7205bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 7215bd8deadSopenharmony_ci 1 185 GLX opcode 7225bd8deadSopenharmony_ci 2 4 request length 7235bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 7245bd8deadSopenharmony_ci 4 CARD32 index 7255bd8deadSopenharmony_ci 4 ENUM pname 7265bd8deadSopenharmony_ci => 7275bd8deadSopenharmony_ci 1 1 reply 7285bd8deadSopenharmony_ci 1 unused 7295bd8deadSopenharmony_ci 2 CARD16 sequence number 7305bd8deadSopenharmony_ci 4 m reply length, m=(n==1?0:n) 7315bd8deadSopenharmony_ci 4 unused 7325bd8deadSopenharmony_ci 4 CARD32 n 7335bd8deadSopenharmony_ci 7345bd8deadSopenharmony_ci if (n=1) this follows: 7355bd8deadSopenharmony_ci 7365bd8deadSopenharmony_ci 4 CARD32 params 7375bd8deadSopenharmony_ci 12 unused 7385bd8deadSopenharmony_ci 7395bd8deadSopenharmony_ci otherwise this follows: 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ci 16 unused 7425bd8deadSopenharmony_ci n*4 LISTofCARD32 params 7435bd8deadSopenharmony_ci 7445bd8deadSopenharmony_ciErrors 7455bd8deadSopenharmony_ci 7465bd8deadSopenharmony_ci None. 7475bd8deadSopenharmony_ci 7485bd8deadSopenharmony_ciDependencies on EXT_draw_instanced 7495bd8deadSopenharmony_ci 7505bd8deadSopenharmony_ci If EXT_draw_instanced or a similar extension is not supported, 7515bd8deadSopenharmony_ci references to the "vertex.instance" attribute binding and a 7525bd8deadSopenharmony_ci primitive's instance number should be eliminated. 7535bd8deadSopenharmony_ci 7545bd8deadSopenharmony_ciNew State 7555bd8deadSopenharmony_ci 7565bd8deadSopenharmony_ci (add to table 6.7, p. 268) 7575bd8deadSopenharmony_ci Initial 7585bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 7595bd8deadSopenharmony_ci --------- ---- --------------- ------- -------------------- ---- --------- 7605bd8deadSopenharmony_ci VERTEX_ATTRIB_ARRAY 16+xB GetVertexAttrib FALSE vertex attrib array 2.8 vertex-array 7615bd8deadSopenharmony_ci INTEGER_EXT has unconverted ints 7625bd8deadSopenharmony_ci 7635bd8deadSopenharmony_ciNew Implementation Dependent State 7645bd8deadSopenharmony_ci 7655bd8deadSopenharmony_ci None. 7665bd8deadSopenharmony_ci 7675bd8deadSopenharmony_ciIssues 7685bd8deadSopenharmony_ci 7695bd8deadSopenharmony_ci (1) Should a new set of immediate-mode functions be provided for "real 7705bd8deadSopenharmony_ci integer" attributes? If so, which ones should be provided? 7715bd8deadSopenharmony_ci 7725bd8deadSopenharmony_ci RESOLVED: Yes, although an incomplete subset is provided. This 7735bd8deadSopenharmony_ci extension provides vector and non-vector functions that accept 1-, 2-, 7745bd8deadSopenharmony_ci 3-, and 4-component "int" and "uint" values. Additionally, we provide 7755bd8deadSopenharmony_ci only 4-component vector versions of functions that accept "byte", 7765bd8deadSopenharmony_ci "ubyte", "short", and "ushort" values. Note that the ARB_vertex_program 7775bd8deadSopenharmony_ci extension provided a similar incomplete subset. 7785bd8deadSopenharmony_ci 7795bd8deadSopenharmony_ci Since existing VertexAttrib functions include versions that take integer 7805bd8deadSopenharmony_ci values and convert them to float, it was necessary to create a different 7815bd8deadSopenharmony_ci way to specify integer values that are not converted. We created a new 7825bd8deadSopenharmony_ci set of functions using capital letter "I" to denote "real integer" 7835bd8deadSopenharmony_ci values. 7845bd8deadSopenharmony_ci 7855bd8deadSopenharmony_ci This "I" approach is consistent with a similar choice made by 7865bd8deadSopenharmony_ci ARB_vertex_program for the existing integer attribute functions. There 7875bd8deadSopenharmony_ci are two methods of converting to floating point -- straight casts and 7885bd8deadSopenharmony_ci normalization to [0,1] or [-1,+1]. The normalization version of the 7895bd8deadSopenharmony_ci attribute functions use the capital letter "N" to denote normalization. 7905bd8deadSopenharmony_ci 7915bd8deadSopenharmony_ci (2) For vertex arrays with "real integer" attributes, should we provide a 7925bd8deadSopenharmony_ci new function to specify the array or re-use the existing one? 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ci RESOLVED: Provide a new function, VertexAttribIPointerEXT. This 7955bd8deadSopenharmony_ci function and VertexAttribPointer both set the same attribute state -- 7965bd8deadSopenharmony_ci state set by VertexAttribPointer for a given <index> will be overwritten 7975bd8deadSopenharmony_ci by VertexAttribIPointerEXT() and vice versa. There is one new piece of 7985bd8deadSopenharmony_ci state per array (VERTEX_ATTRIB_ARRAY_INTEGER_EXT) which is set to TRUE 7995bd8deadSopenharmony_ci for VertexAttribIPointerEXT() and FALSE by VertexAttribPointer. The use 8005bd8deadSopenharmony_ci of a new function with capital "I" in the name is consistent with the 8015bd8deadSopenharmony_ci choice made for immediate-mode integer attributes. 8025bd8deadSopenharmony_ci 8035bd8deadSopenharmony_ci We considered reusing the existing VertexAttribPointer function by 8045bd8deadSopenharmony_ci hijacking the <normalized> parameter, which specifies whether the 8055bd8deadSopenharmony_ci provided arrays are converted to float by normalizing or a straight 8065bd8deadSopenharmony_ci cast. It would have been possible to add a third setting to indicate 8075bd8deadSopenharmony_ci unconverted integer values, but that has two problems: (a) it doesn't 8085bd8deadSopenharmony_ci agree with the <normalized> flag being specified as a "boolean" (which 8095bd8deadSopenharmony_ci only has two values), and (b) the enum value that would be used would be 8105bd8deadSopenharmony_ci outside the range [0,255] and "boolean" may be represented using 8115bd8deadSopenharmony_ci single-byte data types. 8125bd8deadSopenharmony_ci 8135bd8deadSopenharmony_ci One other possibility would have been to create a new set of <type> 8145bd8deadSopenharmony_ci values to indicate integer values that are never converted to floating 8155bd8deadSopenharmony_ci point -- for example, GL_INTEGER_INT. 8165bd8deadSopenharmony_ci 8175bd8deadSopenharmony_ci (3) Should we provide a whole new set of generic integer vertex 8185bd8deadSopenharmony_ci attributes? 8195bd8deadSopenharmony_ci 8205bd8deadSopenharmony_ci RESOLVED: No. This extension makes the existing generic vertex 8215bd8deadSopenharmony_ci attributes "typeless", where they can store either integer or 8225bd8deadSopenharmony_ci floating-point data. This avoids the need to introduce new hardware 8235bd8deadSopenharmony_ci resources for integer vertex attributes or software overhead in juggling 8245bd8deadSopenharmony_ci integer and floating-point generic attributes. 8255bd8deadSopenharmony_ci 8265bd8deadSopenharmony_ci Vertex programs and any queries that access these attributes are 8275bd8deadSopenharmony_ci responsible for ensuring that they are read using the same data type 8285bd8deadSopenharmony_ci that they were specified using, and will get undefined results on type 8295bd8deadSopenharmony_ci mismatches. Checking for such mismatches would be an excellent feature 8305bd8deadSopenharmony_ci for an instrumented OpenGL driver, or other debugging tool. 8315bd8deadSopenharmony_ci 8325bd8deadSopenharmony_ci (4) Should we provide integer forms of existing conventional attributes? 8335bd8deadSopenharmony_ci 8345bd8deadSopenharmony_ci RESOLVED: No. We could have provided "integer" versions of Color, 8355bd8deadSopenharmony_ci TexCoord, MultiTexCoord, and other functions, but it didn't seem useful. 8365bd8deadSopenharmony_ci The use of generic attributes for such values is perfectly acceptable, 8375bd8deadSopenharmony_ci and fixed-function vertex processing paths won't know what to do with 8385bd8deadSopenharmony_ci integer values for position, color, normal, and so on. 8395bd8deadSopenharmony_ci 8405bd8deadSopenharmony_ci (5) With integers throughout the pipeline, should we provide automatic 8415bd8deadSopenharmony_ci identifiers that can be read to get a "vertex number"? If so, how should 8425bd8deadSopenharmony_ci this functionality be provided? 8435bd8deadSopenharmony_ci 8445bd8deadSopenharmony_ci RESOLVED: The "vertex.id" binding provides an integer "vertex number" 8455bd8deadSopenharmony_ci for each vertex called the "vertex ID". 8465bd8deadSopenharmony_ci 8475bd8deadSopenharmony_ci When using vertex arrays in vertex buffer objects (VBOs), the vertex ID 8485bd8deadSopenharmony_ci is defined to be the index of the vertex in the array -- the value 8495bd8deadSopenharmony_ci implicitly passed to ArrayElement() when DrawArrays() or DrawElements() 8505bd8deadSopenharmony_ci is called. In practice, vertex arrays in buffer objects will be stored 8515bd8deadSopenharmony_ci in memory that is directly accessible by the GPU. When functions such 8525bd8deadSopenharmony_ci as DrawArrays() or DrawElements() are called, a set of vertex indices 8535bd8deadSopenharmony_ci are passed to the GPU to identify the vertices to pull out of the buffer 8545bd8deadSopenharmony_ci objects. These same indices can be easily passed to the vertex program. 8555bd8deadSopenharmony_ci 8565bd8deadSopenharmony_ci Vertex IDs can be used by applications in a variety of ways, for example 8575bd8deadSopenharmony_ci to compute or look up some property of the vertex based on its position 8585bd8deadSopenharmony_ci in the data set. 8595bd8deadSopenharmony_ci 8605bd8deadSopenharmony_ci Note: The EXT_texture_buffer_object extension can be used to bind a 8615bd8deadSopenharmony_ci buffer object as a texture resource, which can the be used for lookups 8625bd8deadSopenharmony_ci in a vertex program. If the amount of memory required for each vertex 8635bd8deadSopenharmony_ci is very large or is variable, the existing vertex array model might not 8645bd8deadSopenharmony_ci work very well. However, with TexBOs (texture buffer objects), the 8655bd8deadSopenharmony_ci vertex program can be used to compute an offset into the buffer object 8665bd8deadSopenharmony_ci holding the vertex data and fetch the data needed using texture lookups. 8675bd8deadSopenharmony_ci This approach blurs the line between texture and vertex pulling, and 8685bd8deadSopenharmony_ci treats the "texture" in question as a simple array. 8695bd8deadSopenharmony_ci 8705bd8deadSopenharmony_ci (6) Should vertex IDs be provided for vertices in immediate mode? 8715bd8deadSopenharmony_ci Vertices in display lists? Vertex arrays compiled into a display list? 8725bd8deadSopenharmony_ci 8735bd8deadSopenharmony_ci RESOLVED: No to all. 8745bd8deadSopenharmony_ci 8755bd8deadSopenharmony_ci A different definition would be needed for immediate mode vertices, 8765bd8deadSopenharmony_ci since the vertex attributes are not specified with an index. It would 8775bd8deadSopenharmony_ci have been possible to implement some sort of counter where the vertex ID 8785bd8deadSopenharmony_ci indicates that the vertex is the <N>th one since the previous Begin 8795bd8deadSopenharmony_ci command. 8805bd8deadSopenharmony_ci 8815bd8deadSopenharmony_ci Vertex arrays compiled into a display list are an even more complicated 8825bd8deadSopenharmony_ci problem, since either the "array element" definition or the alternate 8835bd8deadSopenharmony_ci "immediate mode" definition could be used. If the "array element" 8845bd8deadSopenharmony_ci definition were used, it would additionally be necessary to compile the 8855bd8deadSopenharmony_ci array element values into the display list. This would introduce 8865bd8deadSopenharmony_ci additional overhead into the display list, and the storage space for the 8875bd8deadSopenharmony_ci array element numbers would be wasted if no program using vertex ID were 8885bd8deadSopenharmony_ci ever used. 8895bd8deadSopenharmony_ci 8905bd8deadSopenharmony_ci While such functionality may be useful, it is left to a subsequent 8915bd8deadSopenharmony_ci extension. 8925bd8deadSopenharmony_ci 8935bd8deadSopenharmony_ci If such functionality is required, immediate mode VertexAttribI1i() 8945bd8deadSopenharmony_ci calls can be used to specify the desired "vertex ID" values as integer 8955bd8deadSopenharmony_ci generic attributes. In this case, the vertex program needs to refer to 8965bd8deadSopenharmony_ci the specified generic attribute, and not "vertex.id". 8975bd8deadSopenharmony_ci 8985bd8deadSopenharmony_ci (7) Should vertex identifiers be provided for non-VBO vertex arrays? For 8995bd8deadSopenharmony_ci vertex arrays that are a mix of VBO and non-VBO arrays? 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci RESOLVED: Non-VBO arrays are generally not stored in memory directly 9025bd8deadSopenharmony_ci accessible by the GPU; the data are instead copied from the 9035bd8deadSopenharmony_ci application's memory as they are passed to the GPU. Additionally, the 9045bd8deadSopenharmony_ci index ordering may not be preserved by the copy. For example, if a 9055bd8deadSopenharmony_ci DrawElements() call passes vertices numbered 30, 20, 10, and 0 in order, 9065bd8deadSopenharmony_ci the GPU might see vertex 30's data first, immediately followed by vertex 9075bd8deadSopenharmony_ci 20's data, and so on. 9085bd8deadSopenharmony_ci 9095bd8deadSopenharmony_ci It would be possible for the driver to provide per-vertex ID values to 9105bd8deadSopenharmony_ci the GPU during the copy, but defining such functionality is left to a 9115bd8deadSopenharmony_ci subsequent extension. 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci For vertices with a mix of VBO arrays and non-VBO arrays, the non-VBO 9145bd8deadSopenharmony_ci arrays still have the same copy issues, so the automatic vertex ID is 9155bd8deadSopenharmony_ci not provided. 9165bd8deadSopenharmony_ci 9175bd8deadSopenharmony_ci If such functionality is required, a generic vertex attribute array can 9185bd8deadSopenharmony_ci be set up using VertexAttribIPointerEXT(), holding integer values 0 9195bd8deadSopenharmony_ci through <maxSize>-1, where <maxSize> is the maximum vertex index used. 9205bd8deadSopenharmony_ci For each vertex, the appropriate "vertex ID" value will be taken from 9215bd8deadSopenharmony_ci this array. In this case, the vertex program needs to refer to the 9225bd8deadSopenharmony_ci specified generic attribute, and not "vertex.id". 9235bd8deadSopenharmony_ci 9245bd8deadSopenharmony_ci (8) Should vertex IDs be available to geometry programs, and if so, how? 9255bd8deadSopenharmony_ci 9265bd8deadSopenharmony_ci RESOLVED: Yes, vertex IDs can be passed to geometry programs using the 9275bd8deadSopenharmony_ci "result.id" binding in a vertex program. Note there is no requirement 9285bd8deadSopenharmony_ci that the "result.id" written for a vertex must match the "vertex.id" 9295bd8deadSopenharmony_ci originally provided. 9305bd8deadSopenharmony_ci 9315bd8deadSopenharmony_ci Vertex IDs are not automatically provided to geometry programs; if a 9325bd8deadSopenharmony_ci vertex program doesn't write to "result.id" or if fixed-function vertex 9335bd8deadSopenharmony_ci processing is used, the vertex ID visible to the geometry program is 9345bd8deadSopenharmony_ci undefined. 9355bd8deadSopenharmony_ci 9365bd8deadSopenharmony_ci (9) For instanced arrays (EXT_draw_instanced), should a vertex program 9375bd8deadSopenharmony_ci be able to read the instance number? If so, how? 9385bd8deadSopenharmony_ci 9395bd8deadSopenharmony_ci RESOLVED: Yes, instance IDs are available to vertex programs using the 9405bd8deadSopenharmony_ci "vertex.instance" attribute. The instance ID is available in the "x" 9415bd8deadSopenharmony_ci component and should be read as an integer. 9425bd8deadSopenharmony_ci 9435bd8deadSopenharmony_ci (10) Should instance IDs be available to geometry and fragment programs, 9445bd8deadSopenharmony_ci and if so, how? 9455bd8deadSopenharmony_ci 9465bd8deadSopenharmony_ci UNRESOLVED: No. If a geometry or fragment program needs the instance 9475bd8deadSopenharmony_ci ID, the value read in the vertex program can be passed down using a 9485bd8deadSopenharmony_ci generic integer vertex attribute. 9495bd8deadSopenharmony_ci 9505bd8deadSopenharmony_ci It would be possible to provide a named output binding (e.g., 9515bd8deadSopenharmony_ci "result.instance") that could be used to pass the instance ID to the 9525bd8deadSopenharmony_ci next pipeline stage. Using such a binding would have no functional 9535bd8deadSopenharmony_ci differences from using a generic attribute, except for a name. 9545bd8deadSopenharmony_ci 9555bd8deadSopenharmony_ci In any event, instance IDs are not automatically available to geometry 9565bd8deadSopenharmony_ci or fragment programs; they must be passed from earlier pipeline stages. 9575bd8deadSopenharmony_ci 9585bd8deadSopenharmony_ci (11) This is an NV extension (NV_vertex_program4). Why do all the new 9595bd8deadSopenharmony_ci functions and tokens have an "EXT" extension? 9605bd8deadSopenharmony_ci 9615bd8deadSopenharmony_ci RESOLVED: These functions and tokens are shared between this extension 9625bd8deadSopenharmony_ci and the comparable high-level GLSL programmability extension 9635bd8deadSopenharmony_ci (EXT_gpu_shader4). Rather than provide a duplicate set of functions, we 9645bd8deadSopenharmony_ci simply use the EXT version here. 9655bd8deadSopenharmony_ci 9665bd8deadSopenharmony_ciRevision History 9675bd8deadSopenharmony_ci 9685bd8deadSopenharmony_ci Rev. Date Author Changes 9695bd8deadSopenharmony_ci ---- -------- -------- -------------------------------------------- 9705bd8deadSopenharmony_ci 7 09/15/08 jajones Added GLX protocol. 9715bd8deadSopenharmony_ci 9725bd8deadSopenharmony_ci 6 03/11/09 pbrown Fix section numbers for option/declaration 9735bd8deadSopenharmony_ci sections. 9745bd8deadSopenharmony_ci 9755bd8deadSopenharmony_ci 1-5 pbrown Internal spec development. 976