15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_base_instance 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_base_instance 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Graham Sellers, AMD (graham.sellers 'at' amd.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Daniel Koch, NVIDIA 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciNotice 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at 205bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciSpecification Update Policy 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 255bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 265bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 275bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 285bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 295bd8deadSopenharmony_ci described in more detail at 305bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciStatus 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Complete. Approved by the ARB on 2011/06/20. 355bd8deadSopenharmony_ci Approved by the Khronos Promoters on 2011/07/29. 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciVersion 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci Last Modified Date: June 13, 2014 405bd8deadSopenharmony_ci Author Revision: 7 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciNumber 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci ARB Extension #107 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciDependencies 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension is written against the OpenGL Specification, Version 4.1 495bd8deadSopenharmony_ci (Core Profile). 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci OpenGL 3.1 or ARB_draw_instanced is required. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ciOverview 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci This extension allows the offset within buffer objects used for instanced 565bd8deadSopenharmony_ci rendering to be specified. This is congruent with the <first> parameter 575bd8deadSopenharmony_ci in glDrawArrays and the <basevertex> parameter in glDrawElements. When 585bd8deadSopenharmony_ci instanced rendering is performed (for example, through 595bd8deadSopenharmony_ci glDrawArraysInstanced), instanced vertex attributes whose vertex attribute 605bd8deadSopenharmony_ci divisors are non-zero are fetched from enabled vertex arrays per-instance 615bd8deadSopenharmony_ci rather than per-vertex. However, in unextended OpenGL, there is no way to 625bd8deadSopenharmony_ci define the offset into those arrays from which the attributes are fetched. 635bd8deadSopenharmony_ci This extension adds that offset in the form of a <baseinstance> parameter 645bd8deadSopenharmony_ci to several new procedures. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci The <baseinstance> parameter is added to the index of the array element, 675bd8deadSopenharmony_ci after division by the vertex attribute divisor. This allows several sets of 685bd8deadSopenharmony_ci instanced vertex attribute data to be stored in a single vertex array, and 695bd8deadSopenharmony_ci the base offset of that data to be specified for each draw. Further, this 705bd8deadSopenharmony_ci extension exposes the <baseinstance> parameter as the final and previously 715bd8deadSopenharmony_ci undefined structure member of the draw-indirect data structure. 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ciIP Status 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci None. 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciNew Procedures and Functions 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci void DrawArraysInstancedBaseInstance(enum mode, 805bd8deadSopenharmony_ci int first, 815bd8deadSopenharmony_ci sizei count, 825bd8deadSopenharmony_ci sizei primcount, 835bd8deadSopenharmony_ci uint baseinstance); 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci void DrawElementsInstancedBaseInstance(enum mode, 865bd8deadSopenharmony_ci sizei count, 875bd8deadSopenharmony_ci enum type, 885bd8deadSopenharmony_ci const void *indices, 895bd8deadSopenharmony_ci sizei primcount, 905bd8deadSopenharmony_ci uint baseinstance); 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci void DrawElementsInstancedBaseVertexBaseInstance(enum mode, 935bd8deadSopenharmony_ci sizei count, 945bd8deadSopenharmony_ci enum type, 955bd8deadSopenharmony_ci const void *indices, 965bd8deadSopenharmony_ci sizei primcount, 975bd8deadSopenharmony_ci int basevertex, 985bd8deadSopenharmony_ci uint baseinstance); 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ciNew Tokens 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci None. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ciModifications to Chapter 2 of the the OpenGL 4.1 (Core Profile) Specification 1055bd8deadSopenharmony_ci(OpenGL Operation) 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Modification to Section 2.8.3, "Drawing Commands" 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci Modify the definition of DrawArraysOneInstance on p.33. 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci The command 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci void DrawArraysOneInstance(enum mode, 1145bd8deadSopenharmony_ci int first, 1155bd8deadSopenharmony_ci sizei count, 1165bd8deadSopenharmony_ci int instance, 1175bd8deadSopenharmony_ci uint baseinstance); 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci does not exist in the GL, but is used to describe functionality in the rest 1205bd8deadSopenharmony_ci of this section. This command constructs a sequence of geometric primitives 1215bd8deadSopenharmony_ci by transferring elements <first> through <first> + <count> - 1 of each 1225bd8deadSopenharmony_ci enabled array to the GL. <mode> specifies what kind of primitives are 1235bd8deadSopenharmony_ci constructed, as defined in section 2.6.1. If <mode> is not a valid primitive 1245bd8deadSopenharmony_ci type, an INVALID_ENUM error is generated. If <count> is negative, an 1255bd8deadSopenharmony_ci INVALID_VALUE error is generated. 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci For any vertex attribute whose divisor is non-zero as set by 1285bd8deadSopenharmony_ci VertexAttribDivisor, the value <baseinstance> is used to determine the element 1295bd8deadSopenharmony_ci of the enabled instanced attribute arrays that will be transferred for all 1305bd8deadSopenharmony_ci vertices transferred by this function. 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci If an array corresponding to a generic attribute required by a vertex 1335bd8deadSopenharmony_ci shader is not enabled, then the corresponding element is taken from the 1345bd8deadSopenharmony_ci current generic attribute state (see section 2.7). 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci If an array corresponding to a generic attribute required by a vertex 1375bd8deadSopenharmony_ci shader is enabled, the corresponding current generic attribute value is 1385bd8deadSopenharmony_ci unaffected by the execution of DrawArraysOneInstance. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci Specifying <first> < 0 results in undefined behavior. Generating the 1415bd8deadSopenharmony_ci error INVALID_VALUE is recommended in this case. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci The command 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci void DrawArrays( enum mode, int first, sizei count ); 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ci is equivalent to the command sequence 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci DrawArraysOneInstance(mode, first, count, 0, 0); 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Replace the description of DrawArraysInstanced with the following (p.35): 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci The command 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci void DrawArraysInstancedBaseInstance(enum mode, 1565bd8deadSopenharmony_ci int first, 1575bd8deadSopenharmony_ci sizei count, 1585bd8deadSopenharmony_ci sizei primcount, 1595bd8deadSopenharmony_ci uint baseinstance); 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci behaves identically to DrawArrays, except that <primcount> instances of the 1625bd8deadSopenharmony_ci range of elements are executed and the value of <instanceID> advances for 1635bd8deadSopenharmony_ci each iteration. Those attributes that have divisor N where N is other than 1645bd8deadSopenharmony_ci zero (as specified by VertexAttribDivisor) advance once every N instances. 1655bd8deadSopenharmony_ci Additionally, the first element within those instanced vertex attributes 1665bd8deadSopenharmony_ci is specified in <baseinstance>. Thus, the element transferred from instanced 1675bd8deadSopenharmony_ci vertex attributes is given by: 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci (<instanceID> / <divisor>) + <baseinstance> 1705bd8deadSopenharmony_ci 1715bd8deadSopenharmony_ci DrawArraysInstancedBaseInstance has the same effect as: 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci if (<mode> or <count> is invalid) 1745bd8deadSopenharmony_ci generate appropriate error 1755bd8deadSopenharmony_ci else { 1765bd8deadSopenharmony_ci for (i = 0; i < <primcount>; i++) { 1775bd8deadSopenharmony_ci instanceID = i; 1785bd8deadSopenharmony_ci DrawArraysOneInstance(<mode>, <first>, <count>, i, <baseinstance>); 1795bd8deadSopenharmony_ci } 1805bd8deadSopenharmony_ci instanceID = 0; 1815bd8deadSopenharmony_ci } 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci The command 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci void DrawArraysInstanced(enum mode, 1865bd8deadSopenharmony_ci int first, 1875bd8deadSopenharmony_ci sizei count, 1885bd8deadSopenharmony_ci sizei primcount); 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci Is equivalent to calling DrawArraysInstancedBaseInstance with <baseinstance> 1915bd8deadSopenharmony_ci set to zero. 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci Update the definition of DrawArraysIndirect as follows (p.35): 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci The command 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci void DrawArraysIndirect(enum mode, 1985bd8deadSopenharmony_ci const void *indirect); 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci has the same effect as: 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci typedef struct { 2035bd8deadSopenharmony_ci uint count; 2045bd8deadSopenharmony_ci uint primCount; 2055bd8deadSopenharmony_ci uint first; 2065bd8deadSopenharmony_ci uint baseInstance; 2075bd8deadSopenharmony_ci } DrawArraysIndirectCommand; 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci const DrawArraysIndirectCommand *cmd = 2105bd8deadSopenharmony_ci (const DrawArraysIndirectCommand *)indirect; 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci DrawArraysInstancedBaseInstance(mode, 2135bd8deadSopenharmony_ci cmd->first, 2145bd8deadSopenharmony_ci cmd->count, 2155bd8deadSopenharmony_ci cmd->primCount, 2165bd8deadSopenharmony_ci cmd->baseInstance); 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci Remove the sentence "Results are undefined if reservedMustBeZero is non- 2195bd8deadSopenharmony_ci zero, but must not lead to GL interruption or termination." 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci Update the definition of DrawElementsOneInstance, p.36: 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci The command 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci void DrawElementsOneInstance(enum mode, 2265bd8deadSopenharmony_ci sizei count, 2275bd8deadSopenharmony_ci enum type, 2285bd8deadSopenharmony_ci const void *indices, 2295bd8deadSopenharmony_ci int instance, 2305bd8deadSopenharmony_ci uint baseinstance); 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci does not exist in the GL ... <retain the remainder of the description> 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci If an enabled vertex attribute array is instanced (it has a non-zero 2355bd8deadSopenharmony_ci attribute divisor as specified by VertexAttribDivisor), the element that is 2365bd8deadSopenharmony_ci transferred to the GL is given by: 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci floor(<instance> / <divisor>) + <baseinstance> 2395bd8deadSopenharmony_ci 2405bd8deadSopenharmony_ci Update the text describing DrawElements: 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci The command 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci void DrawElements(enum mode, 2455bd8deadSopenharmony_ci sizei count, 2465bd8deadSopenharmony_ci enum type, 2475bd8deadSopenharmony_ci const void *indices); 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci behaves identically to DrawElementsOneInstance with the <instance> and 2505bd8deadSopenharmony_ci <baseinstance> parameters set to zero; the effect of calling 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci DrawElements(mode, count, type, indices); 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci is equivalent to the command sequence: 2555bd8deadSopenharmony_ci 2565bd8deadSopenharmony_ci if (<mode>, <count> or <type> is invalid) 2575bd8deadSopenharmony_ci generate appropriate error 2585bd8deadSopenharmony_ci else 2595bd8deadSopenharmony_ci DrawElementsOneInstance(mode, count, type, indices, 0, 0); 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci Replace the description of DrawElementsInstanced with the following (p.37) 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci The command 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci void DrawElementsInstancedBaseInstance(enum mode, 2665bd8deadSopenharmony_ci sizei count, 2675bd8deadSopenharmony_ci enum type, 2685bd8deadSopenharmony_ci const void *indices, 2695bd8deadSopenharmony_ci sizei primcount, 2705bd8deadSopenharmony_ci uint baseinstance); 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci behaves identically to DrawElements except that <primcount> instances of the 2735bd8deadSopenharmony_ci set of elements are executed, the value of instanceID advances between each 2745bd8deadSopenharmony_ci set, and the instance advances between each set. Instanced attributes 2755bd8deadSopenharmony_ci are advanced as they do during execution of DrawArraysInstancedBaseInstace, 2765bd8deadSopenharmony_ci and <baseinstance> has the same effect. It has the same effect as: 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci if (<mode>, <count>, <type> or <primcount> is invalid) 2795bd8deadSopenharmony_ci generate appropriate error 2805bd8deadSopenharmony_ci else { 2815bd8deadSopenharmony_ci for (int i = 0; i < <primcount>; i++) { 2825bd8deadSopenharmony_ci instanceID = i; 2835bd8deadSopenharmony_ci DrawElementsOneInstance(<mode>, 2845bd8deadSopenharmony_ci <count>, 2855bd8deadSopenharmony_ci <type>, 2865bd8deadSopenharmony_ci <indices>, 2875bd8deadSopenharmony_ci i, 2885bd8deadSopenharmony_ci <baseinstance>); 2895bd8deadSopenharmony_ci } 2905bd8deadSopenharmony_ci instanceID = 0; 2915bd8deadSopenharmony_ci } 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci Add to the list of functions which include DrawElementsBaseVertex, 2945bd8deadSopenharmony_ci DrawRangeElementsBaseVertex, and DrawElementsInstancedBaseVertex (p.39): 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci void DrawElementsInstancedBaseVertexBaseInstance(enum mode, 2975bd8deadSopenharmony_ci sizei count, 2985bd8deadSopenharmony_ci enum type, 2995bd8deadSopenharmony_ci const void *indices, 3005bd8deadSopenharmony_ci sizei primcount, 3015bd8deadSopenharmony_ci int basevertex, 3025bd8deadSopenharmony_ci uint baseinstance); 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci Append to the paragraph describing DrawElementsBaseVertex, 3055bd8deadSopenharmony_ci DrawRangeElementsBaseVertex, and DrawElementsInstancedBaseVertex (p.40): 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci For DrawElementsInstancedBaseVertexBaseInstance, <baseinstance> is 3085bd8deadSopenharmony_ci used to offset the element from which instanced vertex attributes (those 3095bd8deadSopenharmony_ci with a non-zero divisor as specified by VertexAttribDivisor) are taken. 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci Update the definition of DrawElementsIndirect as follows (p.39): 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci The command 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci void DrawElementsIndirect(enum mode, 3165bd8deadSopenharmony_ci enum type, 3175bd8deadSopenharmony_ci const void *indirect ); 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci has the same effect as: 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ci typedef struct { 3225bd8deadSopenharmony_ci uint count; 3235bd8deadSopenharmony_ci uint primCount; 3245bd8deadSopenharmony_ci uint firstIndex; 3255bd8deadSopenharmony_ci int baseVertex; 3265bd8deadSopenharmony_ci uint baseInstance; 3275bd8deadSopenharmony_ci } DrawElementsIndirectCommand; 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci if (no element array buffer is bound) { 3305bd8deadSopenharmony_ci generate appropriate error 3315bd8deadSopenharmony_ci } else { 3325bd8deadSopenharmony_ci const DrawElementsIndirectCommand *cmd = 3335bd8deadSopenharmony_ci (const DrawElementsIndirectCommand *)indirect; 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci DrawElementsInstancedBaseVertexBaseInstance( 3365bd8deadSopenharmony_ci mode, 3375bd8deadSopenharmony_ci cmd->count, 3385bd8deadSopenharmony_ci type, 3395bd8deadSopenharmony_ci cmd->firstIndex * size-of-type, 3405bd8deadSopenharmony_ci cmd->primCount, 3415bd8deadSopenharmony_ci cmd->baseVertex, 3425bd8deadSopenharmony_ci cmd->baseInstance); 3435bd8deadSopenharmony_ci } 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci Remove the sentence "Results are undefined if reservedMustBeZero is non- 3465bd8deadSopenharmony_ci zero, but must not lead to GL interruption or termination." 3475bd8deadSopenharmony_ci 3485bd8deadSopenharmony_ciModifications to Chapter 3 of the the OpenGL 4.1 (Core Profile) Specification 3495bd8deadSopenharmony_ci(Rasterization) 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci None. 3525bd8deadSopenharmony_ci 3535bd8deadSopenharmony_ciModifications to Chapter 4 of the the OpenGL 4.1 (Core Profile) Specification 3545bd8deadSopenharmony_ci(Per-Fragment Operations and the Framebuffer) 3555bd8deadSopenharmony_ci 3565bd8deadSopenharmony_ci None. 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ciModifications to Chapter 5 of the the OpenGL 4.1 (Core Profile) Specification 3595bd8deadSopenharmony_ci(Special Functions) 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci None. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ciModifications to Chapter 6 of the the OpenGL 4.1 (Core Profile) Specification 3645bd8deadSopenharmony_ci(State and State Requests) 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci None. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci None. 3715bd8deadSopenharmony_ci 3725bd8deadSopenharmony_ciGLX Protocol 3735bd8deadSopenharmony_ci 3745bd8deadSopenharmony_ci None. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ciErrors 3775bd8deadSopenharmony_ci 3785bd8deadSopenharmony_ci None. 3795bd8deadSopenharmony_ci 3805bd8deadSopenharmony_ciNew State 3815bd8deadSopenharmony_ci 3825bd8deadSopenharmony_ci None. 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ciNew Implementation Dependent State 3855bd8deadSopenharmony_ci 3865bd8deadSopenharmony_ci None. 3875bd8deadSopenharmony_ci 3885bd8deadSopenharmony_ciConformance Testing 3895bd8deadSopenharmony_ci 3905bd8deadSopenharmony_ci TBD. 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ciIssues 3935bd8deadSopenharmony_ci 3945bd8deadSopenharmony_ci 1) Does <baseinstance> offset gl_InstanceID? 3955bd8deadSopenharmony_ci 3965bd8deadSopenharmony_ci RESOLVED: No. gl_InstanceID always starts from zero and counts up by one 3975bd8deadSopenharmony_ci for each instance rendered. If the shader author requires the actual value 3985bd8deadSopenharmony_ci of the instance index, including the base instance, they must pass the 3995bd8deadSopenharmony_ci base instance as a uniform. In OpenGL, the vertex attribute divisors are 4005bd8deadSopenharmony_ci not passed implicitly to the shader anyway, so the shader writer will need 4015bd8deadSopenharmony_ci to take care of this regardless. 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci 2) Is <baseinstance> per-attribute, or global? 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci RESOLVED: It is global. The same base is used for all instanced attribute 4065bd8deadSopenharmony_ci arrays. 4075bd8deadSopenharmony_ci 4085bd8deadSopenharmony_ci 3) Do we need any more entry points? 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ci DISCUSSION: Maybe. Technically, we could specify a base vertex to any 4115bd8deadSopenharmony_ci drawing command and any instanced vertex attributes would be taken from 4125bd8deadSopenharmony_ci that offset within their respective buffers. OpenGL already has enough 4135bd8deadSopenharmony_ci entry points. Another possibility is to actually make <baseinstance> OpenGL 4145bd8deadSopenharmony_ci state. The application would set it before any draw call (even non- 4155bd8deadSopenharmony_ci instanced ones) and this would affect the base used for any instanced vertex 4165bd8deadSopenharmony_ci attributes. However, this would introduce performance overhead and would not 4175bd8deadSopenharmony_ci work well with Draw{Arrays|Elements}Indirect. 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci 4) DrawElementsInstancedBaseVertexBaseInstance? Really? The length of entry 4205bd8deadSopenharmony_ci point names is starting to get silly. Can we clean this up? 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci RESOLVED: Yes, we can, but not here. 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ci 5) What happens if baseInstance is > 2^31-1 (i.e., negative as a signed 4255bd8deadSopenharmony_ci integer)? 4265bd8deadSopenharmony_ci 4275bd8deadSopenharmony_ci Need to check with hardware vendors. 4285bd8deadSopenharmony_ci 4295bd8deadSopenharmony_ciRevision History 4305bd8deadSopenharmony_ci 4315bd8deadSopenharmony_ci Rev. Date Author Changes 4325bd8deadSopenharmony_ci ---- ---------- -------- ----------------------------------------- 4335bd8deadSopenharmony_ci 7 06/13/2014 dkoch fix <baseinstance> typos in overview. 4345bd8deadSopenharmony_ci 6 01/18/2011 Jon Leech Use floor() in computing element transferred 4355bd8deadSopenharmony_ci to the GL to match change in core spec. 4365bd8deadSopenharmony_ci 5 01/10/2011 gsellers Address bugzilla 7185. Make baseinstance API 4375bd8deadSopenharmony_ci parameter unsigned to match structure member. 4385bd8deadSopenharmony_ci Add issue 5. 4395bd8deadSopenharmony_ci 4 01/05/2011 Jon Leech Fix typos from Bug 7202. 4405bd8deadSopenharmony_ci 3 11/09/2010 gsellers Address bugzilla 7011. Elaborate in overview 4415bd8deadSopenharmony_ci and issues. Add placeholder for conformance test 4425bd8deadSopenharmony_ci plan. 4435bd8deadSopenharmony_ci 2 11/08/2010 gsellers Did some TODOs. Check in to SVN. 4445bd8deadSopenharmony_ci 1 11/04/2010 gsellers Initial revision. 445