15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_draw_elements_base_vertex 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_draw_elements_base_vertex 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Daniel Koch, NVIDIA (dkoch 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Shannon Woods, Google 165bd8deadSopenharmony_ci Dominik Witczak, Mobica 175bd8deadSopenharmony_ci Contributors to ARB_draw_elements_base_vertex 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciNotice 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Copyright (c) 2009-2014 The Khronos Group Inc. Copyright terms at 225bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Portions Copyright (c) 2014 NVIDIA Corporation. 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciStatus 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci Complete. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ciVersion 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci Last Modified Date: August 11, 2020 335bd8deadSopenharmony_ci Version: 4 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ciNumber 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci OpenGL ES Extension #204 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciDependencies 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci This specification is written against the OpenGL ES 3.1 (June 4, 2014) 425bd8deadSopenharmony_ci Specifications, but can apply to prior specifications. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci Requires OpenGL ES 2.0. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci This extension interacts with OpenGL ES 3.1. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension interacts with OpenGL ES 3.0. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci This extension interacts with EXT_draw_instanced. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci This extension interacts with NV_draw_instanced. 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci This extension interacts with EXT_instanced_arrays. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci This extension interacts with ANGLE_instanced_arrays. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci This extension interacts with NV_instanced_arrays. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci This extension interacts with EXT_multi_draw_arrays. 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciOverview 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci This extension provides a method to specify a "base vertex offset" 655bd8deadSopenharmony_ci value which is effectively added to every vertex index that is 665bd8deadSopenharmony_ci transferred through DrawElements. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci This mechanism can be used to decouple a set of indices from the 695bd8deadSopenharmony_ci actual vertex array that it is referencing. This is useful if an 705bd8deadSopenharmony_ci application stores multiple indexed models in a single vertex array. 715bd8deadSopenharmony_ci The same index array can be used to draw the model no matter where 725bd8deadSopenharmony_ci it ends up in a larger vertex array simply by changing the base 735bd8deadSopenharmony_ci vertex value. Without this functionality, it would be necessary to 745bd8deadSopenharmony_ci rebind all the vertex attributes every time geometry is switched and 755bd8deadSopenharmony_ci this can have larger performance penalty. 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci For example consider the (very contrived and simple) example of 785bd8deadSopenharmony_ci drawing two triangles to form a quad. In the typical example you 795bd8deadSopenharmony_ci have the following setup: 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci vertices indices 825bd8deadSopenharmony_ci ---------- ----- 835bd8deadSopenharmony_ci 0 | (-1, 1) | 0 | 0 | 845bd8deadSopenharmony_ci 1 | (-1, -1) | 1 | 1 | 855bd8deadSopenharmony_ci 2 | ( 1, -1) | 2 | 2 | 865bd8deadSopenharmony_ci 3 | ( 1, 1) | 3 | 3 | 875bd8deadSopenharmony_ci ---------- 4 | 0 | 885bd8deadSopenharmony_ci 5 | 2 | 895bd8deadSopenharmony_ci ----- 905bd8deadSopenharmony_ci which is normally rendered with the call 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci DrawElements(TRIANGLES, 6, UNSIGNED_BYTE, &indices). 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci Now consider the case where the vertices you want to draw are not at 955bd8deadSopenharmony_ci the start of a vertex array but are instead located at offset 100 965bd8deadSopenharmony_ci into a larger array: 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci vertices2 indices2 995bd8deadSopenharmony_ci ---------- ----- 1005bd8deadSopenharmony_ci .... 0 | 100 | 1015bd8deadSopenharmony_ci 100 | (-1, 1) | 1 | 101 | 1025bd8deadSopenharmony_ci 101 | (-1, -1) | 2 | 102 | 1035bd8deadSopenharmony_ci 102 | ( 1, -1) | 3 | 103 | 1045bd8deadSopenharmony_ci 103 | ( 1, 1) | 4 | 100 | 1055bd8deadSopenharmony_ci .... 5 | 102 | 1065bd8deadSopenharmony_ci ---------- ----- 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci The typical choices for rendering this are to rebind your vertex 1095bd8deadSopenharmony_ci attributes with an additional offset of 100*stride, or to create an 1105bd8deadSopenharmony_ci new array of indices (as indices2 in the example). However both 1115bd8deadSopenharmony_ci rebinding vertex attributes and rebuilding index arrays can be quite 1125bd8deadSopenharmony_ci costly activities. 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci With the new drawing commands introduced by this extension you can 1155bd8deadSopenharmony_ci instead draw using vertices2 and the new draw call: 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci DrawElementsBaseVertexEXT(TRIANGLES, 6, UNSIGNED_BYTE, &indices, 100) 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ciNew Procedures and Functions 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci void DrawElementsBaseVertexEXT(enum mode, sizei count, enum type, 1225bd8deadSopenharmony_ci const void *indices, int basevertex); 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci [[ If OpenGL ES 3.0 is supported: ]] 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci void DrawRangeElementsBaseVertexEXT(enum mode, uint start, uint end, 1275bd8deadSopenharmony_ci sizei count, enum type, 1285bd8deadSopenharmony_ci const void *indices, int basevertex); 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci void DrawElementsInstancedBaseVertexEXT(enum mode, sizei count, 1315bd8deadSopenharmony_ci enum type, const void *indices, 1325bd8deadSopenharmony_ci sizei instancecount, 1335bd8deadSopenharmony_ci int basevertex); 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci [[ If EXT_multi_draw_arrays is supported: ]] 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci void MultiDrawElementsBaseVertexEXT(enum mode, 1385bd8deadSopenharmony_ci const sizei *count, 1395bd8deadSopenharmony_ci enum type, 1405bd8deadSopenharmony_ci const void * const *indices, 1415bd8deadSopenharmony_ci sizei drawcount, 1425bd8deadSopenharmony_ci const int *basevertex); 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ciNew Tokens 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci None 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ciAdditions to Chapter 10 of the OpenGL ES 3.1 Specification (Vertex 1495bd8deadSopenharmony_ciSpecification and Drawing Commands) 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Modify section 10.3.7 "Array Indices in Buffer Objects" p. 244, 1525bd8deadSopenharmony_ci adding the following to the end of the third paragraph (beginning 1535bd8deadSopenharmony_ci with "While a non-zero buffer object name..." 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci "DrawElementsBaseVertexEXT, DrawRangeElementsBaseVertexEXT, and 1565bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT also source their indices from that 1575bd8deadSopenharmony_ci buffer object, adding the <basevertex> offset to the appropriate vertex 1585bd8deadSopenharmony_ci index as a final step before indexing into the vertex buffer; this does 1595bd8deadSopenharmony_ci not affect the calculation of the base pointer for the index array." 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci [[ If EXT_multi_draw_arrays is supported: ]] 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci "Finally, MultiDrawElementsEXT and MultiDrawElementsBaseVertexEXT also 1645bd8deadSopenharmony_ci source their indices from that buffer object, using its <indices> 1655bd8deadSopenharmony_ci parameter as a pointer to an array of pointers that represent 1665bd8deadSopenharmony_ci offsets into the buffer object." 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci Modify section 10.5 "Drawing Commands Using Vertex Arrays" as follows: 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci Replace the definition and paragraph describing 1725bd8deadSopenharmony_ci DrawElementsInstancedBaseVertex, bottom of p. 252 with the following: 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci "The commands 1755bd8deadSopenharmony_ci void DrawElementsBaseVertexEXT(enum mode, sizei count, enum type, 1765bd8deadSopenharmony_ci const void *indices, int basevertex); 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci void DrawRangeElementsBaseVertexEXT(enum mode, uint start, uint end, 1795bd8deadSopenharmony_ci sizei count, enum type, 1805bd8deadSopenharmony_ci const void *indices, int basevertex); 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci void DrawElementsInstancedBaseVertexEXT(enum mode, sizei count, 1835bd8deadSopenharmony_ci enum type, const void *indices, 1845bd8deadSopenharmony_ci sizei instancecount, 1855bd8deadSopenharmony_ci int basevertex); 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci are equivalent to the commands with the same base name (without the 1885bd8deadSopenharmony_ci "BaseVertexEXT" suffix) except that the <i>th element transferred by 1895bd8deadSopenharmony_ci the corresponding draw call will be taken from element 1905bd8deadSopenharmony_ci <indices>[<i>] + <basevertex> 1915bd8deadSopenharmony_ci of each enabled array. If the resulting value is larger than the maximum 1925bd8deadSopenharmony_ci value representable by <type> it should behave as if the calculation were 1935bd8deadSopenharmony_ci upconverted to 32-bit unsigned integers (with wrapping on overflow 1945bd8deadSopenharmony_ci conditions). The operation is undefined if the sum would be negative and 1955bd8deadSopenharmony_ci should be handled as described in Section 6.4. For 1965bd8deadSopenharmony_ci DrawRangeElementsBaseVertexEXT, the index values must lie between <start> 1975bd8deadSopenharmony_ci and <end> inclusive, prior to adding the <basevertex> offset. Index values 1985bd8deadSopenharmony_ci lying outside the range [<start>,<end>] are treated in the same way as 1995bd8deadSopenharmony_ci DrawRangeElements." 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci [[ If EXT_multi_draw_arrays is supported: ]] 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci "The command 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci void MultiDrawElementsBaseVertexEXT(enum mode, 2065bd8deadSopenharmony_ci const sizei *count, 2075bd8deadSopenharmony_ci enum type, 2085bd8deadSopenharmony_ci const void *const *indices, 2095bd8deadSopenharmony_ci sizei drawcount, 2105bd8deadSopenharmony_ci const int *basevertex); 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci behaves identically to DrawElementsBaseVertexEXT except that 2135bd8deadSopenharmony_ci <drawcount> separate lists of elements are specified instead. It has 2145bd8deadSopenharmony_ci the same effect as: 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci if (<mode> or <drawcount> is invalid) 2175bd8deadSopenharmony_ci generate appropriate error 2185bd8deadSopenharmony_ci else { 2195bd8deadSopenharmony_ci for (i = 0; i < <drawcount>; i++) 2205bd8deadSopenharmony_ci if (<count>[i] > 0) 2215bd8deadSopenharmony_ci DrawElementsBaseVertexEXT(<mode>, <count>[i], <type>, 2225bd8deadSopenharmony_ci <indices>[i], <basevertex>[i]); 2235bd8deadSopenharmony_ci }" 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ciAdditions to the EGL/AGL/GLX/WGL Specifications 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ci None 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ciDependencies on OpenGL ES 3.1 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci If OpenGL ES 3.1 is not supported apply the following modifications to the 2325bd8deadSopenharmony_ci OpenGL ES 3.0.3 specification: 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci Add the following to the end of Section 2.8.1 "Transferring Array Elements" 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ci "When one of the *BaseVertex drawing commands specified in section 2375bd8deadSopenharmony_ci 2.8.3 is used, the primitive restart comparison occurs before the 2385bd8deadSopenharmony_ci <basevertex> offset is added to the array index." 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci Replace the following references relative to the ES 3.1 specification 2415bd8deadSopenharmony_ci with the following references to the ES 3.0.3 specification: 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci Edits to section 10.3.7 "Array Indices in Buffer Objects" in ES 3.1 become 2445bd8deadSopenharmony_ci edits to section 2.9.7 "Array Indices in Buffer Objects" in ES 3.0.3. 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci Edits to section 10.5 "Draw Command using Vertex Arrays" in ES 3.1 become 2475bd8deadSopenharmony_ci edits to section 2.8.3 "Drawing Commands" in ES 3.0.3. 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci Replace references to section 6.4 in ES 3.1 with references to section 2505bd8deadSopenharmony_ci 2.9.4 in ES 3.0.3. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ciDependencies on OpenGL ES 3.0 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci If OpenGL ES 3.0 is not supported, ignore all references to 2555bd8deadSopenharmony_ci DrawElementsInstanced and DrawElementsInstancedBaseVertexEXT (unless one 2565bd8deadSopenharmony_ci of the instanced_array or draw_instanced extensions is present). 2575bd8deadSopenharmony_ci 2585bd8deadSopenharmony_ci If OpenGL ES 3.0 is not supported, ignore all references to 2595bd8deadSopenharmony_ci DrawRangeElements and DrawRangeElementsBaseVertexEXT. 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci If OpenGL ES 3.0 is not supported, ignore all references to primitive 2625bd8deadSopenharmony_ci restart index. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ciDependencies on the EXT_draw_instanced extension 2655bd8deadSopenharmony_ci 2665bd8deadSopenharmony_ci If EXT_draw_instanced is supported, the functionality provided by 2675bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT can also be described in terms of 2685bd8deadSopenharmony_ci DrawElementsInstancedEXT instead of DrawElementsInstanced. 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ciDependencies on the NV_draw_instanced extension 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci If NV_draw_instanced is supported, the functionality provided by 2735bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT can also be described in terms of 2745bd8deadSopenharmony_ci DrawElementsInstancedNV instead of DrawElementsInstanced. 2755bd8deadSopenharmony_ci 2765bd8deadSopenharmony_ciDependencies on the EXT_instanced_arrays extension 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci If EXT_instanced_arrays is supported, the functionality provided by 2795bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT can also be described in 2805bd8deadSopenharmony_ci terms of DrawElementsInstancedEXT instead of DrawElementsInstanced. 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ciDependencies on the ANGLE_instanced_arrays extension 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci If ANGLE_instanced_arrays is supported, the functionality provided by 2855bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT can also be described in 2865bd8deadSopenharmony_ci terms of DrawElementsInstancedANGLE instead of DrawElementsInstanced. 2875bd8deadSopenharmony_ci 2885bd8deadSopenharmony_ciDependencies on the NV_instanced_arrays extension 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci If ARB_instanced_arrays is supported, the functionality provided by 2915bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexEXT can also be described in 2925bd8deadSopenharmony_ci terms of DrawElementsInstancedNV instead of DrawElementsInstanced. 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ciErrors 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci The *BaseVertexEXT commands have identical error conditions to the 2975bd8deadSopenharmony_ci non-*BaseVertexEXT functions, and all values of <basevertex> are legal 2985bd8deadSopenharmony_ci (with the exception of ones which cause accesses outside of vertex 2995bd8deadSopenharmony_ci arrays or bound buffers as described in Section 6.4). 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ciNew State 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci None 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ciNew Implementation Dependent State 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci None 3085bd8deadSopenharmony_ci 3095bd8deadSopenharmony_ciIssues 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci Note: These issues apply specifically to the definition of the 3125bd8deadSopenharmony_ci EXT_draw_elements_base_vertex specification, which is based on the OpenGL 3135bd8deadSopenharmony_ci extension ARB_draw_elements_base_vertex as updated in OpenGL 4.4. 3145bd8deadSopenharmony_ci ARB_draw_elements_base_vertex can be found in the OpenGL Registry. 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci (0) This extension is based on ARB_draw_elements_base_vertex. What are 3175bd8deadSopenharmony_ci the major differences? 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci - rebased on OpenGL ES 3.1 3205bd8deadSopenharmony_ci - renamed the "primcount" parameter to "instancecount" per GL4 3215bd8deadSopenharmony_ci - MultiDrawElementsBaseVertexEXT is only available if 3225bd8deadSopenharmony_ci GL_EXT_multi_draw_arrays is supported. 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci (1) Should we include MultiDrawElementsBaseVertexEXT in this extension? 3255bd8deadSopenharmony_ci 3265bd8deadSopenharmony_ci RESOLVED: Yes, but only if EXT_multi_draw_arrays is supported, since 3275bd8deadSopenharmony_ci multi draw calls are not available in unextended OpenGL ES 2 or 3. 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci (2) Should we allow client memory to be used for vertex attributes and 3305bd8deadSopenharmony_ci for the <indices> in the *BaseVertexEXT commands? 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci RESOLVED: Yes. Since these are defined in terms of the non-BaseVertex 3335bd8deadSopenharmony_ci commands which already supports client memory for vertex attributes and 3345bd8deadSopenharmony_ci indices it makes sense to include support for these new commands as well. 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ci (3) Which commands are supported on OpenGL ES 2.0 implementations that 3375bd8deadSopenharmony_ci support this extension? 3385bd8deadSopenharmony_ci 3395bd8deadSopenharmony_ci RESOLVED: Only DrawElementsBaseVertexEXT, unless one of the instancing 3405bd8deadSopenharmony_ci extensions is supported in which case DrawElementsInstancedBaseVertexEXT 3415bd8deadSopenharmony_ci is also supported. DrawRangeElementsBaseVertexEXT is not supported because 3425bd8deadSopenharmony_ci OpenGL ES 2.0 doesn't include DrawRangeElements. 3435bd8deadSopenharmony_ci 3445bd8deadSopenharmony_ci (4) Which commands are supported on OpenGL ES 3.0 implementations? 3455bd8deadSopenharmony_ci 3465bd8deadSopenharmony_ci RESOLVED: All of the new drawing commands are applicable to OpenGL ES 3.0 3475bd8deadSopenharmony_ci implementations. 3485bd8deadSopenharmony_ci 3495bd8deadSopenharmony_ci (5) Does the value of gl_VertexID in the shading language include the 3505bd8deadSopenharmony_ci the value of the <basevertex> offset? 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ci RESOLVED: Yes. This is as clarified by Khronos bugs 12202 and 12756 3535bd8deadSopenharmony_ci and is consistent with the overview of ARB_shader_draw_parameters. 3545bd8deadSopenharmony_ci Essentially, the value of gl_VertexID should be the index of the 3555bd8deadSopenharmony_ci vertex that is being passed to the shader. 3565bd8deadSopenharmony_ci - DrawArrays: first + i 3575bd8deadSopenharmony_ci - DrawElements: indices[i] 3585bd8deadSopenharmony_ci - DrawElementsBaseVertex: indices[i] + basevertex 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ciRevision History 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci Rev. Date Author Changes 3645bd8deadSopenharmony_ci ---- -------- --------- ---------------------------------------------- 3655bd8deadSopenharmony_ci 4 08/11/20 pdaniell Renamed the 'primcount' parameter of 3665bd8deadSopenharmony_ci MultiDrawElementsBaseVertexEXT in the 3675bd8deadSopenharmony_ci "New Procedures and Functions" section to 3685bd8deadSopenharmony_ci 'drawcount' to match the extension spec body. 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci 3 09/30/14 dkoch Resolved issues 1, 2 as proposed. 3715bd8deadSopenharmony_ci Added issue 5. Mark complete. 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci 2 06/24/14 dkoch Add EXT_multi_draw_arrays interactions 3745bd8deadSopenharmony_ci and typographical fixes from Dominik. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci 1 04/05/14 dkoch Intial version for ES based on 3775bd8deadSopenharmony_ci ARB_draw_elements_base_vertex v3. 378