15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_ES3_1_compatibility
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_ES3_1_compatibility
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com)
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    and contributors to the OpenGL ES 3.1 specification
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciNotice
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Copyright (c) 2014 The Khronos Group Inc. Copyright terms at
225bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciSpecification Update Policy
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
275bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
285bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
295bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
305bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
315bd8deadSopenharmony_ci    described in more detail at
325bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciStatus
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    Complete. 
375bd8deadSopenharmony_ci    Approved by the ARB on June 26, 2014.
385bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on August 7, 2014.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciVersion
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    Last Modified Date:         September 19, 2014
435bd8deadSopenharmony_ci    Revision:                   15
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ciNumber
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    ARB Extension #159
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciDependencies
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    OpenGL 4.4, ARB_ES2_compatibility, ARB_ES3_compatibility are required.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension is written against The OpenGL 4.4 (Compatibility Profile)
545bd8deadSopenharmony_ci    specification.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ciOverview
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    This extension adds support for features of OpenGL ES 3.1 that are
595bd8deadSopenharmony_ci    missing from OpenGL 4.4. Enabling these features will ease the process
605bd8deadSopenharmony_ci    of porting applications from OpenGL ES 3.1 to OpenGL.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    In particular this adds the following features:
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    - a new MemoryBarrierByRegion API which is potentially more efficient
655bd8deadSopenharmony_ci    for specific localized memory access patterns.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    - increases the minimum required size of SSBOs to 2^27 (128 MB).
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    - support for GLSL ES version 310 (ie #version 310 es).
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    - a new GLSL built-in function, imageAtomicExchange, which performs atomic
725bd8deadSopenharmony_ci    exchanges on r32f floating point images.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    - a new GLSL built-in fragment shader input, gl_HelperInvocation, that
755bd8deadSopenharmony_ci    identifies whether the current fragment shader input is a helper
765bd8deadSopenharmony_ci    invocation.  Fragment shader code can use this variable to skip performing
775bd8deadSopenharmony_ci    operations that are useless or potentially dangerous for helper
785bd8deadSopenharmony_ci    invocations.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    - a new GLSL built-in constant for the maximum supported samples:
815bd8deadSopenharmony_ci    gl_MaxSamples.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    - a number of new GLSL built-in constants mirroring the API limits for
845bd8deadSopenharmony_ci    image uniforms: gl_Max*ImageUniforms, gl_MaxCombinedShaderOutputResources.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    - new GLSL built-in functions which extend mix() to select between int,
875bd8deadSopenharmony_ci    uint, and bool components.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    - add the "coherent" qualifier to all memory variables taken by the GLSL
905bd8deadSopenharmony_ci    built-in atomic* and imageAtomic* functions.
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ciNew Procedures and Functions
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    void MemoryBarrierByRegion(bitfield barriers);
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ciNew Tokens
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    None
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ciAdditions to Chapter 1 of the OpenGL 4.4 (Compatibility Profile)
1015bd8deadSopenharmony_ciSpecification (Introduction)
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    Modify section 1.3.2 (OpenGL ES) to include mention of OpenGL ES 3.1:
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    OpenGL ES is a ... well-defined subsets of OpenGL.  OpenGL ES version
1065bd8deadSopenharmony_ci    1.1 implements a subset of the OpenGL 1.5 fixed-function API, OpenGL
1075bd8deadSopenharmony_ci    ES 2.0 implements a subset of the OpenGL 2.0 shader-based API, OpenGL
1085bd8deadSopenharmony_ci    ES 3.0 implements a subset of OpenGL 3.3, and OpenGL ES 3.1 implements
1095bd8deadSopenharmony_ci    a subset of OpenGL 4.3. OpenGL ES versions also include ...
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    OpenGL and OpenGL ES are developed ...
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    OpenGL implementations supporting this extension include functionality
1145bd8deadSopenharmony_ci    initially defined in OpenGL ES 3.1, for increased compatibility between
1155bd8deadSopenharmony_ci    OpenGL and OpenGL ES implementations.
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    Modify section 1.3.3 (OpenGL ES Shading Language) to include mention
1195bd8deadSopenharmony_ci    of version 3.10:
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    The Specification should also be read together with companion documents
1225bd8deadSopenharmony_ci    titled "The OpenGL ES Shading Language". Versions 1.00, 3.00 and 3.10
1235bd8deadSopenharmony_ci    should be read. These documents define versions of the OpenGL ES Shading
1245bd8deadSopenharmony_ci    Language designed for implementations of OpenGL ES 2.0, 3.0 and 3.1,
1255bd8deadSopenharmony_ci    respectively, but also supported by OpenGL implementations. References ...
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    OpenGL implementations supporting this extensions are guaranteed to
1285bd8deadSopenharmony_ci    support versions 1.00, 3.00 and 3.10 of the OpenGL ES Shading Language.
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL 4.4 (Compatibility Profile)
1325bd8deadSopenharmony_ciSpecification (Programs and Shaders)
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    Modify Section 7.12.2, "Shader Memory Access Synchronization", (p. 148)
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    (Append to the end of the section)
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    "The command
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci        void MemoryBarrierByRegion(bitfield barriers)
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ci    behaves as described above for MemoryBarrier, with two differences:
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    First, it narrows the region under consideration so that only reads/writes
1455bd8deadSopenharmony_ci    of prior fragment shaders that are invoked for a smaller region of the
1465bd8deadSopenharmony_ci    framebuffer will be completed/reflected prior to subsequent reads/write of
1475bd8deadSopenharmony_ci    following fragment shaders.  The size of the region is implementation
1485bd8deadSopenharmony_ci    dependent and may be as small as one framebuffer pixel.
1495bd8deadSopenharmony_ci    
1505bd8deadSopenharmony_ci    Second, it only applies to memory transactions that may be read by or
1515bd8deadSopenharmony_ci    written by a fragment shader.  Therefore, only the barrier bits
1525bd8deadSopenharmony_ci      - ATOMIC_COUNTER_BARRIER_BIT
1535bd8deadSopenharmony_ci      - FRAMEBUFFER_BARRIER_BIT
1545bd8deadSopenharmony_ci      - SHADER_IMAGE_ACCESS_BARRIER_BIT
1555bd8deadSopenharmony_ci      - SHADER_STORAGE_BARRIER_BIT
1565bd8deadSopenharmony_ci      - TEXTURE_FETCH_BARRIER_BIT
1575bd8deadSopenharmony_ci      - UNIFORM_BARRIER_BIT
1585bd8deadSopenharmony_ci    are supported.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    When barriers is ALL_BARRIER_BITS, shader memory accesses will be
1615bd8deadSopenharmony_ci    synchronized relative to all these barrier bits, but not to other barrier
1625bd8deadSopenharmony_ci    bits specific to MemoryBarrier. This implies that reads/writes for
1635bd8deadSopenharmony_ci    scatter/gather-like algorithms may or may not be completed/reflected after
1645bd8deadSopenharmony_ci    a MemoryBarrierByRegion command. However, for uses such as deferred
1655bd8deadSopenharmony_ci    shading, where a linked list of visible surfaces with the head at a
1665bd8deadSopenharmony_ci    framebuffer address may be constructed, and the entirety of the list is
1675bd8deadSopenharmony_ci    only dependent on previous executions at that framebuffer address,
1685bd8deadSopenharmony_ci    MemoryBarrierByRegion may be significantly more efficient than
1695bd8deadSopenharmony_ci    MemoryBarrier."
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ciAdditions to Chapter 9 of the OpenGL 4.4 (Compatibility Profile)
1735bd8deadSopenharmony_ciSpecification (Framebuffers and Framebuffer Objects)
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci    Modify Section 9.2.3 (Framebuffer Object Queries) in the second
1765bd8deadSopenharmony_ci    paragraph describing GetFramebufferAttachmentParameteriv to add BACK as
1775bd8deadSopenharmony_ci    a valid <attachment>:
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    "If the default framebuffer is bound to <target>, then <attachment> must
1805bd8deadSopenharmony_ci    be one of FRONT_LEFT, FRONT_RIGHT, BACK, BACK_LEFT, or BACK_RIGHT,
1815bd8deadSopenharmony_ci    identifying a color buffer; ... identifying the stencil buffer. Since
1825bd8deadSopenharmony_ci    this command can only query a single framebuffer attachment, BACK is
1835bd8deadSopenharmony_ci    equivalent to BACK_LEFT."
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Modify the first paragraph of Section 9.4.5 (Effects of
1865bd8deadSopenharmony_ci    Framebuffer State on Framebuffer Dependent Values)
1875bd8deadSopenharmony_ci    
1885bd8deadSopenharmony_ci    "The values of the state variables listed in table 23.85 may change when
1895bd8deadSopenharmony_ci    a change is made to the current framebuffer binding, to the state of the
1905bd8deadSopenharmony_ci    currently bound framebuffer object, or to an image attached to that
1915bd8deadSopenharmony_ci    framebuffer object. Most such state is dependent on the draw framebuffer
1925bd8deadSopenharmony_ci    (DRAW_FRAMEBUFFER_BINDING), but IMPLEMENTATION_COLOR_READ_TYPE and
1935bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_FORMAT are dependent on the read framebuffer
1945bd8deadSopenharmony_ci    (READ_FRAMEBUFFER_BINDING)."
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL 4.4 (Compatibility Profile)
1985bd8deadSopenharmony_ciSpecification (Programmable Fragment Processing)
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    Modify Section 15.2.2 (Shader Inputs), (p. 530, 5th paragraph)
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    "The built-in variable gl_SampleMaskIn is an integer array...
2035bd8deadSopenharmony_ci    The number of elements in the array is ceil(gl_MaxSamples/32), where
2045bd8deadSopenharmony_ci    gl_MaxSamples is the value of MAX_SAMPLES, the maximum number of
2055bd8deadSopenharmony_ci    color samples supported by the implementation.  Bit <n> ... "
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    Modify Section 15.2.3 (Shader Outputs), (p. 532, 2nd paragraph)
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    "The built-in integer array gl_SampleMask can be used ...
2105bd8deadSopenharmony_ci    The number of elements in the arrays is ceil(gl_MaxSamples/32), where
2115bd8deadSopenharmony_ci    gl_MaxSamples is the value of MAX_SAMPLES, the maximum number of
2125bd8deadSopenharmony_ci    color samples supported by the implementation. If bit <n> ... "
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ciAdditions to Chapter 17 of the OpenGL 4.4 (Compatibility Profile)
2165bd8deadSopenharmony_ciSpecification (Writing Fragments and Samples to the Framebuffer)
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    Modify Section 17.4.1 (Selecting Buffers for Writing), (p. 572,
2195bd8deadSopenharmony_ci    2nd paragraph)
2205bd8deadSopenharmony_ci    
2215bd8deadSopenharmony_ci    "If the GL is bound to the default framebuffer, then each of the
2225bd8deadSopenharmony_ci    constants must be one of the values listed in table 17.6 or the
2235bd8deadSopenharmony_ci    special value BACK. When the value BACK is used then <n> must
2245bd8deadSopenharmony_ci    be 1 and color values are written into the left buffer for
2255bd8deadSopenharmony_ci    single-buffered contexts, or into the back left buffer for double-
2265bd8deadSopenharmony_ci    buffered contexts. An INVALID_OPERATION error is generated if
2275bd8deadSopenharmony_ci    <bufs> contains the value BACK and <n> does not equal 1."
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ciAdditions to Chapter 18 of the OpenGL 4.4 (Compatibility Profile)
2315bd8deadSopenharmony_ciSpecification (Drawing, Reading, and Copying Pixels)
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci    Modify Section 18.2.1 (Selecting Buffers for Reading), (p. 589)
2345bd8deadSopenharmony_ci    
2355bd8deadSopenharmony_ci    Remove the last paragraph that describes the
2365bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE
2375bd8deadSopenharmony_ci    queries and errors.
2385bd8deadSopenharmony_ci    
2395bd8deadSopenharmony_ci    Modify Section 18.2.2 (ReadPixels), (p. 589)
2405bd8deadSopenharmony_ci    
2415bd8deadSopenharmony_ci    Add the following paragraph at the end of the section:
2425bd8deadSopenharmony_ci    
2435bd8deadSopenharmony_ci    "The preferred parameters for <format> and <type> may be determined by
2445bd8deadSopenharmony_ci    calling GetIntegerv with the symbolic constants
2455bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE,
2465bd8deadSopenharmony_ci    respectively. The implementation chosen format may vary depending on the
2475bd8deadSopenharmony_ci    format of the selected read buffer of the currently bound read
2485bd8deadSopenharmony_ci    framebuffer.
2495bd8deadSopenharmony_ci    
2505bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by GetIntegerv if pname is
2515bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_FORMAT or IMPLEMENTATION_COLOR_READ_TYPE and
2525bd8deadSopenharmony_ci    any of:
2535bd8deadSopenharmony_ci     - the read framebuffer is not framebuffer complete
2545bd8deadSopenharmony_ci     - the read framebuffer is a framebuffer object, and the selected read buffer
2555bd8deadSopenharmony_ci       (see section 18.2.1) has no image attached
2565bd8deadSopenharmony_ci     - the selected read buffer is NONE
2575bd8deadSopenharmony_ci    "
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ciAdditions to Chapter 22 of the OpenGL 4.4 (Compatibility Profile)
2605bd8deadSopenharmony_ciSpecification (Context State Queries)
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    Modify Section 22.2 (Pointer and String Queries), (p. 648)
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci    "If <name> is SHADING_LANGUAGE_VERSION, ...
2655bd8deadSopenharmony_ci    Version strings "100", "300 es" and "310 es" correspond to the OpenGL
2665bd8deadSopenharmony_ci    ES Shading Language versions 100, 300 and 310, respectively."
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ciAdditions to the OpenGL Shading Language
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
2735bd8deadSopenharmony_ci    language features described in this extension:
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci        #extension GL_ARB_ES3_1_compatibility : <behavior>
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci        #define GL_ARB_ES3_1_compatibility 1
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL Shading Language 4.40.8 Specification
2855bd8deadSopenharmony_ci(Basics)
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci    Modify the paragraph at the bottom of page 16 in Section 3.3
2885bd8deadSopenharmony_ci    (Preprocessor) as follows:
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    "... Shaders that specify #version 100 will be treated as targeting
2915bd8deadSopenharmony_ci    version 1.00 of the OpenGL ES Shading Language. Shaders that specify
2925bd8deadSopenharmony_ci    #version 300 will be treated as targeting version 3.00 of the OpenGL
2935bd8deadSopenharmony_ci    ES Shading Language. Shaders that specify #version 310 will be treated
2945bd8deadSopenharmony_ci    as targeting version 3.10 of the OpenGL ES Shading Language. ..."
2955bd8deadSopenharmony_ci
2965bd8deadSopenharmony_ci    Modify the 3rd paragraph at the top of p16 as follows:
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    A <profile> argument ...
2995bd8deadSopenharmony_ci    If version 300 or 310 is specified, the profile argument is not optional
3005bd8deadSopenharmony_ci    and must be "es", or a compile-time error results. The Language
3015bd8deadSopenharmony_ci    Specification ...
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL Shading Language 4.40.8 Specification
3055bd8deadSopenharmony_ci(Variables and Types)
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci    Modify Section 4.7.2 (Precision Qualifiers)
3085bd8deadSopenharmony_ci    
3095bd8deadSopenharmony_ci    (Replace the first sentence to reference all opaque types instead of just
3105bd8deadSopenharmony_ci    samplers)
3115bd8deadSopenharmony_ci     
3125bd8deadSopenharmony_ci    "Any floating point, integer, or opaque-type declaration can have the
3135bd8deadSopenharmony_ci    type preceded by one of these precision qualifiers: ..."
3145bd8deadSopenharmony_ci    
3155bd8deadSopenharmony_ci    Modify Section 4.7.3 (Default Precision Qualifiers)
3165bd8deadSopenharmony_ci    
3175bd8deadSopenharmony_ci    (Replace the second sentence to reference all opaque types and not just
3185bd8deadSopenharmony_ci    samples)
3195bd8deadSopenharmony_ci    
3205bd8deadSopenharmony_ci    "The type field can be either int or float, any of the opaque types, and
3215bd8deadSopenharmony_ci    the precision-qualifier can be lowp, mediump, or highp. ..."
3225bd8deadSopenharmony_ci
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL Shading Language 4.40.8 Specification
3255bd8deadSopenharmony_ci(Built-in Variables)
3265bd8deadSopenharmony_ci
3275bd8deadSopenharmony_ci    Modify Section 7.1, Built-In Language Variables (p. 122)
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    (Add to list of fragment language built-in variables on page 122)
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci        in bool gl_HelperInvocation;
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci    (Add after the description of gl_SamplePosition on page 127)
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    "The value gl_HelperInvocation is true if the fragment shader invocation is
3365bd8deadSopenharmony_ci    considered a "helper invocation" and is false otherwise.  A "helper
3375bd8deadSopenharmony_ci    invocation" is a fragment-shader invocation that is created solely for the
3385bd8deadSopenharmony_ci    purposes of evaluating derivatives for use in non-helper fragment-shader
3395bd8deadSopenharmony_ci    invocations.  Such derivatives are computed implicitly in the built-in
3405bd8deadSopenharmony_ci    function texture() (see section 8.9 "Texture Functions"), and explicitly in
3415bd8deadSopenharmony_ci    the derivative functions in section 8.13.1 "Derivative Functions", for 
3425bd8deadSopenharmony_ci    example dFdx() and dFdy().
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    Fragment shader helper invocations execute the same shader code as
3455bd8deadSopenharmony_ci    non-helper invocations, but will not have side effects that modify the
3465bd8deadSopenharmony_ci    framebuffer or other shader-accessible memory.  In particular:
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci      * Fragments corresponding to helper invocations are discarded when
3495bd8deadSopenharmony_ci        shader execution is complete, without updating the framebuffer.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci      * Stores to image and buffer variables performed by helper invocations
3525bd8deadSopenharmony_ci        have no effect on the underlying image or buffer memory.
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci      * Atomic operations to image, buffer, or atomic counter variables
3555bd8deadSopenharmony_ci        performed by helper invocations have no effect on the underlying image
3565bd8deadSopenharmony_ci        or buffer memory.  The values returned by such atomic operations are
3575bd8deadSopenharmony_ci        undefined.
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    Helper invocations may be generated for pixels not covered by a primitive
3605bd8deadSopenharmony_ci    being rendered.  While fragment shader inputs qualified with "centroid"
3615bd8deadSopenharmony_ci    are normally required to be sampled in the intersection of the pixel and
3625bd8deadSopenharmony_ci    the primitive, the requirement is ignored for such pixels since there is
3635bd8deadSopenharmony_ci    no intersection between the pixel and primitive.
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    Helper invocations may also be generated for fragments that are covered by
3665bd8deadSopenharmony_ci    a primitive being rendered when the fragment is killed by early fragment
3675bd8deadSopenharmony_ci    tests (using the "early_fragment_tests" qualifier) or where the
3685bd8deadSopenharmony_ci    implementation is able to determine that executing the fragment shader
3695bd8deadSopenharmony_ci    would have no effect other than assisting in computing derivatives for
3705bd8deadSopenharmony_ci    other fragment shader invocations.
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci    The set of helper invocations generated when processing any set of
3735bd8deadSopenharmony_ci    primitives is implementation-dependent."
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci    Add to section 7.3 Built-in Constants
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci        const int gl_MaxSamples = 4;
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci        const int gl_MaxVertexImageUniforms = 0;
3805bd8deadSopenharmony_ci        const int gl_MaxFragmentImageUniforms = 8;
3815bd8deadSopenharmony_ci        const int gl_MaxComputeImageUniforms = 8;
3825bd8deadSopenharmony_ci        const int gl_MaxCombinedImageUniforms = 48;
3835bd8deadSopenharmony_ci        const int gl_MaxCombinedShaderOutputResources = 16;
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL Shading Language 4.40.8 Specification
3865bd8deadSopenharmony_ci(Built-in Functions)
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci    Modify Section 8.3, Common Functions
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci    (Additions to the table listing common built-in functions)
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci      Syntax                       Description
3935bd8deadSopenharmony_ci      ---------------------------  --------------------------------------------------
3945bd8deadSopenharmony_ci      genIType mix(genIType x,     Selects which vector each returned component comes
3955bd8deadSopenharmony_ci                   genIType y,     from. For a component of a that is false, the
3965bd8deadSopenharmony_ci                   genBType a)     corresponding component of x is returned. For a
3975bd8deadSopenharmony_ci      genUType mix(genUType x,     component of a that is true, the corresponding
3985bd8deadSopenharmony_ci                   genUType y,     component of y is returned.
3995bd8deadSopenharmony_ci                   genBType a)
4005bd8deadSopenharmony_ci      genBType mix(genBType x,
4015bd8deadSopenharmony_ci                   genBType y,
4025bd8deadSopenharmony_ci                   genBType a)
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    Modify Section 8.11, Atomic Memory Functions
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci    (Modify the table on page 173 by adding "coherent" qualifier to all memory
4075bd8deadSopenharmony_ci     variables.)
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci      Syntax                                    Description
4105bd8deadSopenharmony_ci      ----------------------------------------  ---------------------------------------------------
4115bd8deadSopenharmony_ci      uint atomicAdd(coherent inout uint mem,   Computes a new value by adding the value of data to
4125bd8deadSopenharmony_ci                     uint data)                 the contents mem.
4135bd8deadSopenharmony_ci      int atomicAdd(coherent inout int mem,
4145bd8deadSopenharmony_ci                    int data)
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ci      uint atomicMin(coherent inout uint mem,   Computes a new value by taking the minimum of the
4175bd8deadSopenharmony_ci                     uint data)                 value of data and the contents of mem.
4185bd8deadSopenharmony_ci      int atomicMin(coherent inout int mem,
4195bd8deadSopenharmony_ci                    int data)
4205bd8deadSopenharmony_ci
4215bd8deadSopenharmony_ci      uint atomicMax(coherent inout uint mem,   Computes a new value by taking the maximum of the
4225bd8deadSopenharmony_ci                    uint data)                  value of data and the contents of mem.
4235bd8deadSopenharmony_ci      int atomicMax(coherent inout int mem,
4245bd8deadSopenharmony_ci                    int data)
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci      uint atomicAnd(coherent inout uint mem,   Computes a new value by performing a bit-wise
4275bd8deadSopenharmony_ci                     uint data)                 AND of the value of data and the contents of mem.
4285bd8deadSopenharmony_ci      int atomicAnd(coherent inout int mem,
4295bd8deadSopenharmony_ci                    int data)
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci      uint atomicOr(coherent inout uint mem,    Computes a new value by performing a bit-wise OR
4325bd8deadSopenharmony_ci                    uint data)                  of the value of data and the contents of mem.
4335bd8deadSopenharmony_ci      int atomicOr(coherent inout int mem,
4345bd8deadSopenharmony_ci                   int data)
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci      uint atomicXor(coherent inout uint mem,   Computes a new value by performing a bit-wise
4375bd8deadSopenharmony_ci                     uint data)                 EXCLUSIVE OR of the value of data and the
4385bd8deadSopenharmony_ci      int atomicXor(coherent inout int mem,     contents of mem.
4395bd8deadSopenharmony_ci                    int data)
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci      uint atomicExchange(                      Computes a new value by simply copying the value
4425bd8deadSopenharmony_ci          coherent inout uint mem,              of data.
4435bd8deadSopenharmony_ci          uint data)
4445bd8deadSopenharmony_ci      int atomicExchange(
4455bd8deadSopenharmony_ci          coherent inout int mem,
4465bd8deadSopenharmony_ci          int data)
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci      uint atomicCompSwap(                      Compares the value of compare and the contents of
4495bd8deadSopenharmony_ci          coherent inout uint mem,              mem. If the values are equal, the new value is given
4505bd8deadSopenharmony_ci          uint compare,                         by data; otherwise, it is taken from the original
4515bd8deadSopenharmony_ci          uint data)                            contents of mem.
4525bd8deadSopenharmony_ci      int atomicCompSwap(
4535bd8deadSopenharmony_ci          coherent inout int mem,
4545bd8deadSopenharmony_ci          int compare,
4555bd8deadSopenharmony_ci          int data)
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci    Modify Section 8.12, Image Functions
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci    (Modify the table section listing imageAtomic* on page 175 by adding
4605bd8deadSopenharmony_ci     the "coherent" qualifier to the image parameter and adding a new
4615bd8deadSopenharmony_ci     imageAtomicExchange function for float data.)
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci      Syntax                          Description
4645bd8deadSopenharmony_ci      ------------------------------  ---------------------------------------------------
4655bd8deadSopenharmony_ci      uint imageAtomicAdd(            Computes a new value by adding the value of data
4665bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      to the contents of the selected texel.
4675bd8deadSopenharmony_ci          uint data)
4685bd8deadSopenharmony_ci      int imageAtomicAdd(
4695bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
4705bd8deadSopenharmony_ci          int data)
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci      uint imageAtomicMin(            Computes a new value by taking the minimum of the
4735bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      value of data and the contents of the selected texel.
4745bd8deadSopenharmony_ci          uint data)
4755bd8deadSopenharmony_ci      int imageAtomicMin(
4765bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
4775bd8deadSopenharmony_ci          int data)
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci      uint imageAtomicMax(            Computes a new value by taking the maximum of the
4805bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      value data and the contents of the selected texel.
4815bd8deadSopenharmony_ci          uint data)
4825bd8deadSopenharmony_ci      int imageAtomicMax(
4835bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
4845bd8deadSopenharmony_ci          int data)
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci      uint imageAtomicAnd(            Computes a new value by performing a bit-wise
4875bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      AND of the value of data and the contents of the
4885bd8deadSopenharmony_ci          uint data)                  selected texel.
4895bd8deadSopenharmony_ci      int imageAtomicAnd(
4905bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
4915bd8deadSopenharmony_ci          int data)
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci      uint imageAtomicOr(             Computes a new value by performing a bit-wise OR
4945bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      of the value of data and the contents of the selected
4955bd8deadSopenharmony_ci          uint data)                  texel.
4965bd8deadSopenharmony_ci      int imageAtomicOr(
4975bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
4985bd8deadSopenharmony_ci          int data)
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci      uint imageAtomicXor(            Computes a new value by performing a bit-wise
5015bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      EXCLUSIVE OR of the value of data and the
5025bd8deadSopenharmony_ci          uint data)                  contents of the selected texel.
5035bd8deadSopenharmony_ci      int imageAtomicXor(
5045bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
5055bd8deadSopenharmony_ci          int data)
5065bd8deadSopenharmony_ci
5075bd8deadSopenharmony_ci      uint imageAtomicExchange(       Computes a new value by simply copying the value of
5085bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      <data>. These functions support 32-bit signed and
5095bd8deadSopenharmony_ci          uint data);                 unsigned integer operands, and 32-bit float operands.
5105bd8deadSopenharmony_ci      int imageAtomicExchange(
5115bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
5125bd8deadSopenharmony_ci          int data);
5135bd8deadSopenharmony_ci      float imageAtomicExchange(
5145bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
5155bd8deadSopenharmony_ci          float data);
5165bd8deadSopenharmony_ci
5175bd8deadSopenharmony_ci      uint imageAtomicCompSwap(       Compares the value of compare and the contents of
5185bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,      the selected texel. If the values are equal, the new
5195bd8deadSopenharmony_ci          uint compare,               value is given by data; otherwise, it is taken from the
5205bd8deadSopenharmony_ci          uint data)                  original value loaded from the texel.
5215bd8deadSopenharmony_ci      int imageAtomicCompSwap(
5225bd8deadSopenharmony_ci          coherent IMAGE_PARAMS,
5235bd8deadSopenharmony_ci          int compare,
5245bd8deadSopenharmony_ci          int data)
5255bd8deadSopenharmony_ci
5265bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci    None
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ciErrors
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci    An INVALID_VALUE is generated by MemoryBarrier or MemoryBarrierByRegion
5335bd8deadSopenharmony_ci    if barriers is not the special value ALL_BARRIER_BITS and any of the
5345bd8deadSopenharmony_ci    unsupported bits are set.
5355bd8deadSopenharmony_ci
5365bd8deadSopenharmony_ciNew State
5375bd8deadSopenharmony_ci
5385bd8deadSopenharmony_ci    (Modify Table 23.64 - Implementation Dependent Values)
5395bd8deadSopenharmony_ci    
5405bd8deadSopenharmony_ci    Remove IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE.
5415bd8deadSopenharmony_ci
5425bd8deadSopenharmony_ci    (Modify Table 23.76 - Implementation Dependent Aggregate Shader Limits)
5435bd8deadSopenharmony_ci
5445bd8deadSopenharmony_ci    Increase the minimum required value of MAX_SHADER_STORAGE_BLOCK_SIZE to 2^27.
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci    (Modify Table 23.85 - Framebuffer Dependent Values)
5475bd8deadSopenharmony_ci    
5485bd8deadSopenharmony_ci    Add the following entries:
5495bd8deadSopenharmony_ci    
5505bd8deadSopenharmony_ci    Get Value                         Type  Get Command  Minimum Value  Description                     Sec
5515bd8deadSopenharmony_ci    --------------------------------  ----  -----------  -------------  ------------------------------  ----
5525bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_TYPE    E     GetIntegerv  -              Implementation preferred pixel  18.2
5535bd8deadSopenharmony_ci                                                                        type*
5545bd8deadSopenharmony_ci    IMPLEMENTATION_COLOR_READ_FORMAT  E     GetIntegerv  -              Implementation preferred pixel  18.2
5555bd8deadSopenharmony_ci                                                                        format*
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci    "* Unlike most framebuffer-dependent state which is queried from the currently bound
5585bd8deadSopenharmony_ci      draw framebuffer, this state is queried from the currently bound read framebuffer."
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ciIssues
5625bd8deadSopenharmony_ci
5635bd8deadSopenharmony_ci    1) With this extension, is OpenGL 4.4 a complete superset of OpenGL ES 3.1?
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci    RESOLVED: No, there are things in OpenGL ES 3.1 that were once in OpenGL
5665bd8deadSopenharmony_ci    but have since been deprecated and removed. There is no plan to bring
5675bd8deadSopenharmony_ci    these back into core OpenGL. Here is a list of those things:
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci     - Application-generated object names.
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci     - Client vertex and index arrays.
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci     - Default vertex array object.
5745bd8deadSopenharmony_ci
5755bd8deadSopenharmony_ci     - ALPHA, LUMINANCE and LUMINANCE_ALPHA pixel formats.
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci     - RED_BITS, GREEN_BITS, BLUE_BITS, DEPTH_BITS and STENCIL_BITS.
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ci     - GENERATE_MIPMAP_HINT and automatic mipmap generation.
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci     - ALIASED_POINT_SIZE_RANGE query.
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci     - Line widths greater than 1.
5845bd8deadSopenharmony_ci
5855bd8deadSopenharmony_ci     - Query of EXTENSIONS with GetString.
5865bd8deadSopenharmony_ci
5875bd8deadSopenharmony_ci    In addition the error FRAMEBUFFER_INCOMPLETE_DIMENSIONS was in ES2 and the
5885bd8deadSopenharmony_ci    token remains in ES3 and above, but ES3 and above cannot generate this
5895bd8deadSopenharmony_ci    error. This has not been added to OpenGL core.
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ciRevision History
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
5945bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------------
5955bd8deadSopenharmony_ci    15    09/19/14  Jon Leech Remove FRONT as valid <attachment>.    
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci    14    09/18/14  Jon Leech Add FRONT and BACK as valid <attachment>s for 
5985bd8deadSopenharmony_ci                              GetFramebufferAttachmentParameteriv (Bug
5995bd8deadSopenharmony_ci                              12695).
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci    13    05/08/14  pdaniell  Allow precision qualifiers to be used with any
6025bd8deadSopenharmony_ci                              opaque type, and not just samplers.
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci    12    05/01/14  pdaniell  Add #extension support.
6055bd8deadSopenharmony_ci
6065bd8deadSopenharmony_ci    11    04/17/14  pdaniell  Improve support for the
6075bd8deadSopenharmony_ci                              IMPLEMENTATION_COLOR_READ_FORMAT and
6085bd8deadSopenharmony_ci                              IMPLEMENTATION_COLOR_READ_TYPE queries to match
6095bd8deadSopenharmony_ci                              the OpenGL ES 3.1 spec.
6105bd8deadSopenharmony_ci    
6115bd8deadSopenharmony_ci    10    04/16/14  pdaniell  Add ES compatibility for calling DrawBuffers
6125bd8deadSopenharmony_ci                              with BACK.
6135bd8deadSopenharmony_ci    
6145bd8deadSopenharmony_ci    9     03/20/14  pdaniell  Update glMemoryBarrierByRegion language to
6155bd8deadSopenharmony_ci                              match latest OpenGL ES 3.1 spec.
6165bd8deadSopenharmony_ci
6175bd8deadSopenharmony_ci    8     03/15/14  dkoch     Update overview to specifically itemize the
6185bd8deadSopenharmony_ci                              additions.
6195bd8deadSopenharmony_ci
6205bd8deadSopenharmony_ci    7     03/13/14  pdaniell  Remove fixes for ARB_vertex_attrib_binding
6215bd8deadSopenharmony_ci                              which have now gone into an OpenGL 4.4 update.
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci    6     03/07/14  pdaniell  Update language for glMemoryBarrierByRegion to
6245bd8deadSopenharmony_ci                              the latest ES 3.1 spec.
6255bd8deadSopenharmony_ci
6265bd8deadSopenharmony_ci    5     03/04/14  pdaniell  Add some more built-in constants for shader
6275bd8deadSopenharmony_ci                              image load store.
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci    4     03/04/14  dkoch     Remove unnecessary edits (Bug 11802).
6305bd8deadSopenharmony_ci
6315bd8deadSopenharmony_ci    3     03/02/14  dkoch     More complete first draft.
6325bd8deadSopenharmony_ci
6335bd8deadSopenharmony_ci    2     02/27/14  pdaniell  Complete the first draft.
6345bd8deadSopenharmony_ci
6355bd8deadSopenharmony_ci    1     12/20/13  pdaniell  Initial draft with overview only.
636