15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_multi_bind 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_multi_bind 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Jeff Bolz, NVIDIA 165bd8deadSopenharmony_ci Frank Chen, Qualcomm 175bd8deadSopenharmony_ci Piers Daniell, NVIDIA 185bd8deadSopenharmony_ci Daniel Koch, NVIDIA 195bd8deadSopenharmony_ci Jon Leech 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciNotice 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci Copyright (c) 2013 The Khronos Group Inc. Copyright terms at 245bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ciSpecification Update Policy 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 295bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 305bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 315bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 325bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 335bd8deadSopenharmony_ci described in more detail at 345bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ciStatus 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ci Complete. Approved by the ARB on June 3, 2013. 395bd8deadSopenharmony_ci Ratified by the Khronos Board of Promoters on July 19, 2013. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciVersion 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci Last Modified Date: May 30, 2013 445bd8deadSopenharmony_ci Revision: 10 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNumber 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci ARB Extension #147 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ciDependencies 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci This extension is written against the OpenGL 4.3 (Compatibility Profile) 535bd8deadSopenharmony_ci Specification, dated August 6, 2012. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci OpenGL 3.0 is required. 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci This extension interacts with OpenGL 3.3 and ARB_sampler_objects. 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci This extension interacts with OpenGL 4.3 and ARB_vertex_attrib_binding. 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ciOverview 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci This extension provides a new set of commands allowing applications to 645bd8deadSopenharmony_ci bind or unbind a set of objects in a single call, instead of requiring a 655bd8deadSopenharmony_ci separate call for each bind or unbind operation. Using a single command 665bd8deadSopenharmony_ci allows OpenGL implementations to amortize function call, name space 675bd8deadSopenharmony_ci lookup, and potential locking overhead over multiple bind or unbind 685bd8deadSopenharmony_ci operations. The rendering loops of graphics applications frequently 695bd8deadSopenharmony_ci switch between different states, binding different sets of resources, 705bd8deadSopenharmony_ci including texture objects, sampler objects, textures for image loads and 715bd8deadSopenharmony_ci stores, uniform buffers, and vertex buffers; this extension provides 725bd8deadSopenharmony_ci "multi-bind" entry points for all of these object types. 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Each command in this extension includes a <first> and <count> parameter, 755bd8deadSopenharmony_ci specifying a continguous range of binding points to update, as well as an 765bd8deadSopenharmony_ci array of <count> object names specifying the objects to bind. Unlike 775bd8deadSopenharmony_ci single bind commands, multi-bind commands can be used only to bind or 785bd8deadSopenharmony_ci unbind existing objects. Passing a previously unused object name 795bd8deadSopenharmony_ci (generated or not) results in an error and does not create a new object. 805bd8deadSopenharmony_ci For binding points with associated data (e.g., ranges of a buffer), 815bd8deadSopenharmony_ci separate arrays are used to pass the associated data for each binding 825bd8deadSopenharmony_ci point. Passing zero values in the array of object names removes the 835bd8deadSopenharmony_ci object bound to the current bounding point. Additionally, if NULL is 845bd8deadSopenharmony_ci passed as the array of objects, objects bound to the entire range of 855bd8deadSopenharmony_ci binding points are unbound, as though the caller passed an array of 865bd8deadSopenharmony_ci zeroes. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ciNew Procedures and Functions 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci void BindBuffersBase(enum target, uint first, sizei count, 915bd8deadSopenharmony_ci const uint *buffers); 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci void BindBuffersRange(enum target, uint first, sizei count, 945bd8deadSopenharmony_ci const uint *buffers, const intptr *offsets, 955bd8deadSopenharmony_ci const sizeiptr *sizes); 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci void BindTextures(uint first, sizei count, const uint *textures); 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci void BindSamplers(uint first, sizei count, const uint *samplers); 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci void BindImageTextures(uint first, sizei count, const uint *textures); 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci void BindVertexBuffers(uint first, sizei count, const uint *buffers, 1045bd8deadSopenharmony_ci const intptr *offsets, const sizei *strides); 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ciNew Tokens 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci None. 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ciModifications to the OpenGL 4.3 (Compatibility Profile) Specification 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Modify Section 2.3.1, Errors, p. 15 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci (modify third paragraph, p. 16, adding "unless otherwise noted" 1155bd8deadSopenharmony_ci qualification to the general rule that commands producing errors have no 1165bd8deadSopenharmony_ci side effects) 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Table 2.3 summarizes ... if an OUT_OF_MEMORY error has occurred. In 1195bd8deadSopenharmony_ci other cases, there are no side effects unless otherwise noted; the command 1205bd8deadSopenharmony_ci which generates the error is ignored so that it has no effect on GL state 1215bd8deadSopenharmony_ci or framebuffer contents. ... 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci Modify Section 6.1.1, Binding Buffer Objects To Indexed Targets, p. 55 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci (insert immediately after the "Errors" block at the end of the section, 1275bd8deadSopenharmony_ci p. 56) 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci The commands 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci void BindBuffersBase(enum target, uint first, sizei count, 1325bd8deadSopenharmony_ci const uint *buffers); 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci void BindBuffersRange(enum target, uint first, sizei count, 1355bd8deadSopenharmony_ci const uint *buffers, const intptr *offsets, 1365bd8deadSopenharmony_ci const sizeiptr *sizes); 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci bind <count> existing buffer objects to bindings numbered <first> through 1395bd8deadSopenharmony_ci <first>+<count>-1 in the array of buffer binding points corresponding to 1405bd8deadSopenharmony_ci <target>. If <buffers> is not NULL, it specifies an array of <count> 1415bd8deadSopenharmony_ci values, each of which must be zero or the name of an existing buffer 1425bd8deadSopenharmony_ci object. For BindBuffersRange, <offsets> and <sizes> specify arrays of 1435bd8deadSopenharmony_ci <count> values indicating the range of each buffer to bind. If <buffers> 1445bd8deadSopenharmony_ci is NULL, all bindings from <first> through <first>+<count>-1 are reset 1455bd8deadSopenharmony_ci to their unbound (zero) state. In this case, the offsets and sizes 1465bd8deadSopenharmony_ci associated with the binding points are set to default values, ignoring 1475bd8deadSopenharmony_ci <offsets> and <sizes>. 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci BindBuffersBase is equivalent to: 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 1525bd8deadSopenharmony_ci if (buffers == NULL) { 1535bd8deadSopenharmony_ci glBindBufferBase(target, first + i, 0); 1545bd8deadSopenharmony_ci } else { 1555bd8deadSopenharmony_ci glBindBufferBase(target, first + i, buffers[i]); 1565bd8deadSopenharmony_ci } 1575bd8deadSopenharmony_ci } 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci except that the single general buffer binding corresponding to <target> 1605bd8deadSopenharmony_ci is unmodified, and that buffers will not be created if they do not 1615bd8deadSopenharmony_ci exist. 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci BindBuffersRange is equivalent to: 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 1665bd8deadSopenharmony_ci if (buffers == NULL) { 1675bd8deadSopenharmony_ci glBindBufferRange(target, first + i, 0, 0, 0); 1685bd8deadSopenharmony_ci } else { 1695bd8deadSopenharmony_ci glBindBufferRange(target, first + i, buffers[i], offsets[i], 1705bd8deadSopenharmony_ci sizes[i]); 1715bd8deadSopenharmony_ci } 1725bd8deadSopenharmony_ci } 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci except that the single general buffer binding corresponding to <target> 1755bd8deadSopenharmony_ci is unmodified, and that buffers will not be created if they do not 1765bd8deadSopenharmony_ci exist. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci The values specified in <buffers>, <offsets>, and <sizes> will be checked 1795bd8deadSopenharmony_ci separately for each binding point. When values for a specific binding 1805bd8deadSopenharmony_ci point are invalid, the state for that binding point will be unchanged and 1815bd8deadSopenharmony_ci an error will be generated. However, state for other binding points will 1825bd8deadSopenharmony_ci still be changed if their corresponding values are valid. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci Errors 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci An INVALID_ENUM error is generated if <target> is not one of the targets 1875bd8deadSopenharmony_ci listed above. 1885bd8deadSopenharmony_ci 1895bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <first> + <count> is greater 1905bd8deadSopenharmony_ci than the number of target-specific indexed binding points, as described 1915bd8deadSopenharmony_ci in section 6.7.1. 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if any value in <buffers> is not 1945bd8deadSopenharmony_ci zero or the name of an existing buffer object (per binding). 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any value in 1975bd8deadSopenharmony_ci <offsets> is less than zero (per binding). 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any value in 2005bd8deadSopenharmony_ci <sizes> is less than or equal to zero (per binding). 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any pair of 2035bd8deadSopenharmony_ci values in <offsets> and <sizes> does not respectively satisfy the 2045bd8deadSopenharmony_ci constraints described for those parameters for the specified target, as 2055bd8deadSopenharmony_ci described in section 6.7.1 (per binding). 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci Modify Section 8.1, Texture Objects (p. 155) 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci (insert after errors section, p. 156) 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci The command 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci void BindTextures(uint first, sizei count, const uint *textures); 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci binds <count> existing texture objects to texture image units numbered 2175bd8deadSopenharmony_ci <first> through <first>+<count>-1. If <textures> is not NULL, it 2185bd8deadSopenharmony_ci specifies an array of <count> values, each of which must be zero or the 2195bd8deadSopenharmony_ci name of an existing texture object. When an entry in <textures> is the 2205bd8deadSopenharmony_ci name of an existing texture object, that object is bound to corresponding 2215bd8deadSopenharmony_ci texture unit for the target specified when the texture object was created. 2225bd8deadSopenharmony_ci When an entry in <textures> is zero, each of the targets enumerated at the 2235bd8deadSopenharmony_ci beginning of this section is reset to its default texture for the 2245bd8deadSopenharmony_ci corresponding texture image unit. If <textures> is NULL, each target of 2255bd8deadSopenharmony_ci each affected texture image unit from <first> through <first>+<count>-1 is 2265bd8deadSopenharmony_ci reset to its default texture. 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci BindTextures is equivalent to 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 2315bd8deadSopenharmony_ci uint texture; 2325bd8deadSopenharmony_ci if (textures == NULL) { 2335bd8deadSopenharmony_ci texture = 0; 2345bd8deadSopenharmony_ci } else { 2355bd8deadSopenharmony_ci texture = textures[i]; 2365bd8deadSopenharmony_ci } 2375bd8deadSopenharmony_ci ActiveTexture(TEXTURE0 + first + i); 2385bd8deadSopenharmony_ci if (texture != 0) { 2395bd8deadSopenharmony_ci enum target = /* target of texture object textures[i] */; 2405bd8deadSopenharmony_ci BindTexture(target, textures[i]); 2415bd8deadSopenharmony_ci } else { 2425bd8deadSopenharmony_ci for (target in all supported targets) { 2435bd8deadSopenharmony_ci BindTexture(target, 0); 2445bd8deadSopenharmony_ci } 2455bd8deadSopenharmony_ci } 2465bd8deadSopenharmony_ci } 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci except that the active texture selector retains its original value upon 2495bd8deadSopenharmony_ci completion of the command, and that textures will not be created if they 2505bd8deadSopenharmony_ci do not exist. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci The values specified in <textures> will be checked separately for each 2545bd8deadSopenharmony_ci texture image unit. When a value for a specific texture image unit is 2555bd8deadSopenharmony_ci invalid, the state for that texture image unit will be unchanged and an 2565bd8deadSopenharmony_ci error will be generated. However, state for other texture image units 2575bd8deadSopenharmony_ci will still be changed if their corresponding values are valid. 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci Errors 2605bd8deadSopenharmony_ci 2615bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <first> + <count> is greater 2625bd8deadSopenharmony_ci than the number of texture image units supported by the implementation. 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if any value in <textures> is 2655bd8deadSopenharmony_ci not zero or the name of an existing texture object (per binding). 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci Modify Section 8.2, Sampler Objects (p. 158) 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci (insert after errors section, p. 159) 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci The command 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci void BindSamplers(uint first, sizei count, const uint *samplers); 2755bd8deadSopenharmony_ci 2765bd8deadSopenharmony_ci binds <count> existing sampler objects to texture image units numbered 2775bd8deadSopenharmony_ci <first> through <first>+<count>-1. If <samplers> is not NULL, it 2785bd8deadSopenharmony_ci specifies an array of <count> values, each of which must be zero or the 2795bd8deadSopenharmony_ci name of an existing sampler object. If <samplers> is NULL, each affected 2805bd8deadSopenharmony_ci texture image unit from <first> through <first>+<count>-1 will be reset to 2815bd8deadSopenharmony_ci have no bound sampler object. 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci BindSamplers is equivalent to 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 2865bd8deadSopenharmony_ci if (samplers == NULL) { 2875bd8deadSopenharmony_ci glBindSampler(first + i, 0); 2885bd8deadSopenharmony_ci } else { 2895bd8deadSopenharmony_ci glBindSampler(first + i, samplers[i]); 2905bd8deadSopenharmony_ci } 2915bd8deadSopenharmony_ci } 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci The values specified in <samplers> will be checked separately for each 2945bd8deadSopenharmony_ci texture image unit. When a value for a specific texture image unit is 2955bd8deadSopenharmony_ci invalid, the state for that texture image unit will be unchanged and an 2965bd8deadSopenharmony_ci error will be generated. However, state for other texture image units 2975bd8deadSopenharmony_ci will still be changed if their corresponding values are valid. 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci Errors 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <first> + <count> is greater 3025bd8deadSopenharmony_ci than the number of texture image units supported by the implementation. 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if any value in <samplers> is 3055bd8deadSopenharmony_ci not zero or the name of an existing sampler object (per binding). 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci Modify Section 8.25, Texture Image Loads and Stores, p. 281 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci (insert before the next-to-last paragraph, p. 282, "When a shader 3115bd8deadSopenharmony_ci accesses...") 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci The command 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci void BindImageTextures(uint first, sizei count, const uint *textures); 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ci binds <count> existing texture objects to image units numbered <first> 3185bd8deadSopenharmony_ci through <first>+<count>-1. If <textures> is not NULL, it specifies an 3195bd8deadSopenharmony_ci array of <count> values, each of which must be zero or the name of an 3205bd8deadSopenharmony_ci existing texture object. If <textures> is NULL, each affected image unit 3215bd8deadSopenharmony_ci from <first> through <first>+<count>-1 will be reset to have no bound 3225bd8deadSopenharmony_ci texture object. 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci When binding a non-zero texture object to an image unit, the image unit 3255bd8deadSopenharmony_ci <level>, <layered>, <layer>, and <access> parameters are set to zero, 3265bd8deadSopenharmony_ci TRUE, zero, and READ_WRITE, respectively. The image unit <format> 3275bd8deadSopenharmony_ci parameter is taken from the internal format of the texture image at level 3285bd8deadSopenharmony_ci zero of the texture object identified by <textures>. For cube map 3295bd8deadSopenharmony_ci textures, the internal format of the TEXTURE_CUBE_MAP_POSITIVE_X image of 3305bd8deadSopenharmony_ci level zero is used. For multisample, multisample array, buffer, and 3315bd8deadSopenharmony_ci rectangle textures, the internal format of the single texture level is 3325bd8deadSopenharmony_ci used. 3335bd8deadSopenharmony_ci 3345bd8deadSopenharmony_ci When unbinding a texture object from an image unit, the image unit 3355bd8deadSopenharmony_ci parameters <level>, <layered>, <layer>, and <format> will be reset to 3365bd8deadSopenharmony_ci their default values of zero, FALSE, 0, and R8, respectively. 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci BindImageTextures is equivalent to 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 3415bd8deadSopenharmony_ci if (textures == NULL || textures[i] = 0) { 3425bd8deadSopenharmony_ci glBindImageTexture(first + i, 0, 0, FALSE, 0, READ_ONLY, R8); 3435bd8deadSopenharmony_ci } else { 3445bd8deadSopenharmony_ci glBindImageTexture(first + i, textures[i], 0, TRUE, 0, READ_WRITE, 3455bd8deadSopenharmony_ci lookupInternalFormat(textures[i])); 3465bd8deadSopenharmony_ci } 3475bd8deadSopenharmony_ci } 3485bd8deadSopenharmony_ci 3495bd8deadSopenharmony_ci where lookupInternalFormat returns the internal format of the specified 3505bd8deadSopenharmony_ci texture object. 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ci The values specified in <textures> will be checked separately for each 3535bd8deadSopenharmony_ci image unit. When a value for a specific image unit is invalid, the state 3545bd8deadSopenharmony_ci for that image unit will be unchanged and an error will be generated. 3555bd8deadSopenharmony_ci However, state for other image units will still be changed if their 3565bd8deadSopenharmony_ci corresponding values are valid. 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci Errors 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <first> + <count> is greater 3615bd8deadSopenharmony_ci than the number of image units supported by the implementation. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if any value in <textures> is 3645bd8deadSopenharmony_ci not zero or the name of an existing texture object (per binding). 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if the internal format of the 3675bd8deadSopenharmony_ci level zero texture image of any texture in <textures> is not found in 3685bd8deadSopenharmony_ci table 8.33 (per binding). 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if the width, height, or depth 3715bd8deadSopenharmony_ci of the level zero texture image of any texture in <textures> is zero 3725bd8deadSopenharmony_ci (per binding). 3735bd8deadSopenharmony_ci 3745bd8deadSopenharmony_ci 3755bd8deadSopenharmony_ci Modify Section 10.3.1, Specifying Arrays For Generic Attributes, p. 340 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci (insert after first errors section, p. 343) 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci The command 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci void BindVertexBuffers(uint first, sizei count, const uint *buffers, 3825bd8deadSopenharmony_ci const intptr *offsets, const sizei *strides); 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ci binds <count> existing buffer objects to vertex buffer binding points 3855bd8deadSopenharmony_ci numbered <first> through <first>+<count>-1. If <buffers> is not NULL, it 3865bd8deadSopenharmony_ci specifies an array of <count> values, each of which must be zero or the 3875bd8deadSopenharmony_ci name of an existing buffer object. <offsets> and <strides> specify arrays 3885bd8deadSopenharmony_ci of <count> values indicating the offset of the first element and stride 3895bd8deadSopenharmony_ci between elements in each buffer, respectively. If <buffers> is NULL, each 3905bd8deadSopenharmony_ci affected vertex buffer binding point from <first> through 3915bd8deadSopenharmony_ci <first>+<count>-1 will be reset to have no bound buffer object. In this 3925bd8deadSopenharmony_ci case, the offsets and strides associated with the binding points are set 3935bd8deadSopenharmony_ci to default values, ignoring <offsets> and <strides>. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci BindVertexBuffers is equivalent to 3965bd8deadSopenharmony_ci 3975bd8deadSopenharmony_ci for (i = 0; i < count; i++) { 3985bd8deadSopenharmony_ci if (buffers == NULL) { 3995bd8deadSopenharmony_ci glBindVertexBuffer(first + i, 0, 0, 16); 4005bd8deadSopenharmony_ci } else { 4015bd8deadSopenharmony_ci glBindVertexBuffer(first + i, buffers[i], offsets[i], strides[i]); 4025bd8deadSopenharmony_ci } 4035bd8deadSopenharmony_ci } 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci except that buffers will not be created if they do not exist. 4065bd8deadSopenharmony_ci 4075bd8deadSopenharmony_ci The values specified in <buffers>, <offsets>, and <strides> will be 4085bd8deadSopenharmony_ci checked separately for each vertex buffer binding point. When a value for 4095bd8deadSopenharmony_ci a specific binding point is invalid, the state for that binding point will 4105bd8deadSopenharmony_ci be unchanged and an error will be generated. However, state for other 4115bd8deadSopenharmony_ci binding points will still be changed if their corresponding values are 4125bd8deadSopenharmony_ci valid. 4135bd8deadSopenharmony_ci 4145bd8deadSopenharmony_ci Errors 4155bd8deadSopenharmony_ci 4165bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <first> + <count> is greater 4175bd8deadSopenharmony_ci than the value of MAX_VERTEX_ATTRIB_BINDINGS. 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if any value in <buffers> is not 4205bd8deadSopenharmony_ci zero or the name of an existing buffer object (per binding). 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci An INVALID_VALUE error is generated if any value in <offsets> or 4235bd8deadSopenharmony_ci <strides> is negative (per binding). 4245bd8deadSopenharmony_ci 4255bd8deadSopenharmony_ci 4265bd8deadSopenharmony_ci Modify Section 21.4.1, Commands Not Usable in Display Lists, p. 618 4275bd8deadSopenharmony_ci 4285bd8deadSopenharmony_ci (add a new section below "Debug output", p. 619) 4295bd8deadSopenharmony_ci 4305bd8deadSopenharmony_ci Multi-object binds: BindBuffersBase, BindBuffersRange, BindTextures, 4315bd8deadSopenharmony_ci BindSamplers, BindImageTextures, BindVertexBuffers 4325bd8deadSopenharmony_ci 4335bd8deadSopenharmony_ci 4345bd8deadSopenharmony_ciAdditions to the AGL/EGL/GLX/WGL Specifications 4355bd8deadSopenharmony_ci 4365bd8deadSopenharmony_ci None 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ciGLX Protocol 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci TBD 4415bd8deadSopenharmony_ci 4425bd8deadSopenharmony_ciDependencies on OpenGL 3.3 and ARB_sampler_objects 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci If neither OpenGL 3.3 nor ARB_sampler_objects is supported, references to 4455bd8deadSopenharmony_ci BindSamplers should be removed. 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ciDependencies on OpenGL 4.3 and ARB_vertex_attrib_binding 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci If neither OpenGL 4.3 nor ARB_vertex_attrib_binding is supported, 4505bd8deadSopenharmony_ci references to BindVertexBuffers should be removed. 4515bd8deadSopenharmony_ci 4525bd8deadSopenharmony_ciErrors 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci An INVALID_ENUM error is generated by BindBuffersBase or BindBuffersRange 4555bd8deadSopenharmony_ci if <target> is not one of the indexed targets for buffer bindings. 4565bd8deadSopenharmony_ci 4575bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindBuffersBase or 4585bd8deadSopenharmony_ci BindBuffersRange if <first> + <count> is greater than the number of 4595bd8deadSopenharmony_ci target-specific indexed binding points, as described in section 6.7.1. 4605bd8deadSopenharmony_ci 4615bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindBuffersBase or 4625bd8deadSopenharmony_ci BindBuffersRange if any value in <buffers> is not zero or the name of an 4635bd8deadSopenharmony_ci existing buffer object (per binding). 4645bd8deadSopenharmony_ci 4655bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any value in 4665bd8deadSopenharmony_ci <offsets> is less than zero (per binding). 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any value in 4695bd8deadSopenharmony_ci <sizes> is less than or equal to zero (per binding). 4705bd8deadSopenharmony_ci 4715bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindBuffersRange if any pair of 4725bd8deadSopenharmony_ci values in <offsets> and <sizes> do not respectively satisfy the 4735bd8deadSopenharmony_ci constraints described for those parameters for the specified target, as 4745bd8deadSopenharmony_ci described in section 6.7.1 (per binding). 4755bd8deadSopenharmony_ci 4765bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindTextures if <first> + 4775bd8deadSopenharmony_ci <count> is greater than the number of texture image units supported by the 4785bd8deadSopenharmony_ci implementation. 4795bd8deadSopenharmony_ci 4805bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindTextures if any value in 4815bd8deadSopenharmony_ci <textures> is not zero or the name of an existing texture object (per 4825bd8deadSopenharmony_ci binding). 4835bd8deadSopenharmony_ci 4845bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindSamplers if <first> + 4855bd8deadSopenharmony_ci <count> is greater than the number of texture image units supported by the 4865bd8deadSopenharmony_ci implementation. 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindSamplers if any value in 4895bd8deadSopenharmony_ci <samplers> is not zero or the name of an existing texture object (per 4905bd8deadSopenharmony_ci binding). 4915bd8deadSopenharmony_ci 4925bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindImageTextures if <first> + 4935bd8deadSopenharmony_ci <count> is greater than the number of image units supported by the 4945bd8deadSopenharmony_ci implementation. 4955bd8deadSopenharmony_ci 4965bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindImageTextures if any value 4975bd8deadSopenharmony_ci in <textures> is not zero or the name of an existing texture object (per 4985bd8deadSopenharmony_ci binding). 4995bd8deadSopenharmony_ci 5005bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindImageTextures if the 5015bd8deadSopenharmony_ci internal format of the level zero texture image of any texture in 5025bd8deadSopenharmony_ci <textures> is not found in table 8.33 (per binding). 5035bd8deadSopenharmony_ci 5045bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindImageTextures if the width, 5055bd8deadSopenharmony_ci height, or depth of the level zero texture image of any texture in 5065bd8deadSopenharmony_ci <textures> is zero (per binding). 5075bd8deadSopenharmony_ci 5085bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindVertexBuffers if <first> + 5095bd8deadSopenharmony_ci <count> is greater than the value of MAX_VERTEX_ATTRIB_BINDINGS. 5105bd8deadSopenharmony_ci 5115bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by BindVertexBuffers if any value 5125bd8deadSopenharmony_ci in <buffers> is not zero or the name of an existing texture object (per 5135bd8deadSopenharmony_ci binding). 5145bd8deadSopenharmony_ci 5155bd8deadSopenharmony_ci An INVALID_VALUE error is generated by BindVertexBuffers if any value in 5165bd8deadSopenharmony_ci <offsets> or <strides> is negative (per binding). 5175bd8deadSopenharmony_ci 5185bd8deadSopenharmony_ciNew State 5195bd8deadSopenharmony_ci 5205bd8deadSopenharmony_ci None. 5215bd8deadSopenharmony_ci 5225bd8deadSopenharmony_ciNew Implementation Dependent State 5235bd8deadSopenharmony_ci 5245bd8deadSopenharmony_ci None. 5255bd8deadSopenharmony_ci 5265bd8deadSopenharmony_ciIssues 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci (1) Regular binding commands such as BindBuffer or BindTexture can be used 5295bd8deadSopenharmony_ci either to bind an existing object or to create and bind a new object. 5305bd8deadSopenharmony_ci Should the multi-bind commands behave similarly? 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ci RESOLVED: No. Multi-Bind commands will only support binding existing 5335bd8deadSopenharmony_ci objects. They will generate an error if any of the provided objects 5345bd8deadSopenharmony_ci doesn't already exist. 5355bd8deadSopenharmony_ci 5365bd8deadSopenharmony_ci This extension is intended to provide efficient APIs allowing 5375bd8deadSopenharmony_ci applications to bind multiple objects for rendering in a single command. 5385bd8deadSopenharmony_ci Implementations of these commands are intended to bind the objects to 5395bd8deadSopenharmony_ci consecutive binding points in a loop amortizing function call, name 5405bd8deadSopenharmony_ci space lookup, locking, and other overhead over <N> objects. Not 5415bd8deadSopenharmony_ci supporting bind-to-create reduces the number of cases that this loop 5425bd8deadSopenharmony_ci needs to handle. 5435bd8deadSopenharmony_ci 5445bd8deadSopenharmony_ci Even if bind-to-create were supported, it probably wouldn't be very 5455bd8deadSopenharmony_ci useful. When bind-to-create is used in current single-bind APIs, the 5465bd8deadSopenharmony_ci binding serves two purposes -- to create the object and to bind it for 5475bd8deadSopenharmony_ci use by subsequent "update" APIs defining the state of the new object. 5485bd8deadSopenharmony_ci In a multi-Bind API, it wouldn't be possible to bind more than one of 5495bd8deadSopenharmony_ci the <N> objects for update. 5505bd8deadSopenharmony_ci 5515bd8deadSopenharmony_ci Additionally, if BindTexture is used to create a texture object, the 5525bd8deadSopenharmony_ci texture type is established based on the <target> parameter (e.g., 5535bd8deadSopenharmony_ci TEXTURE_2D). The multi-Bind API for textures doesn't include <target> 5545bd8deadSopenharmony_ci parameters, so we wouldn't know what type of texture to create. 5555bd8deadSopenharmony_ci 5565bd8deadSopenharmony_ci (2) Should we provide a command binding multiple texture objects of 5575bd8deadSopenharmony_ci different targets (e.g., TEXTURE_2D and TEXTURE_3D) in a single call? 5585bd8deadSopenharmony_ci For example, should you be able to bind three 2D textures to the 5595bd8deadSopenharmony_ci TEXTURE_2D target of image units 1, 2, and 3, as well as binding two 5605bd8deadSopenharmony_ci 3D textures to the TEXTURE_3D target of texture image units 0 and 4? 5615bd8deadSopenharmony_ci 5625bd8deadSopenharmony_ci RESOLVED: Yes. The BindTextures() command does not take <target> 5635bd8deadSopenharmony_ci enums. Instead, the target used for each texture image unit comes from 5645bd8deadSopenharmony_ci the target used when the texture object was created. 5655bd8deadSopenharmony_ci 5665bd8deadSopenharmony_ci (3) Should we support unbinding objects in a multi-bind command? If so, 5675bd8deadSopenharmony_ci how does this work for texture objects, where each texture image unit 5685bd8deadSopenharmony_ci has multiple binding points (targets)? 5695bd8deadSopenharmony_ci 5705bd8deadSopenharmony_ci RESOLVED: Yes, applications can unbind objects by passing zero in the 5715bd8deadSopenharmony_ci array of object names. For textures, passing zero will unbind textures 5725bd8deadSopenharmony_ci from all texture targets. 5735bd8deadSopenharmony_ci 5745bd8deadSopenharmony_ci (4) Should we provide a simple way to unbind objects from a collection of 5755bd8deadSopenharmony_ci contiguous binding points? 5765bd8deadSopenharmony_ci 5775bd8deadSopenharmony_ci RESOLVED: Yes, passing a NULL pointer instead of an array of object 5785bd8deadSopenharmony_ci names does an unbind for all binding points. Basically, it's treated 5795bd8deadSopenharmony_ci like an array of zeroes. 5805bd8deadSopenharmony_ci 5815bd8deadSopenharmony_ci (5) Should we support multiple bindings of buffer objects using both the 5825bd8deadSopenharmony_ci "BindBufferBase" and the "BindBufferRange" styles? If so, what name 5835bd8deadSopenharmony_ci should we use for these APIs? 5845bd8deadSopenharmony_ci 5855bd8deadSopenharmony_ci RESOLVED: Yes. BindBuffersBase() is equivalent to a loop repeatedly 5865bd8deadSopenharmony_ci calling BindBufferBase(); BindBuffersRange() is equivalent to a loop 5875bd8deadSopenharmony_ci repeatedly calling BindBufferRange(). 5885bd8deadSopenharmony_ci 5895bd8deadSopenharmony_ci The name choice for the "plural" forms of BindBufferBase and 5905bd8deadSopenharmony_ci BindBufferRange was tricky. "BindBufferRanges" would have been a fine 5915bd8deadSopenharmony_ci choice for BindBufferRange, but using "BindBufferBases" would have been 5925bd8deadSopenharmony_ci strange since "BindBufferBase" means "bind a buffer from the base of its 5935bd8deadSopenharmony_ci storage (offset zero)". We considered "BindBuffers" as the plural for 5945bd8deadSopenharmony_ci "BindBufferBase", but decided to use "BindBuffers{Base,Range}". 5955bd8deadSopenharmony_ci 5965bd8deadSopenharmony_ci (6) If we support multiple bindings using the BindBufferRange style, how 5975bd8deadSopenharmony_ci should the application specify the ranges? 5985bd8deadSopenharmony_ci 5995bd8deadSopenharmony_ci RESOLVED: Applications will pass separate arrays of offsets and sizes. 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci Alternate options included: 6025bd8deadSopenharmony_ci 6035bd8deadSopenharmony_ci * a single array where entry 2<N> specifies the offset for binding <N> 6045bd8deadSopenharmony_ci and entry 2<N>+1 specifies the size for binding <N>; 6055bd8deadSopenharmony_ci 6065bd8deadSopenharmony_ci * defining a new structure type including an offset and a size, and 6075bd8deadSopenharmony_ci accepting an array of <N> structures 6085bd8deadSopenharmony_ci 6095bd8deadSopenharmony_ci (7) Should we create a "multi-bind" command for specifying vertex buffer 6105bd8deadSopenharmony_ci bindings (those specified via BindVertexBuffer)? 6115bd8deadSopenharmony_ci 6125bd8deadSopenharmony_ci RESOLVED: Yes. 6135bd8deadSopenharmony_ci 6145bd8deadSopenharmony_ci (8) If we add a "multi-bind" command for specifying vertex buffer 6155bd8deadSopenharmony_ci bindings, should we also create a similar command for specifying 6165bd8deadSopenharmony_ci multiple vertex formats (VertexAttrib*Format) in a single call? 6175bd8deadSopenharmony_ci 6185bd8deadSopenharmony_ci RESOLVED: No. The design of ARB_vertex_attrib_binding separated 6195bd8deadSopenharmony_ci vertex buffer bindings from vertex formats, expecting that many 6205bd8deadSopenharmony_ci applications will change bindings frequently but change formats 6215bd8deadSopenharmony_ci relatively infrequently. While we could create a command specifying 6225bd8deadSopenharmony_ci multiple formats at once, but it would require us to turn several format 6235bd8deadSopenharmony_ci parameters (<size>, <type>, <normalized>, <relativeoffset>) into arrays. 6245bd8deadSopenharmony_ci 6255bd8deadSopenharmony_ci Additionally, mutable vertex array objects can already be used to make a 6265bd8deadSopenharmony_ci wholesale change of formats and bindings. An application using a small 6275bd8deadSopenharmony_ci number of formats with a large number of bindings could create a 6285bd8deadSopenharmony_ci separate VAO for each format, and then change bindings with the 6295bd8deadSopenharmony_ci "multi-bind" command. 6305bd8deadSopenharmony_ci 6315bd8deadSopenharmony_ci (9) Should we provide a command to specify multiple image unit bindings in 6325bd8deadSopenharmony_ci a single command? 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci RESOLVED: Yes. We decided to support this for completeness, though the 6355bd8deadSopenharmony_ci required number of image units is relatively small (8). 6365bd8deadSopenharmony_ci 6375bd8deadSopenharmony_ci (10) Should binding an array of buffer objects via BindBuffersBase or 6385bd8deadSopenharmony_ci BindBuffersRange update the generic (non-indexed) binding points for 6395bd8deadSopenharmony_ci <target>? 6405bd8deadSopenharmony_ci 6415bd8deadSopenharmony_ci RESOLVED: No. 6425bd8deadSopenharmony_ci 6435bd8deadSopenharmony_ci In unextended OpenGL 4.3, targets like UNIFORM_BUFFER include both an 6445bd8deadSopenharmony_ci array of indexed bindings used for shader execution as well as a generic 6455bd8deadSopenharmony_ci "non-indexed" binding point that can be used for commands such as 6465bd8deadSopenharmony_ci BufferSubData. Calling BindBufferBase or BindBufferRange updates two 6475bd8deadSopenharmony_ci binding points -- binding <index> in the array of indexed bindings as 6485bd8deadSopenharmony_ci well as the generic binding point. Updating both binding points allows 6495bd8deadSopenharmony_ci applications to bind a buffer for manipulation and update in a single 6505bd8deadSopenharmony_ci command. 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci For BindBuffersBase and BindBuffersRange, the caller specifies <count> 6535bd8deadSopenharmony_ci separate buffers. We have specified these commands not to update the 6545bd8deadSopenharmony_ci generic binding point. Even if we were to update the generic binding 6555bd8deadSopenharmony_ci point, we'd have to pick one arbitrarily. 6565bd8deadSopenharmony_ci 6575bd8deadSopenharmony_ci (11) Typically, OpenGL specifies that if an error is generated by a 6585bd8deadSopenharmony_ci command, that command has no effect. This is somewhat unfortunate 6595bd8deadSopenharmony_ci for multi-bind commands, because it would require a first pass to 6605bd8deadSopenharmony_ci scan the entire list of bound objects for errors and then a second 6615bd8deadSopenharmony_ci pass to actually perform the bindings. Should we have different 6625bd8deadSopenharmony_ci error semantics? 6635bd8deadSopenharmony_ci 6645bd8deadSopenharmony_ci RESOLVED: Yes. In this specification, when the parameters for one of 6655bd8deadSopenharmony_ci the <count> binding points are invalid, that binding point is not 6665bd8deadSopenharmony_ci updated and an error will be generated. However, other binding points 6675bd8deadSopenharmony_ci in the same command will be updated if their parameters are valid and no 6685bd8deadSopenharmony_ci other error occurs. 6695bd8deadSopenharmony_ci 6705bd8deadSopenharmony_ci (12) What error should be generated if the <first> and <count> parameters 6715bd8deadSopenharmony_ci specified in multi-bind commands specify a range beyond 6725bd8deadSopenharmony_ci implementation-dependent limits? 6735bd8deadSopenharmony_ci 6745bd8deadSopenharmony_ci RESOLVED: INVALID_OPERATION is typically generated when the 6755bd8deadSopenharmony_ci combination of two values is illegal. INVALID_VALUE would also be 6765bd8deadSopenharmony_ci defensible. 6775bd8deadSopenharmony_ci 6785bd8deadSopenharmony_ci (13) How are the <offsets> and <sizes> parameters of BindBuffersRange used 6795bd8deadSopenharmony_ci if <buffers> is NULL? 6805bd8deadSopenharmony_ci 6815bd8deadSopenharmony_ci RESOLVED: We specify that these parameters are ignored when buffers 6825bd8deadSopenharmony_ci is NULL, so that applications can unbind a range of buffers with: 6835bd8deadSopenharmony_ci 6845bd8deadSopenharmony_ci BindBuffersRange(target, 0, 8, NULL, NULL, NULL); 6855bd8deadSopenharmony_ci 6865bd8deadSopenharmony_ci (14) Should we provide a "multi-bind" API to attach multiple textures to 6875bd8deadSopenharmony_ci the color attachments of a framebuffer object? Should we add an API 6885bd8deadSopenharmony_ci populating all attachments at once? 6895bd8deadSopenharmony_ci 6905bd8deadSopenharmony_ci RESOLVED: No. We could consider an API like: 6915bd8deadSopenharmony_ci 6925bd8deadSopenharmony_ci void FramebufferColorTextures(enum target, uint first, sizei count, 6935bd8deadSopenharmony_ci const uint *textures, 6945bd8deadSopenharmony_ci const uint *levels); 6955bd8deadSopenharmony_ci 6965bd8deadSopenharmony_ci One might omit the <levels> parameter, since level 0 is used most 6975bd8deadSopenharmony_ci frequently, and non-zero levels could still be handled by creating 6985bd8deadSopenharmony_ci spearate views via ARB_texture_view. If we wanted to be able to specify 6995bd8deadSopenharmony_ci the full set of attachments at once, we could have: 7005bd8deadSopenharmony_ci 7015bd8deadSopenharmony_ci void FramebufferTextures(enum target, sizei count, 7025bd8deadSopenharmony_ci const uint *colorAttachments, 7035bd8deadSopenharmony_ci const uint depthAttachment, 7045bd8deadSopenharmony_ci const uint stencilAttachment); 7055bd8deadSopenharmony_ci 7065bd8deadSopenharmony_ci This API effectively omits the <first> argument and always starts at 7075bd8deadSopenharmony_ci zero. The "all attachments" API could be handled in OpenGL today by 7085bd8deadSopenharmony_ci using separate framebuffer objects for each attachment combination. 7095bd8deadSopenharmony_ci However, for applications that work with various combinations of 7105bd8deadSopenharmony_ci attachments but don't already have a notion of "attachment sets" to map 7115bd8deadSopenharmony_ci to framebuffer objects, caching different attachment combinations is 7125bd8deadSopenharmony_ci somewhat unwieldy. 7135bd8deadSopenharmony_ci 7145bd8deadSopenharmony_ci (15) Should we provide a multi-bind API that binds pairs of textures and 7155bd8deadSopenharmony_ci samplers to a set of consecutive texture image units? 7165bd8deadSopenharmony_ci 7175bd8deadSopenharmony_ci RESOLVED: No. We could provide a command such as: 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ci void BindTexturesSamplers(uint first, sizei count, 7205bd8deadSopenharmony_ci const uint *textures, 7215bd8deadSopenharmony_ci const uint *samplers); 7225bd8deadSopenharmony_ci 7235bd8deadSopenharmony_ci that would be roughly equivalent to: 7245bd8deadSopenharmony_ci 7255bd8deadSopenharmony_ci BindTextures(first, count, textures); 7265bd8deadSopenharmony_ci BindSamplers(first, count, samplers); 7275bd8deadSopenharmony_ci 7285bd8deadSopenharmony_ci If we did this, we'd have to decide how it would interact with the error 7295bd8deadSopenharmony_ci semantics in issue (11). If we have an error generated because of an 7305bd8deadSopenharmony_ci invalid texture for a given unit, would the sampler state for that unit 7315bd8deadSopenharmony_ci still be updated if the sampler provided were valid? Since we chose not 7325bd8deadSopenharmony_ci to support this feature, we don't need to address this question. 7335bd8deadSopenharmony_ci 7345bd8deadSopenharmony_ci (16) When binding a non-zero texture to a texture image unit, should 7355bd8deadSopenharmony_ci BindTextures implicitly unbind the textures bound to all other 7365bd8deadSopenharmony_ci targets of the unit? 7375bd8deadSopenharmony_ci 7385bd8deadSopenharmony_ci RESOLVED: No. 7395bd8deadSopenharmony_ci 7405bd8deadSopenharmony_ci This approach was considered to behave similarly to the proposed 7415bd8deadSopenharmony_ci behavior for binding zero in a multi-bind API, where it unbinds any 7425bd8deadSopenharmony_ci bound texture for all targets. Applications using BindTextures 7435bd8deadSopenharmony_ci exclusively would never have more than one texture bound to the targets 7445bd8deadSopenharmony_ci of a texture image unit. A driver implementation might optimize for 7455bd8deadSopenharmony_ci this behavior by having a single "primary" binding point for each 7465bd8deadSopenharmony_ci texture unit (used by this API) and then "backup" binding points for the 7475bd8deadSopenharmony_ci other targets (used by BindTexture). This API would update the 7485bd8deadSopenharmony_ci "primary" binding point but would only need to touch the "backup" 7495bd8deadSopenharmony_ci binding points if something were bound there via BindTexture. However, 7505bd8deadSopenharmony_ci BindTexture would still be available and is commonly used today, so 7515bd8deadSopenharmony_ci there would probably be little benefit. 7525bd8deadSopenharmony_ci 7535bd8deadSopenharmony_ci (17) For the BindTextures API, should the <first> parameter be an unsigned 7545bd8deadSopenharmony_ci integer (0) or an enum (GL_TEXTURE0)? 7555bd8deadSopenharmony_ci 7565bd8deadSopenharmony_ci RESOLVED: Use an integer unit number. 7575bd8deadSopenharmony_ci 7585bd8deadSopenharmony_ci (18) The BindImageTexture API not only binds a texture to an image unit, 7595bd8deadSopenharmony_ci but also sets several additional pieces of state associated with an 7605bd8deadSopenharmony_ci image unit (level, layered or not, selected layer, and image unit 7615bd8deadSopenharmony_ci format). How should this state be set? Should we provide separate 7625bd8deadSopenharmony_ci arrays for each extra parameter? 7635bd8deadSopenharmony_ci 7645bd8deadSopenharmony_ci RESOLVED: Use "default" values for each image unit. When unbinding 7655bd8deadSopenharmony_ci textures, reset the state to API defaults (level zero, non-layered, 7665bd8deadSopenharmony_ci layer zero, and R8 format). When binding textures, bind all layers of 7675bd8deadSopenharmony_ci level zero and take the format from the internal format of the texture 7685bd8deadSopenharmony_ci level being bound. Setting <layered> to TRUE in this case is not the 7695bd8deadSopenharmony_ci default state, but it seems like the best default choice for cube map or 7705bd8deadSopenharmony_ci array textures. For textures without layers, the <layered> parameter 7715bd8deadSopenharmony_ci has no effect, so this doesn't cause any problems with other targets 7725bd8deadSopenharmony_ci like TEXTURE_2D. 7735bd8deadSopenharmony_ci 7745bd8deadSopenharmony_ci If an application wants to bind levels other than zero, select 7755bd8deadSopenharmony_ci individual layers of a level for array textures, or use a format 7765bd8deadSopenharmony_ci different from that of the texture, it will be necessary to do 7775bd8deadSopenharmony_ci individual bindings via BindImageTexture. 7785bd8deadSopenharmony_ci 7795bd8deadSopenharmony_ci (19) If a texture bound to an image unit via BindImageTextures doesn't 7805bd8deadSopenharmony_ci have a defined texture image (i.e., width = height = 0 for 2D 7815bd8deadSopenharmony_ci textures), what internal format is associated with the binding? 7825bd8deadSopenharmony_ci 7835bd8deadSopenharmony_ci UNRESOLVED: We will generate INVALID_OPERATION if there is no defined 7845bd8deadSopenharmony_ci texture image. 7855bd8deadSopenharmony_ci 7865bd8deadSopenharmony_ci Note that even if a texture level has no texels defined, there is still 7875bd8deadSopenharmony_ci an <internalformat> associated with the level, which can be queried with 7885bd8deadSopenharmony_ci GetTexLevelParameter. That value could be used, but it would still have 7895bd8deadSopenharmony_ci to be checked to see if it's valid for image loads and stores. 7905bd8deadSopenharmony_ci BindImageTexture doesn't accept all possible <format> enums. 7915bd8deadSopenharmony_ci Additionally, the default internal format is profile-dependent: core 7925bd8deadSopenharmony_ci uses "RGBA", compatibility uses "1" (from OpenGL 1.0, meaning 7935bd8deadSopenharmony_ci LUMINANCE). Neither is accepted by BindImageTexture, though RGBA might 7945bd8deadSopenharmony_ci be mapped internally by a driver to an internal format like RGBA8 that 7955bd8deadSopenharmony_ci is accepted. 7965bd8deadSopenharmony_ci 7975bd8deadSopenharmony_ci Given the potential confusion over the internal format for zero-sized 7985bd8deadSopenharmony_ci images and default internal formats, it's best to just not accept 7995bd8deadSopenharmony_ci textures without defined images. 8005bd8deadSopenharmony_ci 8015bd8deadSopenharmony_ci (20) The BindBuffersRange and BindVertexBuffers accept arrays of "intptr" 8025bd8deadSopenharmony_ci and "sizeiptr" values, which will have different sizes on 32- and 8035bd8deadSopenharmony_ci 64-bit architectures. Is there any problem here? 8045bd8deadSopenharmony_ci 8055bd8deadSopenharmony_ci RESOLVED: The API is fine. Application developers will need to be 8065bd8deadSopenharmony_ci careful to use the correct data type for the arrays it passes to these 8075bd8deadSopenharmony_ci commands. If the array passed to <offsets> is an array of "int" instead 8085bd8deadSopenharmony_ci of "intptr", that code will typically work fine when compiled on 32-bit 8095bd8deadSopenharmony_ci architectures if "int" types are stored as 32-bit values. But if the 8105bd8deadSopenharmony_ci same code is compiled for a 64-bit architecture, the array will be too 8115bd8deadSopenharmony_ci small. We expect that compilers will generate warnings and/or errors 8125bd8deadSopenharmony_ci if the caller passes a pointer to the wrong type. 8135bd8deadSopenharmony_ci 8145bd8deadSopenharmony_ci (21) In the compatibility profile, can multi-bind commands be included in 8155bd8deadSopenharmony_ci display lists? 8165bd8deadSopenharmony_ci 8175bd8deadSopenharmony_ci RESOLVED: No. 8185bd8deadSopenharmony_ci 8195bd8deadSopenharmony_ci (22) What error should be generated when one of the names passed to a 8205bd8deadSopenharmony_ci multi-bind command is not the name of an existing object? 8215bd8deadSopenharmony_ci 8225bd8deadSopenharmony_ci UNRESOLVED: INVALID_OPERATION. For the core profile, as well as for 8235bd8deadSopenharmony_ci object types created since OpenGL 3.1, we have spec errors like the 8245bd8deadSopenharmony_ci following for BindTexture: 8255bd8deadSopenharmony_ci 8265bd8deadSopenharmony_ci An INVALID_OPERATION error is generated if <texture> is not zero or a 8275bd8deadSopenharmony_ci name returned from a previous call to GenTextures, or if such a name 8285bd8deadSopenharmony_ci has since been deleted. 8295bd8deadSopenharmony_ci 8305bd8deadSopenharmony_ci In issue (1), we decided that the multi-bind commands could not be used 8315bd8deadSopenharmony_ci to create objects, whether or not the object names had previously been 8325bd8deadSopenharmony_ci returned by commands like GenTextures. The errors we require for the 8335bd8deadSopenharmony_ci multi-bind commands are different from the BindTexture language quoted 8345bd8deadSopenharmony_ci immmediately above only in the sense that the multi-bind will 8355bd8deadSopenharmony_ci additionally throw an error if a texture name has been generated by 8365bd8deadSopenharmony_ci GenTextures but the underlying texture object hasn't yet been created. 8375bd8deadSopenharmony_ci However, the errors are similar enough that they should both throw the 8385bd8deadSopenharmony_ci same error code (INVALID_OPERATION). 8395bd8deadSopenharmony_ci 8405bd8deadSopenharmony_ci 8415bd8deadSopenharmony_ciRevision History 8425bd8deadSopenharmony_ci 8435bd8deadSopenharmony_ci Revision 11, August 16, 2013 (Jon Leech) 8445bd8deadSopenharmony_ci - Typo fix for BindBuffers* "offsets and strides" -> "offsets and 8455bd8deadSopenharmony_ci sizes" (Bug 10685). 8465bd8deadSopenharmony_ci Revision 10, July 21, 2013 (Jon Leech) 8475bd8deadSopenharmony_ci - Specify that multibind commands are equivalent to repeated calls to 8485bd8deadSopenharmony_ci the corresponding single bind commands except that objects are not 8495bd8deadSopenharmony_ci created if they do not exist, matching issue 1. The other single 8505bd8deadSopenharmony_ci bind commands do not create objects so this clarification is not 8515bd8deadSopenharmony_ci needed for them (Bug 10486). 8525bd8deadSopenharmony_ci 8535bd8deadSopenharmony_ci Revision 9, May 30, 2013 (Jon Leech) 8545bd8deadSopenharmony_ci - Fix typo for <offsets> "less than to zero" -> "less than zero". Use 8555bd8deadSopenharmony_ci "<first> *through* <first> + <count> - 1" consistently. 8565bd8deadSopenharmony_ci 8575bd8deadSopenharmony_ci Revision 8, May 28, 2013 8585bd8deadSopenharmony_ci - Change the error thrown when an object name passed to a multi-bind 8595bd8deadSopenharmony_ci command doesn't yet exist from INVALID_VALUE to INVALID_OPERATION 8605bd8deadSopenharmony_ci (bug 10264). 8615bd8deadSopenharmony_ci - Disallow the use of multi-bind commands in display lists (bug 10322). 8625bd8deadSopenharmony_ci - Change the <count> parameter in multi-bind commands to use the type 8635bd8deadSopenharmony_ci "sizei" to be consistent with other GL commands accepting a <count> 8645bd8deadSopenharmony_ci parameter (bug 10323). 8655bd8deadSopenharmony_ci - Clarify that passing NULL in arguments like <buffers> only affect 8665bd8deadSopenharmony_ci bindings <first> through <first>+<count>-1 (bug 10289). 8675bd8deadSopenharmony_ci - In the errors section for multi-bind commands, clarify which errors 8685bd8deadSopenharmony_ci apply to only a single binding and which apply to the entire call (bug 8695bd8deadSopenharmony_ci 10289). 8705bd8deadSopenharmony_ci - Clarify in the spec language that BindImageTextures sets <access> to 8715bd8deadSopenharmony_ci READ_WRITE for all bindings, which was already in the pseudocode (bug 8725bd8deadSopenharmony_ci 10289). 8735bd8deadSopenharmony_ci - Use the term "general buffer binding" in spec language stating that 8745bd8deadSopenharmony_ci BindBuffersBase and BindBuffersRange only affect numbered binding 8755bd8deadSopenharmony_ci points (bug 10289). 8765bd8deadSopenharmony_ci - Add issues (21) and (22). 8775bd8deadSopenharmony_ci 8785bd8deadSopenharmony_ci Revision 7, May 18, 2013 8795bd8deadSopenharmony_ci - Fix typo in the description of BindSamplers. 8805bd8deadSopenharmony_ci 8815bd8deadSopenharmony_ci Revision 6, May 17, 2013 8825bd8deadSopenharmony_ci - Modify the pseudocode for BindTextures to add in TEXTURE0 to the 8835bd8deadSopenharmony_ci value passed to ActiveTexture, since it takes an enum and not an 8845bd8deadSopenharmony_ci integer. 8855bd8deadSopenharmony_ci 8865bd8deadSopenharmony_ci Revision 5, May 10, 2013 8875bd8deadSopenharmony_ci - Define lookupInternalFormat in pseudocode example. 8885bd8deadSopenharmony_ci 8895bd8deadSopenharmony_ci Revision 4, May 2, 2013 8905bd8deadSopenharmony_ci - Renamed entry points for buffer bindings from BindBuffers() and 8915bd8deadSopenharmony_ci BindBufferRanges() to BindBuffersBase() and BindBuffersRange(), 8925bd8deadSopenharmony_ci respectively. 8935bd8deadSopenharmony_ci - Add an INVALID_OPERATION error if a non-zero texture passed to 8945bd8deadSopenharmony_ci BindImageTextures() does not have a defined image array. 8955bd8deadSopenharmony_ci - Add an "unless otherwise noted" qualification to the general spec rule 8965bd8deadSopenharmony_ci that commands producing errors do not modify the GL state. Multi-bind 8975bd8deadSopenharmony_ci commands have special error behavior discussed in issue (11). 8985bd8deadSopenharmony_ci - Mark issues resolved based on previous spec reviews. 8995bd8deadSopenharmony_ci - Added issue (20). 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci Revision 3, April 19, 2013 9025bd8deadSopenharmony_ci - Add a BindImageTextures API to bind a collection of textures to image 9035bd8deadSopenharmony_ci units (for shader image loads/stores). 9045bd8deadSopenharmony_ci - Fix the spec to consistently use the parameter name <first> to 9055bd8deadSopenharmony_ci identify the first binding point to update. 9065bd8deadSopenharmony_ci - Add new issues. 9075bd8deadSopenharmony_ci 9085bd8deadSopenharmony_ci Revision 2, January 20, 2013 9095bd8deadSopenharmony_ci - Fix various specification errors. 9105bd8deadSopenharmony_ci - Add an issue about whether we should provide a multi-bind API for 9115bd8deadSopenharmony_ci framebuffer object attachments. 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci Revision 1, January 18, 2013 9145bd8deadSopenharmony_ci - Initial revision. 915