15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_explicit_attrib_location 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_explicit_attrib_location 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Ian Romanick, Intel (ian.d.romanick 'at' intel.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNotice 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Copyright (c) 2010-2013 The Khronos Group Inc. Copyright terms at 165bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciSpecification Update Policy 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 215bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 225bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 235bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 245bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 255bd8deadSopenharmony_ci described in more detail at 265bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ciStatus 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci Complete. Approved by the ARB at the 2010/01/22 F2F meeting. 315bd8deadSopenharmony_ci Approved by the Khronos Board of Promoters on March 10, 2010. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciVersion 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci Last Modified Date: August 1, 2011 365bd8deadSopenharmony_ci Revision: 12 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciNumber 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci ARB Extension #79 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciDependencies 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci Requires OpenGL 2.0 or GL_ARB_vertex_shader. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci This extension interacts with GL_ARB_blend_func_extended. 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci This extension is written against the OpenGL 3.2 (Core Profile) 495bd8deadSopenharmony_ci specification dated 7/24/2009 and the OpenGL Shading Language 1.50.09 505bd8deadSopenharmony_ci specification dated 7/24/2009. 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci This extension interacts with GL_ARB_separate_shader_objects, 535bd8deadSopenharmony_ci GL_ARB_gpu_shader_fp64, OpenGL 4.0, and OpenGL 4.1. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciOverview 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci This extension provides a method to pre-assign attribute locations to 585bd8deadSopenharmony_ci named vertex shader inputs and color numbers to named fragment shader 595bd8deadSopenharmony_ci outputs. This allows applications to globally assign a particular 605bd8deadSopenharmony_ci semantic meaning, such as diffuse color or vertex normal, to a particular 615bd8deadSopenharmony_ci attribute location without knowing how that attribute will be named in any 625bd8deadSopenharmony_ci particular shader. 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ciIP Status 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci No known IP claims. 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ciNew Procedures and Functions 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci None 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciNew Tokens 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci None 755bd8deadSopenharmony_ci 765bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 3.2 Specification (OpenGL Operation) 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci Section 2.11.3 "Vertex Attributes": 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci Modify the seventh paragraph on page 53 to read: 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci "When a program is linked, any active attributes without a binding 835bd8deadSopenharmony_ci specified either through BindAttribLocation or explicitly set 845bd8deadSopenharmony_ci within the shader text will be automatically be bound to vertex 855bd8deadSopenharmony_ci attributes by the GL. ... LinkProgram will fail if the attribute 865bd8deadSopenharmony_ci bindings assigned by BindAttribLocation do not leave not enough space 875bd8deadSopenharmony_ci to assign a location for an active matrix attribute or an active 885bd8deadSopenharmony_ci attribute array, both of which require multiple contiguous generic 895bd8deadSopenharmony_ci attributes. If an active attribute has a binding explicitly set within 905bd8deadSopenharmony_ci the shader text and a different binding assigned by BindAttribLocation, 915bd8deadSopenharmony_ci the assignment in the shader text is used." 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 3.2 Specification (Rasterization) 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci Section 3.9.2 "Shader Execution", subsection "Shader Outputs": 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci Replace the fourth paragraph of page 183: 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci When a program is linked, any varying out variables without a binding 1005bd8deadSopenharmony_ci specified through BindFragDataLocationIndexed, BindFragDataLocation, or 1015bd8deadSopenharmony_ci explicitly set within the shader text will automatically be bound to 1025bd8deadSopenharmony_ci fragment colors and indices by the GL. All such assignments will use 1035bd8deadSopenharmony_ci color indices of zero. Such bindings can be queried using the commands 1045bd8deadSopenharmony_ci GetFragDataLocation and GetFragDataIndex. If a varying out variable has a 1055bd8deadSopenharmony_ci binding explicitly set within the shader text and a different binding 1065bd8deadSopenharmony_ci assigned by BindFragDataLocationIndexed or BindFragDataLocation, the 1075bd8deadSopenharmony_ci assignment in the shader text is used. Output binding assignments will 1085bd8deadSopenharmony_ci cause LinkProgram to fail: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci * if the number of active outputs is greater than the value of 1115bd8deadSopenharmony_ci MAX_DRAW_BUFFERS; 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci * if the program has an active output assigned to a location greater 1145bd8deadSopenharmony_ci than or equal to the value of MAX_DUAL_SOURCE_DRAW_BUFFERS and has an 1155bd8deadSopenharmony_ci active output assigned an index greater than or equal to one; 1165bd8deadSopenharmony_ci 1175bd8deadSopenharmony_ci * if more than one varying out variable is bound to the same number and 1185bd8deadSopenharmony_ci index; or 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci * if the explicit binding assigments do not leave enough space for the 1215bd8deadSopenharmony_ci linker to automatically assign a location for a varying out array, 1225bd8deadSopenharmony_ci which requires multiple contiguous locations. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 3.2 Specification (Per-Fragment 1265bd8deadSopenharmony_ciOperations and the Framebuffer) 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci None. 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 3.2 Specification (Special Functions) 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci None. 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 3.2 Specification (State and State 1355bd8deadSopenharmony_ciRequest) 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci None. 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 3.2 Specification (Invariance) 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci None. 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ciAdditions to Appendix B of the OpenGL 3.2 Specification (Corollaries) 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci None. 1465bd8deadSopenharmony_ci 1475bd8deadSopenharmony_ciAdditions to Appendix C of the OpenGL 3.2 Specification (Compressed Texture 1485bd8deadSopenharmony_ciImage Formats) 1495bd8deadSopenharmony_ci 1505bd8deadSopenharmony_ci None. 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ciAdditions to Appendix D of the OpenGL 3.2 Specification (Shared Objects and 1535bd8deadSopenharmony_ciMultiple Contexts) 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ci None. 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ciAdditions to Appendix E of the OpenGL 3.2 Specification (The Deprecation 1585bd8deadSopenharmony_ciModel) 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci None. 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 1635bd8deadSopenharmony_ci 1645bd8deadSopenharmony_ci None. 1655bd8deadSopenharmony_ci 1665bd8deadSopenharmony_ciDependencies on ARB_blend_func_extended 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci If ARB_blend_func_extended is not supported, remove <index> from the 1695bd8deadSopenharmony_ci layout-qualifier-id list for fragment shader outputs. Remove all language 1705bd8deadSopenharmony_ci regarding "Nth input to the blend equation," and remove the "factor" 1715bd8deadSopenharmony_ci example. Additionally, remove references to BindFragDataLocationIndexed 1725bd8deadSopenharmony_ci and GetFragDataIndex in the API spec language. 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ciDependencies on ARB_separate_shader_objects, ARB_gpu_shader_fp64, OpenGL 4.0, 1755bd8deadSopenharmony_ciand OpenGL 4.1 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci If ARB_separate_shader_objects (or OpenGL 4.1) is supported, the layout 1785bd8deadSopenharmony_ci location qualifier introduced by this extension is extended to apply to 1795bd8deadSopenharmony_ci inputs for non-vertex shaders and outputs for non-fragment shaders. If 1805bd8deadSopenharmony_ci ARB_gpu_shader_fp64 (or OpenGL 4.0) is supported, such inputs and outputs 1815bd8deadSopenharmony_ci can have double-precision component types. 1825bd8deadSopenharmony_ci 1835bd8deadSopenharmony_ci When these extensions are supported, there are special rules for the 1845bd8deadSopenharmony_ci number of locations consumed by "dvec3" and "dvec4" types, which require 1855bd8deadSopenharmony_ci more storage than is available in a four-component single-precision 1865bd8deadSopenharmony_ci vector. The rules are: 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci * dvec3/dvec4 vertex inputs consume one location (generic vertex 1895bd8deadSopenharmony_ci attribute), but can count as two vectors for the purposes of 1905bd8deadSopenharmony_ci determining if the vertex shader consumes too many inputs 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci * dvec3/dvec4 inputs and outputs for other stages consume two locations 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ci The relevant spec edits (modifying language introduced here) can be found 1955bd8deadSopenharmony_ci in the ARB_separate_shader_objects extension. 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ciGLX protocol 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ci None. 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ciErrors 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci None, see issue #1. 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ciNew State 2065bd8deadSopenharmony_ci 2075bd8deadSopenharmony_ci None. 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ciNew Implementation Dependent State 2105bd8deadSopenharmony_ci 2115bd8deadSopenharmony_ci None. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ciModifications to The OpenGL Shading Language Specification, Version 1.50.09 2155bd8deadSopenharmony_ci 2165bd8deadSopenharmony_ci Including the following line in a shader can be used to control 2175bd8deadSopenharmony_ci the language feature described in thie extension: 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci #extension GL_ARB_explicit_attrib_location : <behavior> 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci where <behavior> is as described in section 3.3. 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci A new preprocessor #define is added to the OpenGL Shading Language: 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci #define GL_ARB_explicit_attrib_location 1 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ci Modify the second paragraph of section 4.3.4 "Inputs", p. 30 to read: 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci ... The values copied in are established by the OpenGL API or through the 2305bd8deadSopenharmony_ci use of the of the layout identifier <location>. ... 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci Replace the first paragraph of section 4.3.8.1 "Input Layout Qualifiers" 2335bd8deadSopenharmony_ci with: 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci Vertex shaders allow input layout qualifiers on input variable 2365bd8deadSopenharmony_ci declarations. The layout qualifier identifier for vertex shader inputs 2375bd8deadSopenharmony_ci is: 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci layout-qualifier-id 2405bd8deadSopenharmony_ci location = integer-constant 2415bd8deadSopenharmony_ci 2425bd8deadSopenharmony_ci Only one argument is accepted. For example, 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ci layout(location = 3) in vec4 normal; 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci will establish that the vertex shader input <normal> is copied in from 2475bd8deadSopenharmony_ci vector location number 3. 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci If the named vertex shader input has a scalar or vector type, it will 2505bd8deadSopenharmony_ci consume a single location. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci If the named vertex shader input is an array, it will be assigned 2535bd8deadSopenharmony_ci consecutive locations starting with the location specified. For example, 2545bd8deadSopenharmony_ci 2555bd8deadSopenharmony_ci layout(location = 6) in vec4 colors[3]; 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci will establish that the vertex shader input <colors> is copied in from 2585bd8deadSopenharmony_ci vector location numbers 6, 7, and 8. 2595bd8deadSopenharmony_ci 2605bd8deadSopenharmony_ci If the named vertex shader input is an <n>x<m> matrix, it will be assigned 2615bd8deadSopenharmony_ci multiple locations starting with the location specified. The number of 2625bd8deadSopenharmony_ci locations assigned for each matrix will be the same as for an <n>-element 2635bd8deadSopenharmony_ci array of <m>-component vectors. For example, 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci layout(location = 9) in mat4 transforms[2]; 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci will establish that input <transforms> is assigned to vector location 2685bd8deadSopenharmony_ci numbers 9-16, with transforms[0] being assigned to locations 9-12 and 2695bd8deadSopenharmony_ci transforms[1] being assigned to locations 13-16. 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci If an input variable with no location assigned in the shader text has a 2725bd8deadSopenharmony_ci location specified through the OpenGL API, the API-assigned location will 2735bd8deadSopenharmony_ci be used. Otherwise, such variables will be assigned a location by the 2745bd8deadSopenharmony_ci linker. See section 2.11.3 of the OpenGL Specification for more details. 2755bd8deadSopenharmony_ci A link error will occur if an input variable is declared in multiple 2765bd8deadSopenharmony_ci vertex shaders with conflicting locations. 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ci Replace the first paragraph of section 4.3.8.2 "Output Layout Qualifiers" 2795bd8deadSopenharmony_ci with: 2805bd8deadSopenharmony_ci 2815bd8deadSopenharmony_ci Vertex shaders cannot have output layout qualifiers. 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ci Add the following text after the second paragraph on page 39: 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci Fragment shaders allow output layout qualifiers on output variable 2865bd8deadSopenharmony_ci declarations. The layout qualifier identifier for fragment shader 2875bd8deadSopenharmony_ci outputs is: 2885bd8deadSopenharmony_ci 2895bd8deadSopenharmony_ci layout-qualifier-id 2905bd8deadSopenharmony_ci location = integer-constant 2915bd8deadSopenharmony_ci index = integer-constant 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci Each of these qualifiers may appear at most once. If <index> is specified, 2945bd8deadSopenharmony_ci <location> must also be specified. If <index> is not specified, the 2955bd8deadSopenharmony_ci default value 0 is used. For example, 2965bd8deadSopenharmony_ci 2975bd8deadSopenharmony_ci layout(location = 3) out vec4 color; 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci will establish that the fragment shader output <color> is copied out to 3005bd8deadSopenharmony_ci fragment color 3 as the first (index zero) input to the blend equation. 3015bd8deadSopenharmony_ci And, 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci layout(location = 3, index = 1) out vec4 factor; 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci will establish that the fragment shader output <factor> is copied out to 3065bd8deadSopenharmony_ci fragment color 3 as the second (index one) input to the blend equation. 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci If the named fragment shader output is an array, it will be assigned 3095bd8deadSopenharmony_ci consecutive locations starting with the location specified. For example, 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci layout(location = 2) out vec4 colors[3]; 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ci will establish that the fragment shader output <colors> is copied in from 3145bd8deadSopenharmony_ci vector location numbers 2, 3, and 4. 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci If an output variable with no location or index assigned in the shader 3175bd8deadSopenharmony_ci text has a location specified through the OpenGL API, the API-assigned 3185bd8deadSopenharmony_ci location will be used. Otherwise, such variables will be assigned a 3195bd8deadSopenharmony_ci location by the linker. All such assignments will have a color index of 3205bd8deadSopenharmony_ci zero. See section 3.9.2 of the OpenGL Specification for more details. A 3215bd8deadSopenharmony_ci link error will occur if an input variable is declared in multiple vertex 3225bd8deadSopenharmony_ci shaders with conflicting location or index values. 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ciIssues 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci 1. How should the error be reported when the attribute location 3285bd8deadSopenharmony_ci specified in the shader source is larger than MAX_VERTEX_ATTRIBUTES? 3295bd8deadSopenharmony_ci 3305bd8deadSopenharmony_ci RESOLVED. Generate a link error. The existing spec language already 3315bd8deadSopenharmony_ci covers this case: 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci "LinkProgram will fail if the assigned binding of an active attribute 3345bd8deadSopenharmony_ci variable would cause the GL to reference a non-existent generic 3355bd8deadSopenharmony_ci attribute (one greater than or equal to MAX_VERTEX_ATTRIBS)." 3365bd8deadSopenharmony_ci 3375bd8deadSopenharmony_ci 2. What happens when the shader text binds an input to a 3385bd8deadSopenharmony_ci particular attribute location and the same attribute location is 3395bd8deadSopenharmony_ci bound to a different attribute via the API? 3405bd8deadSopenharmony_ci 3415bd8deadSopenharmony_ci RESOLVED. The setting in the shader is always used. 3425bd8deadSopenharmony_ci 3435bd8deadSopenharmony_ci 3. Should layout-qualifier-id be index or location? 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci RESOLVED. location. The API uses both. <index> is used as the 3465bd8deadSopenharmony_ci parameter name to VertexAttribPointer and BindAttribLocation, but 3475bd8deadSopenharmony_ci "location" is used in the name of BindAttribLocation and 3485bd8deadSopenharmony_ci GetAttribLocation. However, there is some expectation that <index> may 3495bd8deadSopenharmony_ci be used for another purpose later. 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci 4. The GL spec allows BindAttribLocation to be called before attaching 3525bd8deadSopenharmony_ci shaders or linking. If an application does this and specifies a 3535bd8deadSopenharmony_ci layout, which takes precedence? 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci RESOLVED. The setting the shader is always used. 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ci The three options that were considered: 3585bd8deadSopenharmony_ci 3595bd8deadSopenharmony_ci a. The setting from the API, if specified, always wins. 3605bd8deadSopenharmony_ci 3615bd8deadSopenharmony_ci b. The setting from the shader, if specified, always wins. 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci c. The setting is order dependent. If the shader is 3645bd8deadSopenharmony_ci attached after the API setting is made, the shader 3655bd8deadSopenharmony_ci layout is used. If the API setting is made after the 3665bd8deadSopenharmony_ci shader is attached, the API setting is used. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci 5. What happens if an input or output variable is declared in two 3695bd8deadSopenharmony_ci shader objects with conflicting attribute locations? 3705bd8deadSopenharmony_ci 3715bd8deadSopenharmony_ci RESOLVED. A link error will occur. 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci 6. What happens if an input or output variable is declared in two 3745bd8deadSopenharmony_ci shader objects with an attribute location assigned in one shader but 3755bd8deadSopenharmony_ci not the other. 3765bd8deadSopenharmony_ci 3775bd8deadSopenharmony_ci RESOLVED. The link will succeed and use the explicit assignment from 3785bd8deadSopenharmony_ci the first shader, as long as there are no other conflicting 3795bd8deadSopenharmony_ci assignments. 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci 3825bd8deadSopenharmony_ciRevision History 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ci (v12, 2011-08-01, Pat Brown) 3855bd8deadSopenharmony_ci Add GLSL spec language explicitly specifying the number of vertex 3865bd8deadSopenharmony_ci shader input locations consumed by basic scalar/vector types and by 3875bd8deadSopenharmony_ci basic matrix types (bug 7809). Also add interactions with 3885bd8deadSopenharmony_ci ARB_separate_shader_objects and ARB_gpu_shader_fp64, which extend the 3895bd8deadSopenharmony_ci location mechanism introduced here. 3905bd8deadSopenharmony_ci 3915bd8deadSopenharmony_ci (v11, 2010-01-14, Pat Brown) 3925bd8deadSopenharmony_ci Resolve the behavior of conflicting attribute assignments via shader 3935bd8deadSopenharmony_ci text and API calls, with shader text prevailing (bug 5803). Resolve 3945bd8deadSopenharmony_ci the behavior of conflicting assignments within two separate shader 3955bd8deadSopenharmony_ci objects (link error). Add spec language allowing for a link error if 3965bd8deadSopenharmony_ci explicit attribute assignments don't leave enough space for array 3975bd8deadSopenharmony_ci inputs or outputs (bug 5809). Clarify that any automatic assignments 3985bd8deadSopenharmony_ci for fragment outputs will use color index zero (bug 5809, interaction 3995bd8deadSopenharmony_ci with ARB_blend_func_extended). Fix GLSL language to clarify that 4005bd8deadSopenharmony_ci layout qualifiers for attribute assignments are on individual 4015bd8deadSopenharmony_ci declarations, and not on the interface qualifiers "in" or "out". 4025bd8deadSopenharmony_ci 4035bd8deadSopenharmony_ci (v10, 2009-12-11, Jon Leech) 4045bd8deadSopenharmony_ci Remove ARB suffixes for integration into 3.3 core spec. 4055bd8deadSopenharmony_ci 4065bd8deadSopenharmony_ci (v9, 2009-10-29, Ian Romanick) 4075bd8deadSopenharmony_ci Resolved issue #4. 4085bd8deadSopenharmony_ci Changed the resolution of issue #2 to match the resolution to 4095bd8deadSopenharmony_ci #4. 4105bd8deadSopenharmony_ci 4115bd8deadSopenharmony_ci (v8, 2009-10-26, Ian Romanick) 4125bd8deadSopenharmony_ci Added interactions with ARB_blend_func_extended. 4135bd8deadSopenharmony_ci 4145bd8deadSopenharmony_ci (v7, 2009-10-23, Ian Romanick) 4155bd8deadSopenharmony_ci Reworded overview to include mention of fragment shader outputs. 4165bd8deadSopenharmony_ci Explicitly state the behavior of specifying a layout for an array. 4175bd8deadSopenharmony_ci Resolved issue #1 - link error. 4185bd8deadSopenharmony_ci Resolved issue #3 - changed the use of <index> to <location>. 4195bd8deadSopenharmony_ci Added issue #4. 4205bd8deadSopenharmony_ci 4215bd8deadSopenharmony_ci (v6, 2009-10-22, Ian Romanick) 4225bd8deadSopenharmony_ci Added ability to specify fragment shader output bindings. 4235bd8deadSopenharmony_ci 4245bd8deadSopenharmony_ci Changed layout syntax from "layout(index(n))" to "layout(index = 4255bd8deadSopenharmony_ci n)". This eliminated the need to modify the shading language 4265bd8deadSopenharmony_ci grammar. This matches the max_vertices layout qualifier used by 4275bd8deadSopenharmony_ci geometry shaders. 4285bd8deadSopenharmony_ci 4295bd8deadSopenharmony_ci (v5, 2009-10-22, Ian Romanick) 4305bd8deadSopenharmony_ci Re-worded spec based on OpenGL 3.2 and GLSL 1.50. 4315bd8deadSopenharmony_ci 4325bd8deadSopenharmony_ci (v4, 2009-10-22, Ian Romanick) 4335bd8deadSopenharmony_ci Convert MESA to ARB. Added issue #3. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci (v3, 2009-02-17, Ian Romanick) 4365bd8deadSopenharmony_ci After reading the manual page for glBindAttribLocation, added a 4375bd8deadSopenharmony_ci resolution for issue #2. 4385bd8deadSopenharmony_ci 4395bd8deadSopenharmony_ci (v2, 2009-02-11, Ian Romanick) 4405bd8deadSopenharmony_ci Modified to use the layout keyword from uniform blocks instead 4415bd8deadSopenharmony_ci of the unusual array-subscript syntax previously proposed. 4425bd8deadSopenharmony_ci Updated issue #1. 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci (v1, 2009-01-23, Ian Romanick) 4455bd8deadSopenharmony_ci Initial version. 446