15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_shader_atomic_counters
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_shader_atomic_counters
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Bill Licea-Kane ( bill.licea-kane 'at' amd.com )
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Barthold Lichtenbelt, NVIDIA
165bd8deadSopenharmony_ci    Chris Dodd, NVIDIA
175bd8deadSopenharmony_ci    Eric Werness, NVIDIA
185bd8deadSopenharmony_ci    Graham Sellers, AMD
195bd8deadSopenharmony_ci    Greg Roth, NVIDIA
205bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
215bd8deadSopenharmony_ci    Nick Haemel, AMD
225bd8deadSopenharmony_ci    Pat Brown, NVIDIA
235bd8deadSopenharmony_ci    Pierre Boudier, AMD
245bd8deadSopenharmony_ci    Piers Daniell, NVIDIA
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNotice
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at
295bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciSpecification Update Policy
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
345bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
355bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
365bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
375bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
385bd8deadSopenharmony_ci    described in more detail at
395bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciStatus
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    Complete. Approved by the ARB on 2011/06/20.
445bd8deadSopenharmony_ci    Approved by the Khronos Promoters on 2011/07/29.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciVersion
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    Last Modified Date: July 30, 2012
495bd8deadSopenharmony_ci    Author Revision: 31
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciNumber
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    ARB Extension #114
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciDependencies
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.1 (core) specification
585bd8deadSopenharmony_ci    and the GLSL 4.10.6 specification.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    OpenGL 3.0 is required.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciOverview
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    This extension provides a set of atomic counters.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    This extension provides GLSL built-in functions to
685bd8deadSopenharmony_ci    query and increment/decrement these atomic counters.
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    This enables a shader to write to unique offsets
715bd8deadSopenharmony_ci    (append to a buffer object) or read from unique offsets
725bd8deadSopenharmony_ci    (consume from a buffer object).
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    Opaque handles to atomic counters are declared
755bd8deadSopenharmony_ci    at global scope and are qualified with the uniform qualifier.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    Unlike other user-defined uniforms declared at global scope,
785bd8deadSopenharmony_ci    they take NO storage from the default partition, they have
795bd8deadSopenharmony_ci    NO location, and they may NOT be set with the Uniform* commands.
805bd8deadSopenharmony_ci    Atomic counters may also NOT be grouped into uniform blocks.
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    Active atomic counters can be discovered by the commands
835bd8deadSopenharmony_ci    GetUniformIndices, GetActiveUniformName, GetActiveUniform
845bd8deadSopenharmony_ci    and GetActiveUniformsiv.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    Like samplers, the opaque handles of the atomic counters
875bd8deadSopenharmony_ci    and are ONLY used in some GLSL built-in functions.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    The atomic counters pointed to by the opaque handles
905bd8deadSopenharmony_ci    are bound to buffer binding points and buffer offsets
915bd8deadSopenharmony_ci    through the layout qualifiers in the shading language,
925bd8deadSopenharmony_ci    or they are implicitly assigned by the compiler.
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    Through the OpenGL API, buffer objects may be
955bd8deadSopenharmony_ci    bound to these binding points with BindBufferBase
965bd8deadSopenharmony_ci    or BindBufferRange.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    The contents of the atomic counters are stored
995bd8deadSopenharmony_ci    in the buffer objects.  The contents of atomic
1005bd8deadSopenharmony_ci    counters may be set and queried with buffer object
1015bd8deadSopenharmony_ci    manipulation functions (e.g. BufferData,
1025bd8deadSopenharmony_ci    BufferSubData, MapBuffer or MapBufferRange).
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciIP Status
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    No known IP claims.
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciNew Procedures and Functions
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    void GetActiveAtomicCounterBufferiv 
1125bd8deadSopenharmony_ci      (uint program, uint bufferIndex, enum pname, int *params);
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciNew Types
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    None.
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ciNew Tokens
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    Accepted by the <target> parameter of BindBufferBase and BindBufferRange:
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci        ATOMIC_COUNTER_BUFFER                           0x92C0
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleani_v, GetIntegeri_v,
1255bd8deadSopenharmony_ci    GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv,
1265bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv:
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_BINDING                    0x92C1
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetIntegeri_64v:
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_START                      0x92C2
1335bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_SIZE                       0x92C3
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetActiveAtomicCounterBufferiv:
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_DATA_SIZE                  0x92C4
1385bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS     0x92C5
1395bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES        0x92C6
1405bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER          0x92C7
1415bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER    0x92C8
1425bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
1435bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER        0x92CA
1445bd8deadSopenharmony_ci       ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER        0x92CB
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1475bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, and GetDoublev:
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci       MAX_VERTEX_ATOMIC_COUNTER_BUFFERS                0x92CC
1505bd8deadSopenharmony_ci       MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS          0x92CD
1515bd8deadSopenharmony_ci       MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS       0x92CE
1525bd8deadSopenharmony_ci       MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS              0x92CF
1535bd8deadSopenharmony_ci       MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS              0x92D0
1545bd8deadSopenharmony_ci       MAX_COMBINED_ATOMIC_COUNTER_BUFFERS              0x92D1
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci       MAX_VERTEX_ATOMIC_COUNTERS                       0x92D2
1575bd8deadSopenharmony_ci       MAX_TESS_CONTROL_ATOMIC_COUNTERS                 0x92D3
1585bd8deadSopenharmony_ci       MAX_TESS_EVALUATION_ATOMIC_COUNTERS              0x92D4
1595bd8deadSopenharmony_ci       MAX_GEOMETRY_ATOMIC_COUNTERS                     0x92D5
1605bd8deadSopenharmony_ci       MAX_FRAGMENT_ATOMIC_COUNTERS                     0x92D6
1615bd8deadSopenharmony_ci       MAX_COMBINED_ATOMIC_COUNTERS                     0x92D7
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci       MAX_ATOMIC_COUNTER_BUFFER_SIZE                   0x92D8
1645bd8deadSopenharmony_ci       MAX_ATOMIC_COUNTER_BUFFER_BINDINGS               0x92DC
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramiv:
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci       ACTIVE_ATOMIC_COUNTER_BUFFERS                    0x92D9
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetActiveUniformsiv:
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci       UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX              0x92DA
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    Returned in <params> by GetActiveUniform and GetActiveUniformsiv:
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci       UNSIGNED_INT_ATOMIC_COUNTER                      0x92DB
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.1 (Core Profile) Specification
1805bd8deadSopenharmony_ci(OpenGL Operation)
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ciChanges to Section 2.9 Buffer Objects
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ciAdd to table 2.8 (p. 41)
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    Target Name                Purpose              Described in section(s)
1875bd8deadSopenharmony_ci    ---------------------  ----------------------   -----------------------
1885bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER  Atomic counter storage          2.11.8
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ciChanges to Section Binding Buffer Objects to Indexed Targets
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ciChange end of first sentence in section, p. 42
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci    ...target must be ATOMIC_COUNTER_BUFFER, TRANSFORM_FEEDBACK_BUFFER
1955bd8deadSopenharmony_ci    or UNIFORM_BUFFER.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci2.11.7 Uniform Variables
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ciReplace third sentence of paragraph one in the section, p. 72
2005bd8deadSopenharmony_cibeginning with "Uniforms are program..."
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    Uniforms, except for subroutine uniforms, are program...
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ciReplace first sentence of paragraph two in the section, p. 72
2055bd8deadSopenharmony_cibeginning with "Sets of uniforms can be..."
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    Sets of uniforms, except for samplers, subroutine uniforms and
2085bd8deadSopenharmony_ci    atomic counters, can be grouped into <uniform blocks>.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ciModify first sentence of first paragraph, p. 73
2115bd8deadSopenharmony_cibeginning with "The amount of storage..."
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    The amount of storage available for uniform variables,
2145bd8deadSopenharmony_ci    except for subroutine uniforms and atomic counters,
2155bd8deadSopenharmony_ci    in the default uniform block...
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ciModify first sentence of second paragraph, p. 73
2185bd8deadSopenharmony_cibeginning with "When a program..."
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    When a program is successfully linked, all active
2215bd8deadSopenharmony_ci    uniforms, except for atomic counters, ...
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ciInsert a pragraph prior to third paragraph, p. 73
2245bd8deadSopenharmony_cibeginning with "Similary, when a program..."
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    Similarly, when a program is successfully linked,
2275bd8deadSopenharmony_ci    all active atomic counters are assigned bindings,
2285bd8deadSopenharmony_ci    offsets (and strides for arrays of atomic counters)
2295bd8deadSopenharmony_ci    according to layout rules described below.  Atomic
2305bd8deadSopenharmony_ci    counter uniform buffer objects provide the storage for
2315bd8deadSopenharmony_ci    atomic counters, so the values of atomic counters
2325bd8deadSopenharmony_ci    may be changed by modifying the contents of the
2335bd8deadSopenharmony_ci    buffer object using commands such as BufferData,
2345bd8deadSopenharmony_ci    BufferSubData, MapBuffer, and UnmapBuffer.  Atomic
2355bd8deadSopenharmony_ci    counters are not assigned a location and may not be
2365bd8deadSopenharmony_ci    modified using the Uniform* commands.  The bindings,
2375bd8deadSopenharmony_ci    offsets, and strides belonging to atomic counters
2385bd8deadSopenharmony_ci    of a program object are invalidated and new ones
2395bd8deadSopenharmony_ci    assigned after each successful re-link.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ciModify the final line on paragraph continuing on p. 74
2435bd8deadSopenharmony_ciending "or if <name> is associated with a named uniform block."
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    ... if <name> is associated with an atomic counter,
2465bd8deadSopenharmony_ci    or if <name> is associated with a named uniform block.
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ciInsert section prior to the last paragraph on p. 76,
2495bd8deadSopenharmony_cibegining with "Each active uniform, whether in a named..."
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci    In programs with active atomic counter uniforms, each buffer object
2525bd8deadSopenharmony_ci    binding point associated with one or more active atomic counters is
2535bd8deadSopenharmony_ci    considered an active atomic counter buffer.  Information about the set of
2545bd8deadSopenharmony_ci    active atomic counter buffers for a program can be obtained by calling
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci      void GetActiveAtomicCounterBufferiv 
2575bd8deadSopenharmony_ci        ( uint program, uint bufferIndex, enum pname, int *params );
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci    <program> is the name of a program object for which the
2605bd8deadSopenharmony_ci    command LinkProgram has been issued in the past. It is
2615bd8deadSopenharmony_ci    not necessary for <program> to have been linked successfully.
2625bd8deadSopenharmony_ci    The link could have failed because the number of active
2635bd8deadSopenharmony_ci    active atomic counters exceeded implementation-dependent limits.
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    <bufferIndex> specifies the index of an active atomic counter buffer and
2665bd8deadSopenharmony_ci    must be in the range zero to the value of ACTIVE_ATOMIC_COUNTER_BUFFERS-1.
2675bd8deadSopenharmony_ci    The value of ACTIVE_ATOMIC_COUNTER_BUFFERS for <program> indicates the
2685bd8deadSopenharmony_ci    number of active atomic counter buffers and can be queried with
2695bd8deadSopenharmony_ci    GetProgramiv (see section 6.1.12).  If <bufferIndex> is greater than or
2705bd8deadSopenharmony_ci    equal to the value of ACTIVE_ATOMIC_COUNTER_BUFFERS, the error
2715bd8deadSopenharmony_ci    INVALID_VALUE is generated.
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ci    If no error occurs, the parameter(s) specified by <pname> are
2745bd8deadSopenharmony_ci    returned in <params>. Otherwise, nothing will be written to
2755bd8deadSopenharmony_ci    <params>.
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci    If <pname> is ATOMIC_COUNTER_BUFFER_BINDING, then the index of the atomic
2785bd8deadSopenharmony_ci    counter buffer binding point associated with the active atomic counter
2795bd8deadSopenharmony_ci    buffer <bufferIndex> for <program> is returned.
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci    If <pname> is ATOMIC_COUNTER_BUFFER_DATA_SIZE, then the
2825bd8deadSopenharmony_ci    implementation-dependent minimum total buffer object size, in
2835bd8deadSopenharmony_ci    basic machine units, required to hold all active atomic counters
2845bd8deadSopenharmony_ci    in the atomic counter buffer identified by
2855bd8deadSopenharmony_ci    <bufferIndex> is returned.
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci    The total amount of buffer object storage accessible in any 
2885bd8deadSopenharmony_ci    given atomic counter buffer is subject to an implementation-dependent 
2895bd8deadSopenharmony_ci    limit. The maximum amount of storage accessible to atomic counters,
2905bd8deadSopenharmony_ci    in basic machine units, can be queried by calling GetIntegerv with the constant 
2915bd8deadSopenharmony_ci    MAX_ATOMIC_COUNTER_BUFFER_SIZE. If the amount of storage required for a
2925bd8deadSopenharmony_ci    atomic counter buffer exceeds this limit, a program may fail 
2935bd8deadSopenharmony_ci    to link.
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    If <pname> is ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS, then the
2965bd8deadSopenharmony_ci    number of active atomic counter variables associated with the atomic
2975bd8deadSopenharmony_ci    counter buffer identified by <bufferIndex> is returned.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci    If <pname> is ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES,
3005bd8deadSopenharmony_ci    then a list of the active atomic counter indices for the atomic counter
3015bd8deadSopenharmony_ci    buffer identified by <bufferIndex> is returned. The number of
3025bd8deadSopenharmony_ci    elements that will be written to <params> is the value of
3035bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS for <bufferIndex>.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    If <pname> is ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER,
3065bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER,
3075bd8deadSopenharmony_ci    UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER,
3085bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER, or
3095bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER, then a boolean
3105bd8deadSopenharmony_ci    value indicating whether the atomic counter buffer identified by
3115bd8deadSopenharmony_ci    <bufferIndex> is referenced by the vertex, tessellation control,
3125bd8deadSopenharmony_ci    tessellation evaluation, geometry, or fragment programming stages of
3135bd8deadSopenharmony_ci    <program>, respectively, is returned."
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ciModify first sentence of last paragraph on p. 76,
3165bd8deadSopenharmony_cibeginning with "Each active uniform, whether in a named..."
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    Each active uniform, except for subroutine uniforms,
3195bd8deadSopenharmony_ci    whether in a the default block, in a named uniform block, or
3205bd8deadSopenharmony_ci    an atomic counter...
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ciModify first sentence of the fourth paragraph on p. 77
3235bd8deadSopenharmony_cibeginning with "The name of an active..."
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    The name of an active uniform, except for subroutine
3265bd8deadSopenharmony_ci    uniforms, may be querried...
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ciReplace the last paragraph on p. 77
3305bd8deadSopenharmony_cibeginning with "Each uniform variable..."
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci    Each active uniform variable, except subroutine uniforms, 
3335bd8deadSopenharmony_ci    is broken down into one or more strings using the "." (dot) 
3345bd8deadSopenharmony_ci    and "[]" operators, if necessary, to the point that it is 
3355bd8deadSopenharmony_ci    legal to pass each string back into GetUniformIndices.
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ciModify first sentence of first paragraph on p. 78
3385bd8deadSopenharmony_cibeginning with "Information about active uniforms..."
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    Information about active uniforms, except for
3415bd8deadSopenharmony_ci    subroutine uniforms, can be...
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ciReplace the fourth paragraph on p. 78
3445bd8deadSopenharmony_cibeginning with "Each uniform variable..."
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci    Each active uniform variable, except subroutine uniforms, 
3475bd8deadSopenharmony_ci    is broken down into one or more strings using the "." (dot) 
3485bd8deadSopenharmony_ci    and "[]" operators, if necessary, to the point that it is 
3495bd8deadSopenharmony_ci    legal to pass each string back into GetUniformIndices.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ciModify the last paragraph 
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ciAdd to Table 2.13, p. 81
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    Type Name Token              Keyword      Attrib  Xfb
3565bd8deadSopenharmony_ci    ---------------------------  -----------  ------  ---
3575bd8deadSopenharmony_ci    UNSIGNED_INT_ATOMIC_COUNTER  atomic_uint         
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ciModify description of UNIFORM_OFFSET query in GetActiveUniformsiv, p. 82
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    If <pname> is UNIFORM_OFFSET, then an array of buffer offsets is returned.
3625bd8deadSopenharmony_ci    For uniforms in a named uniform block, the returned value will be its
3635bd8deadSopenharmony_ci    offset, in basic machine units, relative to the beginning of the uniform
3645bd8deadSopenharmony_ci    block in the buffer object data store.  For atomic counter uniforms, the
3655bd8deadSopenharmony_ci    returned value will be its offset relative to the beginning of its active
3665bd8deadSopenharmony_ci    atomic counter buffer.  For all other uniforms, an offset of -1 will be
3675bd8deadSopenharmony_ci    returned.
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci    If <pname> is UNIFORM_ARRAY_STRIDE, then an array of strides between array
3705bd8deadSopenharmony_ci    elements in buffer object storage is returned.  For uniforms in named
3715bd8deadSopenharmony_ci    uniform blocks and for uniforms declared as atomic counters, the stride is
3725bd8deadSopenharmony_ci    the difference, in basic machine units, of the offsets of consecutive
3735bd8deadSopenharmony_ci    elements in an array, or zero for uniforms not declared as an array.  For
3745bd8deadSopenharmony_ci    all other uniforms, a stride of -1 will be returned.
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ciAdd prior to "Loading Uniform Values In The Default Uniform Block", p. 83
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci    If <pname> is UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX, then an array
3795bd8deadSopenharmony_ci    identifying the active atomic counter buffer index of each of the uniforms
3805bd8deadSopenharmony_ci    specified by the corresponding array of <uniformIndices> is returned.  For
3815bd8deadSopenharmony_ci    uniforms other than atomic counters, the returned buffer index is -1.  The
3825bd8deadSopenharmony_ci    returned indices can be passed to GetActiveAtomicCounterBufferiv to query
3835bd8deadSopenharmony_ci    properties of the associated buffer, and not necessarily the binding point
3845bd8deadSopenharmony_ci    specified in the uniform declaration.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ciModify first sentence of first new paragraph on p. 83
3875bd8deadSopenharmony_cibeginning with "To load values into the uniform variables..."
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    To load values into the uniform variables of the default uniform block
3905bd8deadSopenharmony_ci    of the active program object, except for subroutine uniforms and atomic
3915bd8deadSopenharmony_ci    counters, ..."
3925bd8deadSopenharmony_ci 
3935bd8deadSopenharmony_ciModify first sentence of the fifth paragraph on p. 84
3945bd8deadSopenharmony_cibeginning with "For all other uniform types..."
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    For all other uniform types, except for subroutine
3975bd8deadSopenharmony_ci    uniforms and atomic counters, ...
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ciAdd new unnumbered subsections at the end of the section, p. 90
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    Atomic Counter Buffers
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    The values of atomic counters are backed by buffer object storage.
4055bd8deadSopenharmony_ci    The mechanisms for accessing individual atomic counters in a buffer object
4065bd8deadSopenharmony_ci    and connecting to an atomic counter are described in this section.
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    There is a set of implementation-dependent maximums for the number
4095bd8deadSopenharmony_ci    of active atomic counter buffers referenced by each shader. If the
4105bd8deadSopenharmony_ci    number of atomic counter buffers referenced by any shader in the program
4115bd8deadSopenharmony_ci    exceeds its corresponding limit, the program will fail to link. The limits
4125bd8deadSopenharmony_ci    for vertex, tessellation control, tessellation evaluation, geometry, and
4135bd8deadSopenharmony_ci    fragment shaders can be obtained by calling GetIntegerv with pname values
4145bd8deadSopenharmony_ci    of MAX_VERTEX_ATOMIC_COUNTER_BUFFERS, MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS,
4155bd8deadSopenharmony_ci    MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS, MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS,
4165bd8deadSopenharmony_ci    or MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, respectively.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    Additionally, there is an implementation-dependent limit on the sum of the
4195bd8deadSopenharmony_ci    number of active atomic counter buffers used by each shader of a
4205bd8deadSopenharmony_ci    program. If an atomic counter buffer is used by multiple shaders,
4215bd8deadSopenharmony_ci    each such use counts separately against this combined limit. The combined 
4225bd8deadSopenharmony_ci    atomic counter buffer use limit can be obtained by calling
4235bd8deadSopenharmony_ci    GetIntegerv with a <pname> of MAX_COMBINED_ATOMIC_COUNTER_BUFFERS.
4245bd8deadSopenharmony_ci    
4255bd8deadSopenharmony_ci    Atomic Counter Buffer Object Storage
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci    Atomic counters stored in buffer objects are represented in memory
4285bd8deadSopenharmony_ci    as follows:
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci    * Members of type atomic_uint are extracted from a buffer object by
4315bd8deadSopenharmony_ci    reading a single uint-typed value at the specified offset.
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    * Arrays of type atomic_uint are stored in memory by element order,
4345bd8deadSopenharmony_ci    with array element member zero at the lowest offset.  The difference
4355bd8deadSopenharmony_ci    in offsets between each pair of elements in the array in basic machine
4365bd8deadSopenharmony_ci    units is referred to as the array stride, and is constant across the
4375bd8deadSopenharmony_ci    entire array.  The stride can be queried by calling GetIntegerv with
4385bd8deadSopenharmony_ci    a <pname> of UNIFORM_ARRAY_STRIDE after a program is linked.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    Atomic Counter Buffer Bindings
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    The value of an active atomic counter is extracted from or written to the
4435bd8deadSopenharmony_ci    data store of a buffer object bound to one of an array of atomic counter
4445bd8deadSopenharmony_ci    buffer binding points. The number of binding points can be queried by
4455bd8deadSopenharmony_ci    calling GetIntegerv with a <pname> of MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    Regions of buffer objects are bound as storage for atomic counters by calling
4485bd8deadSopenharmony_ci    one of the commands BindBufferRange or BindBufferBase (see section 2.9.1)
4495bd8deadSopenharmony_ci    with <target> set to ATOMIC_COUNTER_BUFFER. In addition to the general errors 
4505bd8deadSopenharmony_ci    described in section 2.9.1, BindBufferBase and BindBufferRange will generate an INVALID_VALUE
4515bd8deadSopenharmony_ci    error if <index> is greater than or equal to the value of MAX_ATOMIC_COUNTER_BUFFER_BINDINGS,
4525bd8deadSopenharmony_ci    and BindBufferRange will generate an INVALID_VALUE error if <offset> is
4535bd8deadSopenharmony_ci    not a multiple of four.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci    Each of a program's active atomic counter buffer bindings has a corresponding 
4565bd8deadSopenharmony_ci    atomic counter buffer binding point. This binding point is established
4575bd8deadSopenharmony_ci    with the layout qualifier in the shader text, either explicitly or implicitly,
4585bd8deadSopenharmony_ci    as described in the Shading Language specification.
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci    When executing shaders that access atomic counters, each active atomic
4615bd8deadSopenharmony_ci    counter buffer must be populated with a buffer object with a size no
4625bd8deadSopenharmony_ci    smaller than the minimum required size for that buffer (the value of
4635bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_DATA_SIZE).  For binding points populated by
4645bd8deadSopenharmony_ci    BindBufferRange, the size in question is the value of the <size>
4655bd8deadSopenharmony_ci    parameter.  If any active atomic counter buffer is not backed by a
4665bd8deadSopenharmony_ci    sufficiently large buffer object, the results of shader execution are
4675bd8deadSopenharmony_ci    undefined, and may result in GL interruption or termination.
4685bd8deadSopenharmony_ci
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ciAdd to Section 2.11.11 Shader Execution, p. 102, inserting before Shader Inputs
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ciAtomic Counter Access
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci    Shaders have the ability to set and get atomic counters.  The maximum number
4755bd8deadSopenharmony_ci    of atomic counters available to shaders are the values of the implementation
4765bd8deadSopenharmony_ci    dependent constants
4775bd8deadSopenharmony_ci
4785bd8deadSopenharmony_ci    * MAX_VERTEX_ATOMIC_COUNTERS (for vertex shaders),
4795bd8deadSopenharmony_ci    * MAX_TESS_CONTROL_ATOMIC_COUNTERS (for tessellation control shaders),
4805bd8deadSopenharmony_ci    * MAX_TESS_EVALUATION_ATOMIC_COUNTERS (for tessellation evaluation shaders),
4815bd8deadSopenharmony_ci    * MAX_GEOMETRY_ATOMIC_COUNTERS (for geometry shaders), and
4825bd8deadSopenharmony_ci    * MAX_FRAGMENT_ATOMIC_COUNTERS (for fragment shaders).
4835bd8deadSopenharmony_ci
4845bd8deadSopenharmony_ci   All active shaders combined cannot use more than the value of
4855bd8deadSopenharmony_ci   MAX_COMBINED_ATOMIC_COUNTERS atomic counters. If more than one
4865bd8deadSopenharmony_ci   pipeline stage accesses the same atomic counter, each such
4875bd8deadSopenharmony_ci   access counts separately against the MAX_COMBINED_ATOMIC_COUNTERS limit.
4885bd8deadSopenharmony_ci
4895bd8deadSopenharmony_ci    
4905bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.1 (Core Profile) Specification
4915bd8deadSopenharmony_ci(State and State Requests)
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ciAdd to the end of section 6.1.8 (Buffer Object Queries) 
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci    To query which buffer objects are bound to the array of transform
4965bd8deadSopenharmony_ci    feedback binding points and will be used when transform feedback is
4975bd8deadSopenharmony_ci    active, call GetIntegeri\_v with <param> set to
4985bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_BUFFER_BINDING. <index> must be in the range zero to
4995bd8deadSopenharmony_ci    the value of MAX_TRANSFORM_FEEDBACK_BUFFERS minus one. The name of the
5005bd8deadSopenharmony_ci    buffer object bound to <index> is returned in <values>. If no buffer
5015bd8deadSopenharmony_ci    object is bound for <index>, zero is returned in <values>. The error
5025bd8deadSopenharmony_ci    INVALID_VALUE is generated if <index> is greater than or equal to the
5035bd8deadSopenharmony_ci    value of MAX_TRANSFORM_FEEDBACK_BUFFERS.
5045bd8deadSopenharmony_ci    
5055bd8deadSopenharmony_ci    To query the starting offset or size of the range of each buffer object
5065bd8deadSopenharmony_ci    binding used for transform feedback, call GetInteger64i_v with <param>
5075bd8deadSopenharmony_ci    set to TRANSFORM_FEEDBACK_BUFFER_START or TRANSFORM_FEEDBACK_BUFFER_SIZE
5085bd8deadSopenharmony_ci    respectively. <index> must be in the range 0 to the value of
5095bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS minus one. If the parameter (starting
5105bd8deadSopenharmony_ci    offset or size) was not specified when the buffer object was bound (e.g.
5115bd8deadSopenharmony_ci    if bound with BindBufferBase), or if no buffer object is bound to
5125bd8deadSopenharmony_ci    <index>, zero is returned. The error INVALID_VALUE is generated if
5135bd8deadSopenharmony_ci    <index> is greater than or equal to the value of
5145bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS}.
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ciAdd to Section 6.1.12, immediately before the description of IsProgramPipeline
5175bd8deadSopenharmony_ci(p. 335)
5185bd8deadSopenharmony_ci
5195bd8deadSopenharmony_ci    If <pname> is ACTIVE_ATOMIC_COUNTER_BUFFERS, the number of active atomic
5205bd8deadSopenharmony_ci    counter buffers used by <program> is returned.
5215bd8deadSopenharmony_ci
5225bd8deadSopenharmony_ciAdditions to Appendix A (Invariance)
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ciAdd additional sentence to A.3 Invariance Rules, Rule 4 (p. 399)
5255bd8deadSopenharmony_ci
5265bd8deadSopenharmony_ci    Invariance is relaxed for shaders with side effects (such
5275bd8deadSopenharmony_ci    as accessing atomic counters), see A.5, Atomic Counter Invariance.
5285bd8deadSopenharmony_ci
5295bd8deadSopenharmony_ciAdd A.5 Atomic Counter Invariance
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci    When using a program containing atomic counters, the following
5325bd8deadSopenharmony_ci    invariance rules are intended to provide repeatability guarantees
5335bd8deadSopenharmony_ci    but within certain constraints.
5345bd8deadSopenharmony_ci
5355bd8deadSopenharmony_ci    Rule 1  When a single shader type within a program accesses
5365bd8deadSopenharmony_ci    an atomic counter with only atomicCounterIncrement, any individual
5375bd8deadSopenharmony_ci    shader invocation is guaranteed to get a unique value returned.
5385bd8deadSopenharmony_ci
5395bd8deadSopenharmony_ci    Corollary 1 - Also holds true with atomicCounterDecrement.
5405bd8deadSopenharmony_ci
5415bd8deadSopenharmony_ci    Corollary 2 - This does not hold true for atomicCounter
5425bd8deadSopenharmony_ci
5435bd8deadSopenharmony_ci    Corollary 3 - Repeatability is relaxed.  While a unique
5445bd8deadSopenharmony_ci    value is returned to the shader, even given the same
5455bd8deadSopenharmony_ci    initial state vector and buffer contents, it is not guaranteed
5465bd8deadSopenharmony_ci    that the *SAME* unique value will be returned for each individual
5475bd8deadSopenharmony_ci    invocation of a shader (For example, on any single vertex, or
5485bd8deadSopenharmony_ci    any single fragment).  It is wholly the shader writer's
5495bd8deadSopenharmony_ci    responsibility to respect this constraint.
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci    Rule 2  When two or more shader types within a program
5525bd8deadSopenharmony_ci    access an atomic counter with only atomicCounterIncrement,
5535bd8deadSopenharmony_ci    there is no repeatability of the ordering of operations between
5545bd8deadSopenharmony_ci    stages.  For example, some number of vertices may be processed,
5555bd8deadSopenharmony_ci    then some number of fragments may be processed.
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci    Corollary 4 - This also holds true with atomicCounterDecrement
5585bd8deadSopenharmony_ci    and atomicCounter.
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ciAdditions to Appendix D (Shared Objects and Multiple Contexts)
5615bd8deadSopenharmony_ci
5625bd8deadSopenharmony_ciModify D.3 (Propagating State Changes)
5635bd8deadSopenharmony_ci
5645bd8deadSopenharmony_ci    (add to list of bullets at the end of the section, p. 467)
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ci    * Rendering commands that trigger shader invocations, where
5675bd8deadSopenharmony_ci      the shader performs built-in atomic counter functions.
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ciNew State
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ciAdd new table, labeled "Program Object State (cont.)" after Table 6.36, p. 377
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci                                                             Initial
5745bd8deadSopenharmony_ci    Get Value                         Type  Get Command      Value    Description                Sec.
5755bd8deadSopenharmony_ci    -----------------------           ----  -----------      -------  ------------------------   -----
5765bd8deadSopenharmony_ci    ACTIVE_ATOMIC_COUNTER_BUFFERS     Z+    GetProgramiv     0        Number of active atomic    2.11.7
5775bd8deadSopenharmony_ci                                                                      counter buffers used
5785bd8deadSopenharmony_ci                                                                      by a program
5795bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_BINDING     nxZ+  GetActiveAtomic- -        Binding point associated   2.11.7
5805bd8deadSopenharmony_ci                                            CounterBufferiv           with an active atomic
5815bd8deadSopenharmony_ci                                                                      counter buffer
5825bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_DATA_SIZE   nxZ+  GetActiveAtomic- -        Minimum size required by   2.11.7
5835bd8deadSopenharmony_ci                                            CounterBufferiv           an active atomic counter
5845bd8deadSopenharmony_ci                                                                      buffer
5855bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_ACTIVE_     nxZ+  GetActiveAtomic- -        Number of active atomic    2.11.7
5865bd8deadSopenharmony_ci      ATOMIC_COUNTERS                       CounterBufferiv           counters in an active
5875bd8deadSopenharmony_ci                                                                      atomic counter buffer
5885bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_ACTIVE_    mxnxZ+ GetActiveAtomic- -        List of active atomic      2.11.7
5895bd8deadSopenharmony_ci      ATOMIC_COUNTER_INDICES                CounterBufferiv           counters in an active
5905bd8deadSopenharmony_ci                                                                      atomic counter buffer
5915bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_            nxB   GetActiveAtomic- FALSE    Active atomic counter      2.11.7
5925bd8deadSopenharmony_ci      REFERENCED_BY_VERTEX                  CounterBufferiv           buffer has a counter used
5935bd8deadSopenharmony_ci      SHADER                                                          by vertex shaders
5945bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_            nxB   GetActiveAtomic- FALSE    Active atomic counter      2.11.7
5955bd8deadSopenharmony_ci      REFERENCED_BY_TESS_CONTROL            CounterBufferiv           buffer has a counter used
5965bd8deadSopenharmony_ci      SHADER                                                          by tess. control shaders
5975bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_            nxB   GetActiveAtomic- FALSE    Active atomic counter      2.11.7
5985bd8deadSopenharmony_ci      REFERENCED_BY_TESS_EVALUTION          CounterBufferiv           buffer has a counter used
5995bd8deadSopenharmony_ci      SHADER                                                          by tess. evaluation shaders
6005bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_            nxB   GetActiveAtomic- FALSE    Active atomic counter      2.11.7
6015bd8deadSopenharmony_ci      REFERENCED_BY_GEOMETRY                CounterBufferiv           buffer has a counter used
6025bd8deadSopenharmony_ci      SHADER                                                          by geometry shaders
6035bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_            nxB   GetActiveAtomic- FALSE    Active atomic counter      2.11.7
6045bd8deadSopenharmony_ci      REFERENCED_BY_FRAGMENT                CounterBufferiv           buffer has a counter used
6055bd8deadSopenharmony_ci      SHADER                                                          by fragment shaders
6065bd8deadSopenharmony_ci    UNIFORM_ATOMIC_COUNTER_BUFFER_    nxZ+  GetActive-       -        Active atomic counter      2.11.7
6075bd8deadSopenharmony_ci      INDEX                                 Uniformsiv                buffer associated with an
6085bd8deadSopenharmony_ci                                                                      active uniform
6095bd8deadSopenharmony_ci
6105bd8deadSopenharmony_ciAdd new table, labeled "Atomic Counter State", after Table 6.39, p. 380
6115bd8deadSopenharmony_ci
6125bd8deadSopenharmony_ci                                                             Initial
6135bd8deadSopenharmony_ci    Get Value                         Type  Get Command      Value    Description                Sec.
6145bd8deadSopenharmony_ci    -----------------------           ----  -----------      -------  ------------------------   -----
6155bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_BINDING     Z+    GetIntegerv      0        Current value of generic   2.9.9
6165bd8deadSopenharmony_ci                                                                      atomic counter buffer
6175bd8deadSopenharmony_ci                                                                      binding
6185bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_BINDING     n*Z+  GetIntegeri_v    0        Buffer object bound        2.9.9
6195bd8deadSopenharmony_ci                                                                      to each atomic counter
6205bd8deadSopenharmony_ci                                                                      buffer binding point
6215bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_START       n*Z+  GetInteger64i_v  0        Start offset of            2.9.9
6225bd8deadSopenharmony_ci                                                                      binding range for each
6235bd8deadSopenharmony_ci                                                                      atomic counter buffer
6245bd8deadSopenharmony_ci    ATOMIC_COUNTER_BUFFER_SIZE        n*Z+  GetInteger64i_v  0        Size of binding range for  2.9.9 
6255bd8deadSopenharmony_ci                                                                      each atomic counter buffer
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ciNew Implementation Dependent State
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ciAdd to Table 6.46, Implementation Dependent Vertex Shader Limits, p. 387:
6315bd8deadSopenharmony_ci
6325bd8deadSopenharmony_ci    Get Value                                  Type  Get Command    Minimum Value  Description                Sec. 
6335bd8deadSopenharmony_ci    -----------------------                    ----  -----------    -------------  -------------------------  -----
6345bd8deadSopenharmony_ci    MAX_VERTEX_ATOMIC_COUNTER_BUFFERS          Z+    GetIntegerv    0              Number of atomic counter   2.11.7
6355bd8deadSopenharmony_ci                                                                                   buffers accessed by a
6365bd8deadSopenharmony_ci                                                                                   vertex shader
6375bd8deadSopenharmony_ci    MAX_VERTEX_ATOMIC_COUNTERS                 Z+    GetIntegerv    0              Number of atomic counters  2.11.11
6385bd8deadSopenharmony_ci                                                                                   accessed by a vertex 
6395bd8deadSopenharmony_ci                                                                                   shader
6405bd8deadSopenharmony_ciAdd to Table 6.47, Implementation Dependent Tesselation Shader Limits, p. 388:
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    Get Value                                  Type  Get Command    Minimum Value  Description                Sec. 
6435bd8deadSopenharmony_ci    -----------------------                    ----  -----------    -------------  -------------------------  -----
6445bd8deadSopenharmony_ci    MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS    Z+    GetIntegerv    0              Number of atomic counter   2.11.7
6455bd8deadSopenharmony_ci                                                                                   buffers accessed by a 
6465bd8deadSopenharmony_ci                                                                                   tesselation control shader
6475bd8deadSopenharmony_ci    MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS Z+    GetIntegerv    0              Number of atomic counter   2.11.7
6485bd8deadSopenharmony_ci                                                                                   buffers accessed by a
6495bd8deadSopenharmony_ci                                                                                   tesselation evaluation shader
6505bd8deadSopenharmony_ci    MAX_TESS_CONTROL_ATOMIC_COUNTERS           Z+    GetIntegerv    0              Number of atomic counters  2.11.11
6515bd8deadSopenharmony_ci                                                                                   accessed by a tesselation
6525bd8deadSopenharmony_ci                                                                                   control shader
6535bd8deadSopenharmony_ci    MAX_TESS_EVALUATION_ATOMIC_COUNTERS        Z+    GetIntegerv    0              Number of atomic counters  2.11.11
6545bd8deadSopenharmony_ci                                                                                   accessed by a tesselation 
6555bd8deadSopenharmony_ci                                                                                   evaluation shader
6565bd8deadSopenharmony_ciAdd to Table 6.48, Implementation Dependent Geometry Shader Limits, p. 389:
6575bd8deadSopenharmony_ci
6585bd8deadSopenharmony_ci    Get Value                                  Type  Get Command    Minimum Value  Description                Sec. 
6595bd8deadSopenharmony_ci    -----------------------                    ----  -----------    -------------  -------------------------  -----
6605bd8deadSopenharmony_ci    MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS        Z+    GetIntegerv    0              Number of atomic counter   2.11.7
6615bd8deadSopenharmony_ci                                                                                   buffers accessed by a 
6625bd8deadSopenharmony_ci                                                                                   geometry shader
6635bd8deadSopenharmony_ci    MAX_GEOMETRY_ATOMIC_COUNTERS               Z+    GetIntegerv    0              Number of atomic counters  2.11.11
6645bd8deadSopenharmony_ci                                                                                   accessed by a geometry
6655bd8deadSopenharmony_ci                                                                                   shader
6665bd8deadSopenharmony_ciAdd to Table 6.49, Implementation Dependent Fragment Shader Limits, p. 390:
6675bd8deadSopenharmony_ci
6685bd8deadSopenharmony_ci    Get Value                                  Type  Get Command    Minimum Value  Description                Sec. 
6695bd8deadSopenharmony_ci    -----------------------                    ----  -----------    -------------  -------------------------  -----
6705bd8deadSopenharmony_ci    MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS        Z+    GetIntegerv    1              Number of atomic counter   2.11.7
6715bd8deadSopenharmony_ci                                                                                   buffers accessed by a
6725bd8deadSopenharmony_ci                                                                                   fragment shader 
6735bd8deadSopenharmony_ci    MAX_FRAGMENT_ATOMIC_COUNTERS               Z+    GetIntegerv    8              Number of atomic counters  2.11.11
6745bd8deadSopenharmony_ci                                                                                   accessed by a fragment
6755bd8deadSopenharmony_ci                                                                                   shader
6765bd8deadSopenharmony_ciAdd to Table 6.50 Implementation Dependent Aggregate Shader Limits, p. 391:
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci    Get Value                                  Type  Get Command    Minimum Value  Description                Sec. 
6795bd8deadSopenharmony_ci    -----------------------                    ----  -----------    -------------  -------------------------  -----
6805bd8deadSopenharmony_ci    MAX_ATOMIC_COUNTER_BUFFER_BINDINGS         Z+    GetIntegerv    1              Max. number of atomic      2.9.9
6815bd8deadSopenharmony_ci                                                                                   counter buffer bindings
6825bd8deadSopenharmony_ci    MAX_ATOMIC_COUNTER_BUFFER_SIZE             Z+    GetIntegerv    32
6835bd8deadSopenharmony_ci                                                                                   machine units of an
6845bd8deadSopenharmony_ci                                                                                   atomic counter buffer
6855bd8deadSopenharmony_ci    MAX_COMBINED_ATOMIC_COUNTER_BUFFERS        Z+    GetIntegerv    1              Max. number of atomic      2.11.7
6865bd8deadSopenharmony_ci                                                                                   counter buffers per 
6875bd8deadSopenharmony_ci                                                                                   program
6885bd8deadSopenharmony_ci    MAX_COMBINED_ATOMIC_COUNTERS               Z+    GetIntegerv    8              Max. number of atomic      2.11.11
6895bd8deadSopenharmony_ci                                                                                   counter uniforms per
6905bd8deadSopenharmony_ci                                                                                   program
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ci
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ciAdditions to the OpenGL Shading Langauge 4.10.6 Specification
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
6975bd8deadSopenharmony_ci    language features described in the extension:
6985bd8deadSopenharmony_ci
6995bd8deadSopenharmony_ci      #extension GL_ARB_shader_atomic_counters : <behavior>
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci    A new preprocessor #define is added to the OpenGL Shading Language:
7045bd8deadSopenharmony_ci
7055bd8deadSopenharmony_ci      #define GL_ARB_shader_atomic_counters 1
7065bd8deadSopenharmony_ci
7075bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL Shading Language 4.10.6 Specification
7085bd8deadSopenharmony_ci
7095bd8deadSopenharmony_ciAdd to 3.6 Keywords (pp. 13-15)
7105bd8deadSopenharmony_ci
7115bd8deadSopenharmony_ci    atomic_uint
7125bd8deadSopenharmony_ci
7135bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL Shading Language 4.10.6 Specification
7145bd8deadSopenharmony_ci
7155bd8deadSopenharmony_ciAdd to Section 4.1 Basic Types
7165bd8deadSopenharmony_ci
7175bd8deadSopenharmony_ci    Unsigned Integer Counter Types (opaque)
7185bd8deadSopenharmony_ci
7195bd8deadSopenharmony_ci    Type         Meaning
7205bd8deadSopenharmony_ci    atomic_uint  a handle for accessing an unsigned integer atomic counter
7215bd8deadSopenharmony_ci
7225bd8deadSopenharmony_ciInsert Section 4.1.8 Atomic Counters (existing 4.1.8 becomes 4.1.9, and so on)
7235bd8deadSopenharmony_ci
7245bd8deadSopenharmony_ci    4.1.8 Atomic Counters
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci    Atomic Counter types (e.g. atomic_uint) are effectively opaque handles to counters.
7275bd8deadSopenharmony_ci    They are used with the built-in atomic counter functions (described in section 8.10
7285bd8deadSopenharmony_ci    "Atomic Counter Functions") to specify which counter to access.  They can only be
7295bd8deadSopenharmony_ci    declared as function parameters or uniform-qualified global variables.
7305bd8deadSopenharmony_ci
7315bd8deadSopenharmony_ci    Except for array indexing, structure field selection, and parenthesis,
7325bd8deadSopenharmony_ci    counters are not allowed to be operands in expressions.  Counters aggregated into
7335bd8deadSopenharmony_ci    arrays within a shader (using square brackets []) can only be indexed with dynamically
7345bd8deadSopenharmony_ci    uniform integral expressions, otherwise results are undefined.  Counters cannot be
7355bd8deadSopenharmony_ci    treated as l-values; hence cannot be used as out or inout function parameters, nor
7365bd8deadSopenharmony_ci    can they be assigned into.
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci
7395bd8deadSopenharmony_ciModify last sentence of first paragraph of section 4.3.5, p. 36
7405bd8deadSopenharmony_cibeginning with "Sampler types cannot..."
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci    Sampler types and atomic counter types cannot..."
7435bd8deadSopenharmony_ci
7445bd8deadSopenharmony_ciInsert Section 4.3.6 Atomic Counters.  (Existing 4.3.6 becomes 4.3.7, and so on)
7455bd8deadSopenharmony_ci
7465bd8deadSopenharmony_ci    4.3.6  Uniform
7475bd8deadSopenharmony_ci
7485bd8deadSopenharmony_ci    The uniform qualifier is used to declare global opaque handles (to counters)
7495bd8deadSopenharmony_ci    where the handles are the same across the entire primitive being processed.
7505bd8deadSopenharmony_ci    All uniform variables are read-only and are initialized at link time.
7515bd8deadSopenharmony_ci
7525bd8deadSopenharmony_ci    It is an error to write to a uniform-qualified variable.
7535bd8deadSopenharmony_ci
7545bd8deadSopenharmony_ci    For example,
7555bd8deadSopenharmony_ci
7565bd8deadSopenharmony_ci        layout( binding=2, offset=0 ) uniform atomic_uint a;
7575bd8deadSopenharmony_ci
7585bd8deadSopenharmony_ci    will establish that the opaque handle to the atomic counter "a" 
7595bd8deadSopenharmony_ci    will be bound to atomic counter buffer binding 2 at offset 0.
7605bd8deadSopenharmony_ci
7615bd8deadSopenharmony_ci    There is an implementation dependent limit to the number of uniforms that
7625bd8deadSopenharmony_ci    can be used for each type of shader and if this is exceeded it will cause a 
7635bd8deadSopenharmony_ci    compile-time or link-time error.  Uniform variables that are declared but 
7645bd8deadSopenharmony_ci    not used may or may not count against this limit.
7655bd8deadSopenharmony_ci
7665bd8deadSopenharmony_ci    If multiple shaders are linked together, then they will share a single
7675bd8deadSopenharmony_ci    global uniform name space, including within the language as well as across
7685bd8deadSopenharmony_ci    languages.  Hence, the type of uniform variables with the
7695bd8deadSopenharmony_ci    same name must match across all shaders that are linked into a single program.
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci    It is legal for some shaders to provide a layout qualifier for a uniform
7725bd8deadSopenharmony_ci    variable of the same name, while another shader does not provide
7735bd8deadSopenharmony_ci    a layout qualifier for a uniform variable of the same name, but if provided,
7745bd8deadSopenharmony_ci    all provided layout qualifiers must be equal for a uniform variable of the
7755bd8deadSopenharmony_ci    same name, and if not provided, all implicitly provided layout qualifiers must
7765bd8deadSopenharmony_ci    be equal for a uniform variable of the same name.
7775bd8deadSopenharmony_ci
7785bd8deadSopenharmony_ci
7795bd8deadSopenharmony_ciAdd Section 4.3.8.4 Uniform Layout Qualifiers
7805bd8deadSopenharmony_ci
7815bd8deadSopenharmony_ci    Layout qualifiers can be used on uniform declarations.  The uniform qualifier
7825bd8deadSopenharmony_ci    identifiers for uniforms are
7835bd8deadSopenharmony_ci
7845bd8deadSopenharmony_ci    layout-qualifier-id
7855bd8deadSopenharmony_ci        binding = integer-constant
7865bd8deadSopenharmony_ci        offset = integer-constant
7875bd8deadSopenharmony_ci
7885bd8deadSopenharmony_ci    For example, 
7895bd8deadSopenharmony_ci
7905bd8deadSopenharmony_ci        layout(binding = 2, offset = 4) uniform atomic_uint foo;
7915bd8deadSopenharmony_ci
7925bd8deadSopenharmony_ci    will establish that the atomic counter foo has a binding to
7935bd8deadSopenharmony_ci    buffer binding point 2 and an offset of 4 basic machine units
7945bd8deadSopenharmony_ci    in that buffer.  The offset will be post-incremented by the
7955bd8deadSopenharmony_ci    size of the uniform (for atomic_uint, 4 basic machine units).
7965bd8deadSopenharmony_ci
7975bd8deadSopenharmony_ci    A subsequent uniform declaration will inherit the binding,
7985bd8deadSopenharmony_ci    and offset (perhaps post-incremented).  For example, a
7995bd8deadSopenharmony_ci    subsequent declaration of,
8005bd8deadSopenharmony_ci
8015bd8deadSopenharmony_ci         uniform atomic_uint bar;
8025bd8deadSopenharmony_ci
8035bd8deadSopenharmony_ci    will establish that the atomic counter bar has a binding to
8045bd8deadSopenharmony_ci    buffer binding point 2 and an offset of 8 basic machine units
8055bd8deadSopenharmony_ci    in that buffer.  The offset will be post-incremented by
8065bd8deadSopenharmony_ci    the size of the uniform (again, for atomic_uint, 4 basic
8075bd8deadSopenharmony_ci    machine units).
8085bd8deadSopenharmony_ci
8095bd8deadSopenharmony_ci    If the limit on the maximum number of bindings is exceeded,
8105bd8deadSopenharmony_ci    or if the limit of the maximum number of counters (either
8115bd8deadSopenharmony_ci    per shader type or combined) is exceeded, it will be a link
8125bd8deadSopenharmony_ci    error.
8135bd8deadSopenharmony_ci
8145bd8deadSopenharmony_ci    It is a compile error to bind an atomic counter with
8155bd8deadSopenharmony_ci    a value greater than or equal to gl_MaxAtomicCounterBindings.
8165bd8deadSopenharmony_ci
8175bd8deadSopenharmony_ciAdd Section 4.3.8.3 Uniform Layout Qualifiers prior to
8185bd8deadSopenharmony_ciexisting 4.3.8.3 Uniform Block Layout Qualifiers, and renumber
8195bd8deadSopenharmony_cisubsequent sections
8205bd8deadSopenharmony_ci
8215bd8deadSopenharmony_ci    Layout qualifiers can be used on uniform declarations.  The layout
8225bd8deadSopenharmony_ci    qualifiers identifiers for uniforms are
8235bd8deadSopenharmony_ci
8245bd8deadSopenharmony_ci    layout-qualifier-id
8255bd8deadSopenharmony_ci        binding = integer-constant
8265bd8deadSopenharmony_ci        offset = integer-constant
8275bd8deadSopenharmony_ci
8285bd8deadSopenharmony_ci    Uniform layout qualifiers can be declared for global scope or on a single
8295bd8deadSopenharmony_ci    uniform declaration.
8305bd8deadSopenharmony_ci
8315bd8deadSopenharmony_ci    Default layouts are established at global scope for uniforms as
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci        layout (layout-qualifier-id-list) uniform;
8345bd8deadSopenharmony_ci
8355bd8deadSopenharmony_ci    When this is done, the previous default qualification is first inherited and
8365bd8deadSopenharmony_ci    then overridden as per the override rules listed below.  The result becomes
8375bd8deadSopenharmony_ci    the new default qualification scoped to subsequent uniform block definitions.
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci    The initial state of compiliation is as if the following were declared:
8405bd8deadSopenharmony_ci
8415bd8deadSopenharmony_ci        layout(binding=0, offset=0) uniform;
8425bd8deadSopenharmony_ci
8435bd8deadSopenharmony_ci    Explicitly declaring this in a shader will return defaults back to their
8445bd8deadSopenharmony_ci    initial state.
8455bd8deadSopenharmony_ci
8465bd8deadSopenharmony_ci    Uniforms can be declared with optional layout qualifiers.  As with global
8475bd8deadSopenharmony_ci    layout declarations, uniform layout qualification first inherits from the
8485bd8deadSopenharmony_ci    current default qualification and then overrides it.
8495bd8deadSopenharmony_ci
8505bd8deadSopenharmony_ci    When multiple arguments are listed in a layout declaration, the affect will
8515bd8deadSopenharmony_ci    be the same as if they were declared one at a time, in order from left to
8525bd8deadSopenharmony_ci    right, each in turn inheriting from and overriding the result from the
8535bd8deadSopenharmony_ci    previous qualification.
8545bd8deadSopenharmony_ci
8555bd8deadSopenharmony_ci    For each uniform element, the then current default layout qualifiers will
8565bd8deadSopenharmony_ci    be applied, together with any prior post-increments of offset, if applicable,
8575bd8deadSopenharmony_ci    then the offset will be post-incremented by the size of the uniform, in
8585bd8deadSopenharmony_ci    basic machine units.
8595bd8deadSopenharmony_ci
8605bd8deadSopenharmony_ci    Uniforms may share the same binding, but if a binding is shared, each
8615bd8deadSopenharmony_ci    offset must be explicitly or implicitly unique.
8625bd8deadSopenharmony_ci
8635bd8deadSopenharmony_ci    For example a valid uniform declarations:
8645bd8deadSopenharmony_ci
8655bd8deadSopenharmony_ci    layout(binding=3, offset=4) uniform;
8665bd8deadSopenharmony_ci
8675bd8deadSopenharmony_ci    uniform atomic_uint                   thunderhead; // offset = 4
8685bd8deadSopenharmony_ci    uniform atomic_uint                   stratogirl;  // offset = 8
8695bd8deadSopenharmony_ci    layout(binding=3) uniform atomic_uint metalman;    // binding matches,
8705bd8deadSopenharmony_ci                                                       // offset = 12
8715bd8deadSopenharmony_ci    layout(offset=20) uniform atomic_uint dynaguy;     // offset = 20
8725bd8deadSopenharmony_ci    uniform atomic_uint                   splashdown;  // offset = 24
8735bd8deadSopenharmony_ci
8745bd8deadSopenharmony_ci
8755bd8deadSopenharmony_ci    Example of an invalid uniform declarations;
8765bd8deadSopenharmony_ci
8775bd8deadSopenharmony_ci    layout(binding=1, offset=0) batman;        // OK
8785bd8deadSopenharmony_ci    layout(binding=2, offset=0) robin;         // OK
8795bd8deadSopenharmony_ci    layout(binding=1, offset=0) catwoman;      // error, offsets
8805bd8deadSopenharmony_ci                                               // must not be shared
8815bd8deadSopenharmony_ci                                               // between batman and
8825bd8deadSopenharmony_ci                                               // catwoman
8835bd8deadSopenharmony_ci
8845bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL Shading Language 4.10.6 Specification
8855bd8deadSopenharmony_ci(Built-in Variables)
8865bd8deadSopenharmony_ci
8875bd8deadSopenharmony_ciAdd to Section 7.4, Built-In Constants
8885bd8deadSopenharmony_ci
8895bd8deadSopenharmony_ciconst int gl_MaxVertexAtomicCounters = 0;          // minimum maximum
8905bd8deadSopenharmony_ciconst int gl_MaxTessControlAtomicCounters = 0;     // minimum maximum
8915bd8deadSopenharmony_ciconst int gl_MaxTessEvaluationAtomicCounters = 0;  // minimum maximum
8925bd8deadSopenharmony_ciconst int gl_MaxGeometryAtomicCounters = 0;        // minimum maximum
8935bd8deadSopenharmony_ciconst int gl_MaxFragmentAtomicCounters = 8;        // minimum maximum
8945bd8deadSopenharmony_ciconst int gl_MaxCombinedAtomicCounters = 8;        // minimum maximum
8955bd8deadSopenharmony_ciconst int gl_MaxAtomicCounterBindings = 1;         // minimum maximum
8965bd8deadSopenharmony_ci
8975bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL Shading Language 1.50 Specification
8985bd8deadSopenharmony_ci(Built-in Functions)
8995bd8deadSopenharmony_ci
9005bd8deadSopenharmony_ciAdd Section 8.10  Atomic Counter Functions (existing 8.10 becomes 8.11, and so on)
9015bd8deadSopenharmony_ci
9025bd8deadSopenharmony_ci    8.10  Atomic Counter Functions
9035bd8deadSopenharmony_ci
9045bd8deadSopenharmony_ci    Atomic counter functions have exclusive access to any single counter, perform
9055bd8deadSopenharmony_ci    an atomic operation, then release exclusive access to that counter, 
9065bd8deadSopenharmony_ci    as-if a single step.
9075bd8deadSopenharmony_ci    Any other atomic counter function may access that single counter only after any
9085bd8deadSopenharmony_ci    earlier atomic operation is completed.
9095bd8deadSopenharmony_ci
9105bd8deadSopenharmony_ci    The value returned by an atomic counter function is the value of
9115bd8deadSopenharmony_ci    an atomic counter, which may be:
9125bd8deadSopenharmony_ci    returned and incremented in an atomic operation,
9135bd8deadSopenharmony_ci    or decremented and returned in an atomic operation,
9145bd8deadSopenharmony_ci    or simply returned.
9155bd8deadSopenharmony_ci
9165bd8deadSopenharmony_ci    The underlying counter is a 32-bit unsigned integer.  Increments and decrements 
9175bd8deadSopenharmony_ci    at the limit of the range will wrap to [0, 2^32-1].
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci
9205bd8deadSopenharmony_ci    Syntax                        Description
9215bd8deadSopenharmony_ci    uint atomicCounterIncrement   Increments <counter> atomically, returning
9225bd8deadSopenharmony_ci      ( atomic_uint counter );    the value prior to the increment operation.
9235bd8deadSopenharmony_ci
9245bd8deadSopenharmony_ci    uint atomicCounterDecrement   Decrements <counter> atomically, returning
9255bd8deadSopenharmony_ci      ( atomic_uint counter );    the value after the decrement operation.
9265bd8deadSopenharmony_ci
9275bd8deadSopenharmony_ci    uint atomicCounter            Returns the value of <counter>.
9285bd8deadSopenharmony_ci      ( atomic_uint counter );
9295bd8deadSopenharmony_ci
9305bd8deadSopenharmony_ci
9315bd8deadSopenharmony_ciSample Code
9325bd8deadSopenharmony_ci
9335bd8deadSopenharmony_ci    layout( binding=2)            uniform atomic_uint a;
9345bd8deadSopenharmony_ci    layout( binding=2, offset=4 ) uniform atomic_uint b;
9355bd8deadSopenharmony_ci    layout( binding=5, offset=0 ) uniform atomic_uint c;
9365bd8deadSopenharmony_ci
9375bd8deadSopenharmony_ci    // ...
9385bd8deadSopenharmony_ci
9395bd8deadSopenharmony_ci    uint foo = atomicCounterIncrement( a ); // get the counter value, then increment the counter
9405bd8deadSopenharmony_ci                                            // atomic operation
9415bd8deadSopenharmony_ci    uint bar = atomicCounterDecrement( b ); // decrement the counter value, then get the counter
9425bd8deadSopenharmony_ci                                            // atomic operation
9435bd8deadSopenharmony_ci    uint baz = atomicCounter( c );          // get the counter value
9445bd8deadSopenharmony_ci                                            // atomic operation
9455bd8deadSopenharmony_ci
9465bd8deadSopenharmony_ciIssues
9475bd8deadSopenharmony_ci
9485bd8deadSopenharmony_ci1 -  Do we need an indirection table between the counters and the shaders?
9495bd8deadSopenharmony_ci     (Similar to Samplers?  VertexAttribBinding?  Uniform blocks?)
9505bd8deadSopenharmony_ci
9515bd8deadSopenharmony_ci     Yes.  This draft introduces opaque counters similar to samplers.
9525bd8deadSopenharmony_ci     However, there is no Uniform-like API means of setting them to a
9535bd8deadSopenharmony_ci     texture unit or attribute-like API of binding them to a location.
9545bd8deadSopenharmony_ci     Instead, we have uniforms, which are a storage qualifier at
9555bd8deadSopenharmony_ci     global scope, and which use layout qualifiers to bind them
9565bd8deadSopenharmony_ci     to buffer binding points.  A GetActiveUniforms API is
9575bd8deadSopenharmony_ci     used to retrieve the names of the counters, and their
9585bd8deadSopenharmony_ci     bindings, and other useful information.
9595bd8deadSopenharmony_ci
9605bd8deadSopenharmony_ci2 -  What shader stages are these available in?
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ci     Resolved.  All stages.
9635bd8deadSopenharmony_ci
9645bd8deadSopenharmony_ci3 -  Can the counters be operated on in the shading language?
9655bd8deadSopenharmony_ci
9665bd8deadSopenharmony_ci     Resolved:  Not directly.  But indirectly, probably not in
9675bd8deadSopenharmony_ci     any meaningful way.  But there are no restrictions placed on the
9685bd8deadSopenharmony_ci     values once they are returned to the shader.
9695bd8deadSopenharmony_ci
9705bd8deadSopenharmony_ci4 -  Where's issue 4?
9715bd8deadSopenharmony_ci
9725bd8deadSopenharmony_ci     Resolved.  It's here.
9735bd8deadSopenharmony_ci
9745bd8deadSopenharmony_ci5 - Can a single shader both increment and decrement an individual atomic
9755bd8deadSopenharmony_ci    counter?
9765bd8deadSopenharmony_ci
9775bd8deadSopenharmony_ci     Resolved:  Yes, with caveats.  In order to provide a global unique
9785bd8deadSopenharmony_ci     offset, a counter must *either* be incremented or decremented by a
9795bd8deadSopenharmony_ci     shader.  The best way to think of this is that these are UNORDERED
9805bd8deadSopenharmony_ci     increments and decrements.  However, there may be uses for these
9815bd8deadSopenharmony_ci     atomic counters other than providing unique offsets.
9825bd8deadSopenharmony_ci
9835bd8deadSopenharmony_ci     We provide mechanism, not policy.  Shader coding conventions can
9845bd8deadSopenharmony_ci     provide policy - there's little reason for the compiler to be involved
9855bd8deadSopenharmony_ci     in enforcing.
9865bd8deadSopenharmony_ci
9875bd8deadSopenharmony_ci6 - Can multiple shaders in a program both increment and decrement an
9885bd8deadSopenharmony_ci    individual atomic counter?
9895bd8deadSopenharmony_ci
9905bd8deadSopenharmony_ci     Resolved.  Yes, with the same caveats as above.
9915bd8deadSopenharmony_ci
9925bd8deadSopenharmony_ci7 -  Is there a maximum maximum number of counters?
9935bd8deadSopenharmony_ci
9945bd8deadSopenharmony_ci     Resolved.  No, implementations are free to support arbitrarily many
9955bd8deadSopenharmony_ci     counters.  Implementations may set their own limits, though there are
9965bd8deadSopenharmony_ci     specified minimum limits.
9975bd8deadSopenharmony_ci
9985bd8deadSopenharmony_ci8 -  Can a counter be queried, but not incremented/decremented in the shader?
9995bd8deadSopenharmony_ci
10005bd8deadSopenharmony_ci     Resolved:  Yes.  (It's an increment of zero.  Or a decrement of zero.)
10015bd8deadSopenharmony_ci     Note that using a get without an increment or decrement will return
10025bd8deadSopenharmony_ci     a value that is *not* unique.
10035bd8deadSopenharmony_ci
10045bd8deadSopenharmony_ci     Again, we provide mechanism, not policy.
10055bd8deadSopenharmony_ci
10065bd8deadSopenharmony_ci9 -  Can a counter be incremented/decremented by an arbitrary amount?
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci     Resolved:  No.  Only by 1.  (Or 0.)
10095bd8deadSopenharmony_ci
10105bd8deadSopenharmony_ci10 - Should append counters wrap on zero and overflow?
10115bd8deadSopenharmony_ci
10125bd8deadSopenharmony_ci     Resolved:  Wrap.  [0,2^32-1]
10135bd8deadSopenharmony_ci
10145bd8deadSopenharmony_ci11 - What piece of state owns the atomic counters?
10155bd8deadSopenharmony_ci
10165bd8deadSopenharmony_ci     Resolved:  There is no context state, they must be backed
10175bd8deadSopenharmony_ci     by buffer objects.
10185bd8deadSopenharmony_ci
10195bd8deadSopenharmony_ci12 - Can the atomic counters be shared between contexts?
10205bd8deadSopenharmony_ci
10215bd8deadSopenharmony_ci     Resolved:  Not directly, but they may be shared indirectly by sharing the
10225bd8deadSopenharmony_ci     buffer objects that back them.
10235bd8deadSopenharmony_ci
10245bd8deadSopenharmony_ci13 - Should we be able to write atomic counters to a buffer object?
10255bd8deadSopenharmony_ci
10265bd8deadSopenharmony_ci     Resolved.  Yes.  (Note that buffer objects can be shared.
10275bd8deadSopenharmony_ci     The result of updating atomic counters in multiple contexts
10285bd8deadSopenharmony_ci     backed with the same buffer object is undefined.)
10295bd8deadSopenharmony_ci
10305bd8deadSopenharmony_ci14 - If indexing an array of atomic_uints, can the index used diverge
10315bd8deadSopenharmony_ci     in a SIMD implementation?
10325bd8deadSopenharmony_ci
10335bd8deadSopenharmony_ci     Resolved.  No.  They must be dynamically uniform, similar
10345bd8deadSopenharmony_ci     to samplers.
10355bd8deadSopenharmony_ci
10365bd8deadSopenharmony_ci15 - Should we provide "append buffer" functionality?
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci     Resolved:  Yes, but by providing access to atomic counters.
10395bd8deadSopenharmony_ci     This provides the mechanism to do "append buffer" functionality,
10405bd8deadSopenharmony_ci     and more.
10415bd8deadSopenharmony_ci
10425bd8deadSopenharmony_ci16 - What should this extension be called?
10435bd8deadSopenharmony_ci
10445bd8deadSopenharmony_ci     Resolved:  ARB_shader_atomic_counters.  It's primarily a shader
10455bd8deadSopenharmony_ci     extension, and it provides atomic_counters.
10465bd8deadSopenharmony_ci    
10475bd8deadSopenharmony_ci17 - What happens to shared buffer objects that are updated in
10485bd8deadSopenharmony_ci     more than one context by data-setting commands, including
10495bd8deadSopenharmony_ci     the built-in atomic counter functions?
10505bd8deadSopenharmony_ci
10515bd8deadSopenharmony_ci     Resolved:  They should follow the same rules as other shared
10525bd8deadSopenharmony_ci     buffer objects.  (That is, care must be taken when updating
10535bd8deadSopenharmony_ci     atomic counters in one context and using them in another
10545bd8deadSopenharmony_ci     context.)  Further, the atomic built-in functions are
10555bd8deadSopenharmony_ci     atomic in a single context, but there is no guarantee that
10565bd8deadSopenharmony_ci     they are atomic across contexts.
10575bd8deadSopenharmony_ci
10585bd8deadSopenharmony_ci18 - Should there be one buffer binding for all counters, or a
10595bd8deadSopenharmony_ci     buffer binding per counter.
10605bd8deadSopenharmony_ci
10615bd8deadSopenharmony_ci     Resolved.  There should be a buffer binding (and offset)
10625bd8deadSopenharmony_ci     per counter.  Shaders may store multiple atomic counters in
10635bd8deadSopenharmony_ci     a single buffer binding.
10645bd8deadSopenharmony_ci
10655bd8deadSopenharmony_ci19 - What about simultaneous use of buffer object at two 
10665bd8deadSopenharmony_ci     binding points, where one is an atomic counter binding point?
10675bd8deadSopenharmony_ci
10685bd8deadSopenharmony_ci     Resolved.  We are going to be conservative and make
10695bd8deadSopenharmony_ci     such use undefined.
10705bd8deadSopenharmony_ci
10715bd8deadSopenharmony_ci20 - Does atomic_uint type add any value?
10725bd8deadSopenharmony_ci
10735bd8deadSopenharmony_ci     Resolved.  Yes.  For a single program text, the opaque
10745bd8deadSopenharmony_ci     atomic_uint is just syntactic sugar.
10755bd8deadSopenharmony_ci     However, for multiple shaders bound to a shader target,
10765bd8deadSopenharmony_ci     only one shader must contain the locations.  This would
10775bd8deadSopenharmony_ci     permit an implementation to do fast relinking if
10785bd8deadSopenharmony_ci     a single shader is attached to an existing shader.
10795bd8deadSopenharmony_ci     (And display lists are just fine for optimizing
10805bd8deadSopenharmony_ci     texture loads.  [insert silly smiley face])
10815bd8deadSopenharmony_ci
10825bd8deadSopenharmony_ci     Also, when we do add api (not yet added) to query active
10835bd8deadSopenharmony_ci     atomic_uints in a shader, this provides additional benefits.
10845bd8deadSopenharmony_ci
10855bd8deadSopenharmony_ci21 - Do we need api to query the atomic counter?
10865bd8deadSopenharmony_ci
10875bd8deadSopenharmony_ci     Resolved.  Earlier drafts had a traditional indexed get,
10885bd8deadSopenharmony_ci     which would be useful for debugging but not high performance.
10895bd8deadSopenharmony_ci     An alternative would be to add a query object to do asynchronos
10905bd8deadSopenharmony_ci     queries.  But note, that when these counters are backed by
10915bd8deadSopenharmony_ci     buffer objects, all the GetBufferSubData and/or MapBuffer
10925bd8deadSopenharmony_ci     just works.
10935bd8deadSopenharmony_ci
10945bd8deadSopenharmony_ci     This draft simply nukes the get.  (It is trivial to put it
10955bd8deadSopenharmony_ci     back in with a caveat.)  The existing buffer api should
10965bd8deadSopenharmony_ci     be used for high performance client side (cpu) access
10975bd8deadSopenharmony_ci     to atomic counters.
10985bd8deadSopenharmony_ci
10995bd8deadSopenharmony_ci22 - Does AtomicCounter reset to zero:
11005bd8deadSopenharmony_ci     The context default counter state?
11015bd8deadSopenharmony_ci     The value in a buffer object bound to a counter?
11025bd8deadSopenharmony_ci     Both?
11035bd8deadSopenharmony_ci
11045bd8deadSopenharmony_ci     Resolved.  THERE IS NO DEFAULT CONTEXT STATE, only the
11055bd8deadSopenharmony_ci     buffer object bound, if any, is set.
11065bd8deadSopenharmony_ci
11075bd8deadSopenharmony_ci23 - Does a BufferData to a buffer bound to counter set the value of:
11085bd8deadSopenharmony_ci     The buffer object?  (Obviously)
11095bd8deadSopenharmony_ci     The context default counter state bound that that buffer?
11105bd8deadSopenharmony_ci
11115bd8deadSopenharmony_ci     Resolved.  THERE IS NO DEFAULT CONTEXT STATE.
11125bd8deadSopenharmony_ci
11135bd8deadSopenharmony_ci24 - Do we want an error (or undefined behavior) that says you
11145bd8deadSopenharmony_ci     can't draw while a mapped buffer is bound to one of these
11155bd8deadSopenharmony_ci     counters?
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci     Resolved.  Undefined.
11185bd8deadSopenharmony_ci
11195bd8deadSopenharmony_ci25 - Is a atomic_uint an "in" or a "uniform"?
11205bd8deadSopenharmony_ci
11215bd8deadSopenharmony_ci     Resolved.  "atomic_uint" variables are declared as uniforms at global
11225bd8deadSopenharmony_ci     scope.
11235bd8deadSopenharmony_ci
11245bd8deadSopenharmony_ci26 - Can the active atomic counters for one program be stored in more than one
11255bd8deadSopenharmony_ci     buffer object?
11265bd8deadSopenharmony_ci
11275bd8deadSopenharmony_ci     Resolved.  Yes.
11285bd8deadSopenharmony_ci
11295bd8deadSopenharmony_ci27 - Can atomic counters be grouped into blocks similar to uniform blocks?
11305bd8deadSopenharmony_ci
11315bd8deadSopenharmony_ci     Resolved.  No.  However, layout qualifiers can be used in individual
11325bd8deadSopenharmony_ci     declarations to identify a specific buffer binding point and offset to
11335bd8deadSopenharmony_ci     use for the counter.
11345bd8deadSopenharmony_ci
11355bd8deadSopenharmony_ci28 - What API should be used to query information about atomic counters?
11365bd8deadSopenharmony_ci
11375bd8deadSopenharmony_ci     Resolved.  GetActiveUniformsiv.  Apart from the common type and count
11385bd8deadSopenharmony_ci     queries, UNIFORM_OFFSET can be used to query the offset of an atomic
11395bd8deadSopenharmony_ci     counter, UNIFORM_ARRAY_STRIDE can be used to query the stride in memory
11405bd8deadSopenharmony_ci     of an array of atomic counters (even though it's always four bytes), and
11415bd8deadSopenharmony_ci     UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX can be used to query the index of the
11425bd8deadSopenharmony_ci     active atomic counter buffer associated with the uniform.  
11435bd8deadSopenharmony_ci
11445bd8deadSopenharmony_ci     No GetActiveUniformsiv query is provided to retrieve the binding point
11455bd8deadSopenharmony_ci     associated with an atomic counter uniform.  It may be obtained indirectly
11465bd8deadSopenharmony_ci     by UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX and then using
11475bd8deadSopenharmony_ci     GetAtomicCounterBufferiv to query the ATOMIC_COUNTER_BUFFER_BINDING for
11485bd8deadSopenharmony_ci     the returned index.
11495bd8deadSopenharmony_ci
11505bd8deadSopenharmony_ci29 - What API should we provide to query information about buffer object
11515bd8deadSopenharmony_ci     storage needed to back atomic counters?
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ci     Unresolved.  We will provide an API for querying information about
11545bd8deadSopenharmony_ci     "active atomic counter buffers" similar to the API we provide for
11555bd8deadSopenharmony_ci     querying active uniform blocks.  Each set of active atomic counter
11565bd8deadSopenharmony_ci     uniforms sharing a single binding point corresponds to an active atomic
11575bd8deadSopenharmony_ci     counter buffer.  An application can query the number of active atomic
11585bd8deadSopenharmony_ci     counter buffers via GetProgram.  If there are <N> active atomic counter
11595bd8deadSopenharmony_ci     buffers, it can pass the values 0..<N>-1 to the command
11605bd8deadSopenharmony_ci     GetAtomicCounterBufferiv to query properties of each buffer.
11615bd8deadSopenharmony_ci
11625bd8deadSopenharmony_ci     Consider the following set of active atomic counter uniform declarations
11635bd8deadSopenharmony_ci     in three different shader types in a program:
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci       [in vertex]
11665bd8deadSopenharmony_ci       layout(binding = 0, offset = 0) uniform atomic_uint batman;
11675bd8deadSopenharmony_ci       layout(binding = 3, offset = 4) uniform atomic_uint robin;
11685bd8deadSopenharmony_ci       [in geometry]
11695bd8deadSopenharmony_ci       layout(binding = 0, offset = 4) uniform atomic_uint joker;
11705bd8deadSopenharmony_ci       layout(binding = 6, offset = 124) uniform atomic_uint riddler;
11715bd8deadSopenharmony_ci       [in fragment]
11725bd8deadSopenharmony_ci       layout(binding = 7, offset = 0) uniform atomic_uint penguin;
11735bd8deadSopenharmony_ci
11745bd8deadSopenharmony_ci     In this example, there are four active atomic counter buffers.  For the
11755bd8deadSopenharmony_ci     purposes of the GetActiveAtomicCounterBufferiv query, these will be
11765bd8deadSopenharmony_ci     assigned indices 0, 1, 2, 3.  If the active atomic counter buffers are
11775bd8deadSopenharmony_ci     sorted by binding point, the atomic counter buffer binding point numbers
11785bd8deadSopenharmony_ci     returned by calling GetActiveAtomicCounterBufferiv with a <pname> of
11795bd8deadSopenharmony_ci     ATOMIC_COUNTER_BUFFER_BINDING, will be 0, 3, 6, and 7, respectively.
11805bd8deadSopenharmony_ci
11815bd8deadSopenharmony_ci30 - The function atomicCounterIncrement() returns the value of the counter
11825bd8deadSopenharmony_ci     prior to incrementing while atomicCounterDecrement() returns the value
11835bd8deadSopenharmony_ci     of the counter *after* decrementing.  Is this intentional?
11845bd8deadSopenharmony_ci
11855bd8deadSopenharmony_ci     Resolved.  Yes.  One of the intended uses of this programming model is to
11865bd8deadSopenharmony_ci     be able to atomically add or remove records to an array stored in a
11875bd8deadSopenharmony_ci     buffer (via ARB_shader_image_load_store).  In this model, we use the
11885bd8deadSopenharmony_ci     atomic counter to indicate the number of records stored in the buffer and
11895bd8deadSopenharmony_ci     expect the value to be initialized to zero.  When the first record is
11905bd8deadSopenharmony_ci     added, it gets an index of zero and increments the counter to one.  If a
11915bd8deadSopenharmony_ci     later operation wants to remove a record from the end of a buffer with an
11925bd8deadSopenharmony_ci     associated counter value <N>, we would want to decrement to counter to
11935bd8deadSopenharmony_ci     <N>-1, but also return the decremented index of <N>-1, which was the
11945bd8deadSopenharmony_ci     index of the last record in the buffer prior to the decrement.
11955bd8deadSopenharmony_ci
11965bd8deadSopenharmony_ci31 - What alignment requirements apply to the <offset> and <size> parameters
11975bd8deadSopenharmony_ci     of BindBufferRange when binding atomic counter buffers?
11985bd8deadSopenharmony_ci
11995bd8deadSopenharmony_ci     Resolved.  <offset> must be a multiple of four.  <size> has no required
12005bd8deadSopenharmony_ci     alignment.  However, if <size> is not four-byte aligned, it will not
12015bd8deadSopenharmony_ci     possible to store an atomic counter in the last few bytes of the bound
12025bd8deadSopenharmony_ci     range since the offset of all atomic counters must also be a multiple of
12035bd8deadSopenharmony_ci     four.
12045bd8deadSopenharmony_ci
12055bd8deadSopenharmony_ciRevision History
12065bd8deadSopenharmony_ci
12075bd8deadSopenharmony_ci    Revision 1, wwlk, 2009-09-08
12085bd8deadSopenharmony_ci      - Working Draft
12095bd8deadSopenharmony_ci    Revision 2, wwlk, 2009-09-08
12105bd8deadSopenharmony_ci      - updates from feedback
12115bd8deadSopenharmony_ci    Revision 3, wwlk, 2009-09-09
12125bd8deadSopenharmony_ci      - (9/9/9, yeah yeah yeah)
12135bd8deadSopenharmony_ci      - updates from feedback
12145bd8deadSopenharmony_ci    Revision 4, wwlk, 2009-09-15
12155bd8deadSopenharmony_ci      - updates from walkthrough
12165bd8deadSopenharmony_ci      - minor typo update (2.9.10 should be 2.9.9)
12175bd8deadSopenharmony_ci      - add extension enables and defines to shader spec
12185bd8deadSopenharmony_ci      - correct function names (add EXT suffix)
12195bd8deadSopenharmony_ci      - rename extension
12205bd8deadSopenharmony_ci    Revision 5, wwlk, 2009-09-15
12215bd8deadSopenharmony_ci      - Clarify buffer objects
12225bd8deadSopenharmony_ci      - Clarify undersized buffer objects
12235bd8deadSopenharmony_ci    Revision 6, wwlk, 2009-09-16
12245bd8deadSopenharmony_ci      - Clarify alignment restrictions for buffer object
12255bd8deadSopenharmony_ci      - Update built-in function names and descriptions
12265bd8deadSopenharmony_ci      - Add issue about number of binding points
12275bd8deadSopenharmony_ci    Revision 7, wwlk, 2010-10-17
12285bd8deadSopenharmony_ci      - Add opaque ucounter
12295bd8deadSopenharmony_ci      - add buffer binding and offset per counter
12305bd8deadSopenharmony_ci    Revision 8, wwlk, 2010-10-28
12315bd8deadSopenharmony_ci      - make it clear that these use the indexed binding api
12325bd8deadSopenharmony_ci        (ala transform feedback)
12335bd8deadSopenharmony_ci      - remove get
12345bd8deadSopenharmony_ci        (bug 5839, issue 2 in bug, issue 21 in this extension)
12355bd8deadSopenharmony_ci      - remove fragment restriction
12365bd8deadSopenharmony_ci        (bug 5839, issue 5 in bug, issue 2 in this extension)
12375bd8deadSopenharmony_ci      - add issue 4
12385bd8deadSopenharmony_ci      - add other issues from bug 5839
12395bd8deadSopenharmony_ci      - Some clarifications from bug 6975
12405bd8deadSopenharmony_ci   Revision 9, wwlk, 2010-11-30
12415bd8deadSopenharmony_ci      - added new global qualifier, uniform
12425bd8deadSopenharmony_ci      - clarified no default context state
12435bd8deadSopenharmony_ci      - clarified the action of BindBufferRange
12445bd8deadSopenharmony_ci      - corrected alignment and sizing restrictions
12455bd8deadSopenharmony_ci      - Still to be done - GetActiveUniforms API!
12465bd8deadSopenharmony_ci   Revision 10, wwlk, 2010-12-02
12475bd8deadSopenharmony_ci      - GetActiveUniforms API
12485bd8deadSopenharmony_ci      - change ucounter -> atomic_uint
12495bd8deadSopenharmony_ci   Revision 11, wwlk, 2010-12-02
12505bd8deadSopenharmony_ci      - Removed unnecessary AtomicCounterEXT API.
12515bd8deadSopenharmony_ci        (use buffer API)
12525bd8deadSopenharmony_ci   Revision 12, wwlk, 2010-12-03
12535bd8deadSopenharmony_ci      - Trivial typos
12545bd8deadSopenharmony_ci   Revision 13, wwlk, 2010-12-03
12555bd8deadSopenharmony_ci      - More trivial typos
12565bd8deadSopenharmony_ci   Revision 14, wwlk, 2010-12-03
12575bd8deadSopenharmony_ci      - Still more trivial typos
12585bd8deadSopenharmony_ci   Revision 15, wwlk, 2010-12-09
12595bd8deadSopenharmony_ci      - Still more trivial typos
12605bd8deadSopenharmony_ci      - Clarifications
12615bd8deadSopenharmony_ci      - Additional uniform API - next revision
12625bd8deadSopenharmony_ci        (the obvious additions, but unfortunately
12635bd8deadSopenharmony_ci         extensive.  Proofing now.)
12645bd8deadSopenharmony_ci   Revision 16, johnk, 2010-12-17
12655bd8deadSopenharmony_ci      - Change MAX_ATOMIC_COUNTERS to gl_MaxAtomicCounterBindingsEXT (is that correct?)
12665bd8deadSopenharmony_ci      - Move that statement from the uniform section to the qualifier section.
12675bd8deadSopenharmony_ci      - added integer constants to the layout qualifier grammar
12685bd8deadSopenharmony_ci      - minor grammar and consistency changes going into 4.2 core.
12695bd8deadSopenharmony_ci    Revision 17, Jon Leech, 2010-12-19
12705bd8deadSopenharmony_ci      - Change extension name to ARB instead of EXT. Remove _EXT
12715bd8deadSopenharmony_ci        suffixes on API since this extension is backwards-compatibility
12725bd8deadSopenharmony_ci        for a core GL 4.2 feature. Probably should remove suffixes on
12735bd8deadSopenharmony_ci        GLSL interface as well.
12745bd8deadSopenharmony_ci      - Fix version number for API spec in section headings.
12755bd8deadSopenharmony_ci    Revision 18, Jon Leech, 2011-01-05
12765bd8deadSopenharmony_ci      - Fix typos from Bug 7202
12775bd8deadSopenharmony_ci    Revision 19, wwlk, 2011-04-05
12785bd8deadSopenharmony_ci      - Uniform API - large rework
12795bd8deadSopenharmony_ci      - Clarify limits
12805bd8deadSopenharmony_ci      - Clarify layouts, binding rules, offset rules
12815bd8deadSopenharmony_ci      - Clarify named uniform blocks
12825bd8deadSopenharmony_ci      - Clarify unnamed uniform blocks
12835bd8deadSopenharmony_ci    Revision 20, wwlk, 2011-04-08
12845bd8deadSopenharmony_ci      - Clarify named uniform blocks with examples
12855bd8deadSopenharmony_ci      - Make explicit the matching rules for layout (explicit or implicit layout must match)
12865bd8deadSopenharmony_ci      - Added issue 29, do we need both un-named uniform blocks and uniform blocks?
12875bd8deadSopenharmony_ci      - Added issue 30, should the un-named uniform blocks be un-named "", or should
12885bd8deadSopenharmony_ci        they be implicitly named (example, uniform3 for binding to 3)
12895bd8deadSopenharmony_ci    Revision 21, wwlk, 2011-04-08
12905bd8deadSopenharmony_ci      - Minor change to invalid uniform block example
12915bd8deadSopenharmony_ci    Revision 22, wwlk, 2011-05-05
12925bd8deadSopenharmony_ci      - Major change
12935bd8deadSopenharmony_ci        uniforms (immutable)
12945bd8deadSopenharmony_ci    Revision 23, wwlk, 2011-05-05
12955bd8deadSopenharmony_ci      - Fixed hellacious paragraph, related to bug 7458
12965bd8deadSopenharmony_ci        "Each active uniform variable ... "." (dot) and "[]" ..."
12975bd8deadSopenharmony_ci    Revision 24, Jon Leech, 2011-05-08
12985bd8deadSopenharmony_ci      - Minor formatting/typo cleanup. Fix name of query in state tables.
12995bd8deadSopenharmony_ci        Remove EXT suffixes from shader constant and function names.
13005bd8deadSopenharmony_ci    Revision 25, pbrown, 2011-06-18
13015bd8deadSopenharmony_ci      - Add missing entries in the lists of new functions and tokens.
13025bd8deadSopenharmony_ci      - Assigned enumerant values for new tokens.
13035bd8deadSopenharmony_ci      - Minor language clarifications and typo fixes.
13045bd8deadSopenharmony_ci      - Clarify the two different numbering spaces for buffers used for atomic
13055bd8deadSopenharmony_ci        counters.  The set of binding points actively referenced by a
13065bd8deadSopenharmony_ci        particular program are called "active atomic counter buffers"; the set
13075bd8deadSopenharmony_ci        of binding points in the context to which buffers are attached query
13085bd8deadSopenharmony_ci        are called "atomic counter bindings" or "binding points".  Related
13095bd8deadSopenharmony_ci        APIs and tokens use "buffer" for the former and "binding" for the
13105bd8deadSopenharmony_ci        latter (bug 7723).
13115bd8deadSopenharmony_ci      - Add GetActiveUniformsiv support for atomic counters, allowing the use
13125bd8deadSopenharmony_ci        of UNIFORM_OFFSET and UNIFORM_ARRAY_STRIDE, and adding the query
13135bd8deadSopenharmony_ci        UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX to query the associated active
13145bd8deadSopenharmony_ci        atomic counter buffer.
13155bd8deadSopenharmony_ci      - Restructure the atomic counter buffer binding section to more closely
13165bd8deadSopenharmony_ci        match existing uniform block language; clarify alignment and buffer
13175bd8deadSopenharmony_ci        size requirements (bug 7722).
13185bd8deadSopenharmony_ci      - Remove explicit language about a minimum of 8 atomic counter buffers;
13195bd8deadSopenharmony_ci        already covered by existing queries and state table entries (bug 7722).
13205bd8deadSopenharmony_ci      - Add GetProgram language for ACTIVE_ATOMIC_COUNTER_BUFFERS.
13215bd8deadSopenharmony_ci      - Add missing state table entries for program object state and
13225bd8deadSopenharmony_ci        implementation limits on atomic counter buffer sizes and the combined
13235bd8deadSopenharmony_ci        active buffer count (bug 7722).
13245bd8deadSopenharmony_ci      - Clarify that we intended the non-orthogonality where the increment
13255bd8deadSopenharmony_ci        function returns a value prior to incrementing while the decrement
13265bd8deadSopenharmony_ci        function returns a value after decrementing (bug 7722).
13275bd8deadSopenharmony_ci      - Add a few issues and clarify/update some existing ones.
13285bd8deadSopenharmony_ci    Revision 26, pbrown, 2011-06-20
13295bd8deadSopenharmony_ci      - Add missing enum assignment for MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.
13305bd8deadSopenharmony_ci    Revision 27, pbrown, 2011-06-23
13315bd8deadSopenharmony_ci      - Set a minimum value for MAX_ATOMIC_COUNTER_BUFFER_SIZE (bug 7743).
13325bd8deadSopenharmony_ci      - Fix typo in state table.
13335bd8deadSopenharmony_ci    Revision 28, pbrown, 2011-07-27
13345bd8deadSopenharmony_ci      - Clarify that ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS queries the
13355bd8deadSopenharmony_ci        number of atomic counter variables (bug 7834).
13365bd8deadSopenharmony_ci      - Fix tokens MAX_*_ATOMIC_COUNTER_BUFFERS in the state table (bug 7834).
13375bd8deadSopenharmony_ci      - Fix a couple typos.
13385bd8deadSopenharmony_ci    Revision 29, Jon Leech, 2011-08-05
13395bd8deadSopenharmony_ci      - Change minimum MAX_ATOMIC_COUNTER_BUFFER_SIZE value to 32 (bug
13405bd8deadSopenharmony_ci        7855).
13415bd8deadSopenharmony_ci    Revision 30, Jon Leech, 2012-04-12
13425bd8deadSopenharmony_ci      - Add description of atomic buffer object binding queries in section
13435bd8deadSopenharmony_ci        6.1.8. Correct typo for GetAtomicCounterBufferiv in state table
13445bd8deadSopenharmony_ci        entries.
13455bd8deadSopenharmony_ci    Revision 31, Jon Leech, 2012-07-30
13465bd8deadSopenharmony_ci      - Correct typo ATOMIC_COUNTER_ARRAY_STRIDE -> UNIFORM_ARRAY_STRIDE
13475bd8deadSopenharmony_ci        (bug 9346).
1348