15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OES_geometry_shader
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName String
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OES_geometry_shader
85bd8deadSopenharmony_ci    GL_OES_geometry_point_size
95bd8deadSopenharmony_ci
105bd8deadSopenharmony_ciContact
115bd8deadSopenharmony_ci
125bd8deadSopenharmony_ci    Jon Leech (oddhack 'at' sonic.net)
135bd8deadSopenharmony_ci    Daniel Koch, NVIDIA (dkoch 'at' nvidia.com)
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciContributors
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    Daniel Koch, NVIDIA (dkoch 'at' nvidia.com)
185bd8deadSopenharmony_ci    Pat Brown, NVIDIA (pbrown 'at' nvidia.com)
195bd8deadSopenharmony_ci    Slawomir Grajewski, Intel
205bd8deadSopenharmony_ci    Dominik Witczak, Mobica
215bd8deadSopenharmony_ci    Jesse Hall, Google
225bd8deadSopenharmony_ci    Maurice Ribble, Qualcomm
235bd8deadSopenharmony_ci    Bill Licea-Kane, Qualcomm
245bd8deadSopenharmony_ci    Graham Connor, Imagination
255bd8deadSopenharmony_ci    Ben Bowman, Imagination
265bd8deadSopenharmony_ci    Jonathan Putsman, Imagination
275bd8deadSopenharmony_ci    Contributors to ARB_geometry_shader4
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ciNotice
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci    Copyright (c) 2008-2016 The Khronos Group Inc. Copyright terms at
325bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciSpecification Update Policy
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
375bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
385bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
395bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
405bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
415bd8deadSopenharmony_ci    described in more detail at
425bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Portions Copyright (c) 2013-2014 NVIDIA Corporation.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciStatus
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    Approved by the OpenGL ES Working Group
495bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on November 7, 2014
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciVersion
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    Last Modified Date: May 31, 2016
545bd8deadSopenharmony_ci    Revision: 4
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ciNumber
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    OpenGL ES Extension #210
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ciDependencies
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    OpenGL ES 3.1 and OpenGL ES Shading Language 3.10 are required.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    This specification is written against the OpenGL ES 3.1 (March 17, 2014)
655bd8deadSopenharmony_ci    and OpenGL ES 3.10 Shading Language (March 17, 2014) Specifications.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    OES_shader_io_blocks or EXT_shader_io_blocks is required.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    OES_sample_variables trivially affects the definition of this extension.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    OES_texture_storage_multisample_2d_array affects the definition of this
725bd8deadSopenharmony_ci    extension.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    OES_shader_multisample_interpolation trivially affects the definition of
755bd8deadSopenharmony_ci    this extension.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    OES_texture_buffer and EXT_texture_buffer trivially affect the definition
785bd8deadSopenharmony_ci    of this extension.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ciOverview
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    OES_geometry_shader defines a new shader type available to be run on the
835bd8deadSopenharmony_ci    GPU, called a geometry shader. Geometry shaders are run after vertices are
845bd8deadSopenharmony_ci    transformed, but prior to color clamping, flatshading and clipping.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    A geometry shader begins with a single primitive (point, line,
875bd8deadSopenharmony_ci    triangle). It can read the attributes of any of the vertices in the
885bd8deadSopenharmony_ci    primitive and use them to generate new primitives. A geometry shader has a
895bd8deadSopenharmony_ci    fixed output primitive type (point, line strip, or triangle strip) and
905bd8deadSopenharmony_ci    emits vertices to define a new primitive. A geometry shader can emit
915bd8deadSopenharmony_ci    multiple disconnected primitives. The primitives emitted by the geometry
925bd8deadSopenharmony_ci    shader are clipped and then processed like an equivalent primitive
935bd8deadSopenharmony_ci    specified by the application.
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    Furthermore, OES_geometry_shader provides four additional primitive
965bd8deadSopenharmony_ci    types: lines with adjacency, line strips with adjacency, separate
975bd8deadSopenharmony_ci    triangles with adjacency, and triangle strips with adjacency.  Some of the
985bd8deadSopenharmony_ci    vertices specified in these new primitive types are not part of the
995bd8deadSopenharmony_ci    ordinary primitives, instead they represent neighboring vertices that are
1005bd8deadSopenharmony_ci    adjacent to the two line segment end points (lines/strips) or the three
1015bd8deadSopenharmony_ci    triangle edges (triangles/tstrips). These vertices can be accessed by
1025bd8deadSopenharmony_ci    geometry shaders and used to match up the vertices emitted by the geometry
1035bd8deadSopenharmony_ci    shader with those of neighboring primitives.
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    Since geometry shaders expect a specific input primitive type, an error
1065bd8deadSopenharmony_ci    will occur if the application presents primitives of a different type.
1075bd8deadSopenharmony_ci    For example, if a geometry shader expects points, an error will occur at
1085bd8deadSopenharmony_ci    drawing time if a primitive mode of TRIANGLES is specified.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    This extension also adds the notion of layered framebuffer attachments
1115bd8deadSopenharmony_ci    and framebuffers that can be used in conjunction with geometry shaders
1125bd8deadSopenharmony_ci    to allow programs to direct primitives to a face of a cube map or layer
1135bd8deadSopenharmony_ci    of a three-dimensional texture or two-dimensional array texture. The
1145bd8deadSopenharmony_ci    layer used for rendering can be selected by the geometry shader at run
1155bd8deadSopenharmony_ci    time. The framebuffer layer count present in GL 4.x and removed from
1165bd8deadSopenharmony_ci    ES 3.1 is restored.
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    Not all geometry shader implementations have the ability to write the
1195bd8deadSopenharmony_ci    point size from a geometry shader. Thus a second extension string and
1205bd8deadSopenharmony_ci    shading language enable are provided for implementations which do
1215bd8deadSopenharmony_ci    support geometry shader point size.
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    This extension relies on the OES_shader_io_blocks extension to provide
1245bd8deadSopenharmony_ci    the required functionality for declaring input and output blocks and
1255bd8deadSopenharmony_ci    interfacing between shaders.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ciNew Procedures and Functions
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    void FramebufferTextureOES(enum target, enum attachment,
1305bd8deadSopenharmony_ci                               uint texture, int level);
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ciNew Tokens
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    Accepted by the <type> parameter of CreateShader and
1355bd8deadSopenharmony_ci    CreateShaderProgramv, by the <pname> parameter of
1365bd8deadSopenharmony_ci    GetProgramPipelineiv and returned in the <params> parameter of
1375bd8deadSopenharmony_ci    GetShaderiv when <pname> is SHADER_TYPE:
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci        GEOMETRY_SHADER_OES                             0x8DD9
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    Accepted by the <stages> parameter of UseProgramStages:
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci        GEOMETRY_SHADER_BIT_OES                         0x00000004
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramiv:
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci        GEOMETRY_LINKED_VERTICES_OUT_OES                0x8916
1485bd8deadSopenharmony_ci        GEOMETRY_LINKED_INPUT_TYPE_OES                  0x8917
1495bd8deadSopenharmony_ci        GEOMETRY_LINKED_OUTPUT_TYPE_OES                 0x8918
1505bd8deadSopenharmony_ci        GEOMETRY_SHADER_INVOCATIONS_OES                 0x887F
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1535bd8deadSopenharmony_ci    GetFloatv, and GetInteger64v:
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci        LAYER_PROVOKING_VERTEX_OES                      0x825E
1565bd8deadSopenharmony_ci        MAX_GEOMETRY_UNIFORM_COMPONENTS_OES             0x8DDF
1575bd8deadSopenharmony_ci        MAX_GEOMETRY_UNIFORM_BLOCKS_OES                 0x8A2C
1585bd8deadSopenharmony_ci        MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES    0x8A32
1595bd8deadSopenharmony_ci        MAX_GEOMETRY_INPUT_COMPONENTS_OES               0x9123
1605bd8deadSopenharmony_ci        MAX_GEOMETRY_OUTPUT_COMPONENTS_OES              0x9124
1615bd8deadSopenharmony_ci        MAX_GEOMETRY_OUTPUT_VERTICES_OES                0x8DE0
1625bd8deadSopenharmony_ci        MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES        0x8DE1
1635bd8deadSopenharmony_ci        MAX_GEOMETRY_SHADER_INVOCATIONS_OES             0x8E5A
1645bd8deadSopenharmony_ci        MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES            0x8C29
1655bd8deadSopenharmony_ci        MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES         0x92CF
1665bd8deadSopenharmony_ci        MAX_GEOMETRY_ATOMIC_COUNTERS_OES                0x92D5
1675bd8deadSopenharmony_ci        MAX_GEOMETRY_IMAGE_UNIFORMS_OES                 0x90CD
1685bd8deadSopenharmony_ci        MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES          0x90D7
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    Returned in the <data> parameter from a Get query with a <pname> of
1715bd8deadSopenharmony_ci    LAYER_PROVOKING_VERTEX_OES:
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci        FIRST_VERTEX_CONVENTION_OES                     0x8E4D
1745bd8deadSopenharmony_ci        LAST_VERTEX_CONVENTION_OES                      0x8E4E
1755bd8deadSopenharmony_ci        UNDEFINED_VERTEX_OES                            0x8260
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    Accepted by the <target> parameter of BeginQuery, EndQuery,
1785bd8deadSopenharmony_ci    GetQueryiv, and GetQueryObjectuiv:
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci        PRIMITIVES_GENERATED_OES                        0x8C87
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    Accepted by the <mode> parameter of DrawArrays, DrawElements,
1835bd8deadSopenharmony_ci    and other commands which draw primitives:
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci        LINES_ADJACENCY_OES                             0xA
1865bd8deadSopenharmony_ci        LINE_STRIP_ADJACENCY_OES                        0xB
1875bd8deadSopenharmony_ci        TRIANGLES_ADJACENCY_OES                         0xC
1885bd8deadSopenharmony_ci        TRIANGLE_STRIP_ADJACENCY_OES                    0xD
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    Accepted by the <pname> parameter of FramebufferParameteri,
1915bd8deadSopenharmony_ci    and GetFramebufferParameteriv:
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci        FRAMEBUFFER_DEFAULT_LAYERS_OES                  0x9312
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetIntegerv, GetBooleanv,
1965bd8deadSopenharmony_ci    GetInteger64v, and GetFloatv:
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci        MAX_FRAMEBUFFER_LAYERS_OES                      0x9317
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    Returned by CheckFramebufferStatus:
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci        FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES        0x8DA8
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci    Accepted by the <pname> parameter of
2055bd8deadSopenharmony_ci    GetFramebufferAttachmentParameteriv:
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_LAYERED_OES              0x8DA7
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    Accepted by the <props> parameter of
2105bd8deadSopenharmony_ci    GetProgramResourceiv:
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci        REFERENCED_BY_GEOMETRY_SHADER_OES               0x9309
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ciAdditions to the OpenGL ES 3.1 Specification
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci    Modify chapter 3 "Dataflow Model"
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    Change the second paragraph, on p. 28:
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    ... In the next stage vertices may be transformed, followed by assembly
2215bd8deadSopenharmony_ci    into geometric primitives. Geometry shaders may then optionally generate
2225bd8deadSopenharmony_ci    multiple new primitives from single input primitives. Optionally, the
2235bd8deadSopenharmony_ci    results ...
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    Modify figure 3.1 "Block diagram of the OpenGL ES pipeline" to insert a
2275bd8deadSopenharmony_ci    new box "Geometry Shader" following "Vertex Shader" and preceding
2285bd8deadSopenharmony_ci    "Rasterization". Connect the Geometry Shader box to Transform Feedback
2295bd8deadSopenharmony_ci    and Rasterization boxes, and remove the connection from Vertex Shader to
2305bd8deadSopenharmony_ci    Transform Feedback. Extend the arrows from the boxes "Image Load/Store"
2315bd8deadSopenharmony_ci    .. "Uniform Block" to the right of "Vertex Shader" to connect to the new
2325bd8deadSopenharmony_ci    "Geometry Shader" box.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    Modify section 4.2, "Query Objects and Asynchronous Queries" on p. 36
2365bd8deadSopenharmony_ci    to add to the bullet list of supported query types
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    * Primitive queries with a target of PRIMITIVES_GENERATED_OES (see
2395bd8deadSopenharmony_ci      section 12.2) return information on the number of primitives processed
2405bd8deadSopenharmony_ci      by the GL.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    Replace the two paragraphs of chapter 7, "Programs and Shaders"
2445bd8deadSopenharmony_ci    on p. 64 starting "Shader stages including ..." with:
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci    Shader stages including vertex, geometry, fragment, and compute shaders
2475bd8deadSopenharmony_ci    can be created, compiled, and linked into program objects.
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    Vertex shaders describe the operations that occur on vertex attributes.
2505bd8deadSopenharmony_ci    Geometry shaders affect the processing of primitives assembled from
2515bd8deadSopenharmony_ci    vertices (see section 11.1gs). Fragment shaders affect the processing of
2525bd8deadSopenharmony_ci    fragments during rasterization (see chapter 14). A single program
2535bd8deadSopenharmony_ci    object can contain all of these shaders, or any subset thereof.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    Compute shaders ...
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci    Add to table 7.1 "CreateShader <type> values" on p. 65:
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci        <type>                  Shader Stage
2615bd8deadSopenharmony_ci        -------------------     ---------------
2625bd8deadSopenharmony_ci        GEOMETRY_SHADER_OES     Geometry shader
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    Change bullet list describing reasons for link failure below the
2665bd8deadSopenharmony_ci    LinkProgram command on p. 70:
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci    ... Linking can fail for a variety of reasons as specified in the OpenGL
2695bd8deadSopenharmony_ci    ES Shading Language Specification, as well as any of the following
2705bd8deadSopenharmony_ci    reasons:
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    * One or more of the shader objects attached to <program> are not
2735bd8deadSopenharmony_ci      compiled successfully.
2745bd8deadSopenharmony_ci    * More active uniform or active sampler variables are used in <program>
2755bd8deadSopenharmony_ci      than allowed (see sections 7.6 and 7.9).
2765bd8deadSopenharmony_ci    * The shaders do not use the same shader language version.
2775bd8deadSopenharmony_ci    * <program> contains objects to form a geometry shader (see section
2785bd8deadSopenharmony_ci      11.1gs), and
2795bd8deadSopenharmony_ci      - <program> is not separable and contains no objects to form a
2805bd8deadSopenharmony_ci        vertex shader; or
2815bd8deadSopenharmony_ci      - the input primitive type, output primitive type, or maximum output
2825bd8deadSopenharmony_ci        vertex count is not specified in the compiled geometry shader
2835bd8deadSopenharmony_ci        object.
2845bd8deadSopenharmony_ci    * <program> contains objects to form a compute shader (see section 17)
2855bd8deadSopenharmony_ci      and
2865bd8deadSopenharmony_ci      - <program> also contains objects to form any other type of shader.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    If LinkProgram failed, ...
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci    Modify section 7.3, "Program Objects":
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ci    Add to the second paragraph after UseProgram on p. 71:
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    The executable code ... the results of vertex and/or fragment processing
2965bd8deadSopenharmony_ci    will be undefined. However, this is not an error. If there is no active
2975bd8deadSopenharmony_ci    program for the geometry shader stage, that stage is ignored. If there
2985bd8deadSopenharmony_ci    is no active program for the compute shader stage ...
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    Modify section 7.3.1, "Program Interfaces":
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    Modify table 7.2 "GetProgramResourceiv properties and supported
3045bd8deadSopenharmony_ci    interfaces" on p. 81 to add "REFERENCED_BY_GEOMETRY_SHADER_OES" to the
3055bd8deadSopenharmony_ci    "Property" cell already containing REFERENCED_BY_<stage>_SHADER for
3065bd8deadSopenharmony_ci    VERTEX, FRAGMENT, and COMPUTE stages, with the same supported
3075bd8deadSopenharmony_ci    interfaces.
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ci    Add geometry shaders to the paragraph describing the REFERENCED_BY
3115bd8deadSopenharmony_ci    properties, on p. 83:
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    For the properties REFERENCED_BY_VERTEX_SHADER,
3145bd8deadSopenharmony_ci    REFERENCED_BY_GEOMETRY_SHADER_OES, REFERENCED_BY_FRAGMENT_SHADER, and
3155bd8deadSopenharmony_ci    REFERENCED_BY_COMPUTE_SHADER, a single integer is written to <params>,
3165bd8deadSopenharmony_ci    identifying whether the active resource is referenced by the vertex,
3175bd8deadSopenharmony_ci    geometry, fragment, or compute shaders, respectively, in the program
3185bd8deadSopenharmony_ci    object. ...
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    Modify section 7.4, "Program Pipeline Objects" in the first paragraph
3225bd8deadSopenharmony_ci    paragraph after UseProgramStages on p. 89:
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    ... These stages may include vertex, geometry, fragment, or compute,
3255bd8deadSopenharmony_ci    indicated respectively by VERTEX_SHADER_BIT, GEOMETRY_SHADER_BIT_OES,
3265bd8deadSopenharmony_ci    FRAGMENT_SHADER_BIT, or COMPUTE_SHADER_BIT. ...
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    Modify section 7.4.1, "Shader Interface Matching" on p. 91, changing
3305bd8deadSopenharmony_ci    the second paragraph and adding a new paragraph:
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci    Variables and block members declared as structures ... in the OpenGL ES
3335bd8deadSopenharmony_ci    Shading Language Specification.
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    Geometry shader per-vertex input variables and blocks are required to be
3365bd8deadSopenharmony_ci    declared as arrays, with each element representing input or output
3375bd8deadSopenharmony_ci    values for a single vertex of a multi-vertex primitive. For the purposes
3385bd8deadSopenharmony_ci    of interface matching, such variables and blocks are treated as though
3395bd8deadSopenharmony_ci    they were not declared as arrays.
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci    For program objects containing multiple shaders...
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    Modify section 7.4.2 "Program Pipeline Object State" on p. 92,
3455bd8deadSopenharmony_ci    replacing the first bullet point:
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    * Unsigned integers are required to hold the names of the active program
3485bd8deadSopenharmony_ci      and each of the current vertex, geometry, fragment, and compute stage
3495bd8deadSopenharmony_ci      programs. Each integer is initially zero.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    Modify section 7.6, "Uniform Variables"
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci    Add to table 7.4 "Query targets for default uniform block storage ..."
3555bd8deadSopenharmony_ci    on p. 96:
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    Shader Stage                    <pname> for querying default uniform block
3585bd8deadSopenharmony_ci                                    storage, in components
3595bd8deadSopenharmony_ci    ----------------------------    -------------------------------------------
3605bd8deadSopenharmony_ci    Geometry (see sec. 11.1gs.3)    MAX_GEOMETRY_UNIFORM_COMPONENTS_OES
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci    Add to table 7.5 "Query targets for combined uniform block storage ..."
3645bd8deadSopenharmony_ci    on p. 97:
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    Shader Stage                    <pname> for querying combined uniform block
3685bd8deadSopenharmony_ci                                    storage, in components
3695bd8deadSopenharmony_ci    ----------------------------    --------------------------------------------
3705bd8deadSopenharmony_ci    Geometry                        MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ci    Modify section 7.6.2, "Uniform Blocks" on p. 104, changing the second
3745bd8deadSopenharmony_ci    paragraph of the section:
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ci    There is a set of implementation-dependent maximums for the number of
3775bd8deadSopenharmony_ci    active uniform blocks used by each shader. If the number of uniform
3785bd8deadSopenharmony_ci    blocks used by any shader in the program exceeds its corresponding
3795bd8deadSopenharmony_ci    limit, the program will fail to link. The limits for vertex, geometry,
3805bd8deadSopenharmony_ci    fragment, and compute shaders can be obtained by calling GetIntegerv
3815bd8deadSopenharmony_ci    with <pname> values of MAX_VERTEX_UNIFORM_BLOCKS,
3825bd8deadSopenharmony_ci    MAX_GEOMETRY_UNIFORM_BLOCKS_OES, MAX_FRAGMENT_UNIFORM_BLOCKS, and
3835bd8deadSopenharmony_ci    MAX_COMPUTE_UNIFORM_BLOCKS, respectively.
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    Modify section 7.7, "Atomic Counter Buffers" on p. 108, changing the
3875bd8deadSopenharmony_ci    second paragraph of the section:
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    There is a set of implementation-dependent maximums for the number of
3905bd8deadSopenharmony_ci    active atomic counter buffers referenced by each shader. If the number
3915bd8deadSopenharmony_ci    of atomic counter buffers referenced by any shader in the program
3925bd8deadSopenharmony_ci    exceeds its corresponding limit, the program will fail to link. The
3935bd8deadSopenharmony_ci    limits for vertex, geometry, fragment, and compute shaders can be
3945bd8deadSopenharmony_ci    obtained by calling GetIntegerv with <pname> values of
3955bd8deadSopenharmony_ci    MAX_VERTEX_ATOMIC_COUNTER_BUFFERS,
3965bd8deadSopenharmony_ci    MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES,
3975bd8deadSopenharmony_ci    MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, or
3985bd8deadSopenharmony_ci    MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS, respectively.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci    Modify section 7.8, "Shader Buffer Variables and Shader Storage Blocks"
4025bd8deadSopenharmony_ci    on p. 110, changing the fourth paragraph:
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    If the number of active shader storage blocks referenced by the shaders
4055bd8deadSopenharmony_ci    in a program exceeds implementation-dependent limits, the program will
4065bd8deadSopenharmony_ci    fail to link. The limits for vertex, geometry, fragment, and compute
4075bd8deadSopenharmony_ci    shaders can be obtained by calling GetIntegerv with pname values of
4085bd8deadSopenharmony_ci    MAX_VERTEX_SHADER_STORAGE_BLOCKS,
4095bd8deadSopenharmony_ci    MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES,
4105bd8deadSopenharmony_ci    MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, and
4115bd8deadSopenharmony_ci    MAX_COMPUTE_SHADER_STORAGE_BLOCKS, respectively. Additionally, a ...
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci    Modify section 7.11.1 "Shader Memory Access Ordering" on p. 113 to add
4155bd8deadSopenharmony_ci    to the list of ordering rules:
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    * The relative order of invocations of different shader types is largely
4185bd8deadSopenharmony_ci      undefined. However, when executing a shader whose inputs are generated
4195bd8deadSopenharmony_ci      from a previous programmable stage, the shader invocations from the
4205bd8deadSopenharmony_ci      previous stage are guaranteed to have executed far enough to generate
4215bd8deadSopenharmony_ci      final values for all next-stage inputs. That implies shader completion
4225bd8deadSopenharmony_ci      for all stages except geometry; geometry shaders are guaranteed only
4235bd8deadSopenharmony_ci      to have executed far enough to emit all needed vertices.
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci    Modify section 7.12, "Shader, Program, and Program Pipeline Queries"
4275bd8deadSopenharmony_ci    to add to the list of valid <pname>s for GetProgramiv on p. 121:
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci    If <pname> is GEOMETRY_LINKED_VERTICES_OUT_OES, the maximum number of
4305bd8deadSopenharmony_ci    vertices the geometry shader will output is returned.
4315bd8deadSopenharmony_ci
4325bd8deadSopenharmony_ci    If <pname> is GEOMETRY_LINKED_INPUT_TYPE_OES, the geometry shader input
4335bd8deadSopenharmony_ci    type, which must be one of POINTS, LINES, LINES_ADJACENCY_OES, TRIANGLES
4345bd8deadSopenharmony_ci    or TRIANGLES_ADJACENCY_OES, is returned.
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci    If <pname> is GEOMETRY_LINKED_OUTPUT_TYPE_OES, the current geometry shader
4375bd8deadSopenharmony_ci    output type, which must be one of POINTS, LINE_STRIP or TRIANGLE_STRIP,
4385bd8deadSopenharmony_ci    is returned.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    If <pname> is GEOMETRY_SHADER_INVOCATIONS_OES, the number of geometry
4415bd8deadSopenharmony_ci    shader invocations per primitive will be returned.
4425bd8deadSopenharmony_ci
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    Add to the Errors for GetProgramiv on p. 121:
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if
4475bd8deadSopenharmony_ci    GEOMETRY_LINKED_VERTICES_OUT_OES, GEOMETRY_LINKED_INPUT_TYPE_OES,
4485bd8deadSopenharmony_ci    GEOMETRY_LINKED_OUTPUT_TYPE_OES, or GEOMETRY_SHADER_INVOCATIONS_OES are
4495bd8deadSopenharmony_ci    queried for a program which has not been linked successfully, or which
4505bd8deadSopenharmony_ci    does not contain objects to form a geometry shader,
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci
4535bd8deadSopenharmony_ci    Modify section 7.13 "Required State" to change the last two paragraphs
4545bd8deadSopenharmony_ci    of the section on p. 127:
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci    This list of program object state is not complete. Tables 20.20-20.28
4575bd8deadSopenharmony_ci    describe additional program object state specific to program binaries,
4585bd8deadSopenharmony_ci    geometry shaders, and uniform blocks.
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci    Table 20.29 describes state related to vertex and geometry shaders that
4615bd8deadSopenharmony_ci    is not program object state.
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ci    Modify section 9.2, "Binding and Managing Framebuffer Objects" to add to
4655bd8deadSopenharmony_ci    the list of bullet points for BindFramebuffer on p. 205:
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci    * If the number of layers of each attachment are not all identical,
4685bd8deadSopenharmony_ci      rendering will be limited to the smallest number of layers of any
4695bd8deadSopenharmony_ci      attachment. If there are no attachments, the number of layers will be
4705bd8deadSopenharmony_ci      taken from the framebuffer object's default layer count.
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci    Modify section 9.2.1, "Framebuffer Object Parameters" to replace the
4745bd8deadSopenharmony_ci    second and third paragraphs of the section, adding default and maximum
4755bd8deadSopenharmony_ci    layer counts to FramebufferParameteri, on p. 206 and p. 207:
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    When a framebuffer has one or more attachments, the width, height, layer
4785bd8deadSopenharmony_ci    count (section 9.7gs), sample count, and sample location pattern of the
4795bd8deadSopenharmony_ci    framebuffer are derived from the properties of the framebuffer
4805bd8deadSopenharmony_ci    attachments. When the framebuffer has no attachments, these properties
4815bd8deadSopenharmony_ci    are taken from framebuffer parameters. When <pname> is
4825bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT,
4835bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_LAYERS_OES, FRAMEBUFFER_DEFAULT_SAMPLES, or
4845bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS, the value in <param>
4855bd8deadSopenharmony_ci    specifies the width, height, layer count, sample count, or sample
4865bd8deadSopenharmony_ci    location pattern, respectively, used when the framebuffer has no
4875bd8deadSopenharmony_ci    attachments.
4885bd8deadSopenharmony_ci
4895bd8deadSopenharmony_ci    When a framebuffer has no attachments, it is considered layered (section
4905bd8deadSopenharmony_ci    9.7gs) if and only if the value of FRAMEBUFFER_DEFAULT_LAYERS_OES is
4915bd8deadSopenharmony_ci    non-zero. It is considered to have sample buffers ...
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci
4945bd8deadSopenharmony_ci    Modify the error for invalid parameter values on p. 207 to add
4955bd8deadSopenharmony_ci    layer counts:
4965bd8deadSopenharmony_ci
4975bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <pname> is
4985bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_WIDTH, FRAMEBUFFER_DEFAULT_HEIGHT,
4995bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_LAYERS_OES, or FRAMEBUFFER_DEFAULT_SAMPLES, and
5005bd8deadSopenharmony_ci    <param> is either negative or greater than the value of the
5015bd8deadSopenharmony_ci    corresponding implementation-dependent limits MAX_FRAMEBUFFER_WIDTH,
5025bd8deadSopenharmony_ci    MAX_FRAMEBUFFER_HEIGHT, MAX_FRAMEBUFFER_LAYERS_OES, or
5035bd8deadSopenharmony_ci    MAX_FRAMEBUFFER_SAMPLES, respectively.
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci
5065bd8deadSopenharmony_ci    Replace the bullet list in section 9.2.2, "Attaching Images to
5075bd8deadSopenharmony_ci    Framebuffer Objects" on p. 208:
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci    There are several types of framebuffer-attachable images:
5105bd8deadSopenharmony_ci
5115bd8deadSopenharmony_ci    * The image of a renderbuffer object, which is always two-dimensional.
5125bd8deadSopenharmony_ci    * A single level of a two-dimensional or two-dimensional multisample
5135bd8deadSopenharmony_ci      texture.
5145bd8deadSopenharmony_ci    * A single face of a cube map texture level, which is treated as a
5155bd8deadSopenharmony_ci      two-dimensional image.
5165bd8deadSopenharmony_ci    * A single layer of a two-dimensional array texture, two-dimensional
5175bd8deadSopenharmony_ci      multidimensional array texture, or three-dimensional texture, which is
5185bd8deadSopenharmony_ci      treated as a two-dimensional image.
5195bd8deadSopenharmony_ci
5205bd8deadSopenharmony_ci    Additionally, an entire level of a three-dimensional, cube map,
5215bd8deadSopenharmony_ci    two-dimensional array, or two-dimensional multisample array texture can
5225bd8deadSopenharmony_ci    be attached to an attachment point. Such attachments are treated as an
5235bd8deadSopenharmony_ci    array of two-dimensional images, arranged in layers, and the
5245bd8deadSopenharmony_ci    corresponding attachment point is considered to be <layered> (also see
5255bd8deadSopenharmony_ci    section 9.7gs)
5265bd8deadSopenharmony_ci
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci    Modify section 9.2.3, "Framebuffer Object Queries"
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    In the description of GetFramebufferAttachmentParameteriv for texture
5315bd8deadSopenharmony_ci    attachments, replace the bullet point for
5325bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER on p. 210:
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci    * If <pname> is FRAMEBUFFER_ATTACHMENT_LAYERED_OES then <params> will
5355bd8deadSopenharmony_ci      contain TRUE if an entire level of a three-dimensional, cube map,
5365bd8deadSopenharmony_ci      two-dimensional array, or two-dimensional multisample array texture is
5375bd8deadSopenharmony_ci      attached. Otherwise, <params> will contain FALSE.
5385bd8deadSopenharmony_ci    * If pname is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER; the value of
5395bd8deadSopenharmony_ci      FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is the name of a three-dimensional,
5405bd8deadSopenharmony_ci      or a two-dimensional array texture; and the value of
5415bd8deadSopenharmony_ci      FRAMEBUFFER_ATTACHMENT_LAYERED_OES is FALSE, then <params> will
5425bd8deadSopenharmony_ci      contain the value of the texture layer which contains the attached
5435bd8deadSopenharmony_ci      image.
5445bd8deadSopenharmony_ci
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci    Modify section 9.2.8, "Attaching Texture Images to a Framebuffer" on
5475bd8deadSopenharmony_ci    p. 217:
5485bd8deadSopenharmony_ci
5495bd8deadSopenharmony_ci    The GL supports copying the rendered contents of the framebuffer into
5505bd8deadSopenharmony_ci    the images of a texture object through the use of the routines
5515bd8deadSopenharmony_ci    CopyTexImage* and CopyTexSubImage*. Additionally, the GL supports
5525bd8deadSopenharmony_ci    rendering directly into the images of a texture object.
5535bd8deadSopenharmony_ci
5545bd8deadSopenharmony_ci    To render directly into a texture image, a specified level of a texture
5555bd8deadSopenharmony_ci    object can be attached as one of the logical buffers of the currently
5565bd8deadSopenharmony_ci    bound framebuffer object by calling
5575bd8deadSopenharmony_ci
5585bd8deadSopenharmony_ci      void FramebufferTextureOES(enum target, enum attachment,
5595bd8deadSopenharmony_ci                                 uint texture, int level);
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ci    <target> must be DRAW_FRAMEBUFFER, READ_FRAMEBUFFER, or FRAMEBUFFER.
5625bd8deadSopenharmony_ci    FRAMEBUFFER is equivalent to DRAW_FRAMEBUFFER. <attachment> must be one
5635bd8deadSopenharmony_ci    of the attachment points of the framebuffer listed in table 9.1.
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci    If <texture> is non-zero, the specified mipmap <level> of the texture
5665bd8deadSopenharmony_ci    object named <texture> is attached to the framebuffer attachment point
5675bd8deadSopenharmony_ci    named by <attachment>.
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci    If <texture> is the name of a three-dimensional texture, cube map
5705bd8deadSopenharmony_ci    texture, two-dimensional array, or two-dimensional multisample array
5715bd8deadSopenharmony_ci    texture, the texture level attached to the framebuffer attachment point
5725bd8deadSopenharmony_ci    is an array of images, and the framebuffer attachment is considered
5735bd8deadSopenharmony_ci    <layered>.
5745bd8deadSopenharmony_ci
5755bd8deadSopenharmony_ci    Errors
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if <target> is not DRAW_FRAMEBUFFER,
5785bd8deadSopenharmony_ci    READ_FRAMEBUFFER, or FRAMEBUFFER.
5795bd8deadSopenharmony_ci
5805bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if <attachment> is not one of the
5815bd8deadSopenharmony_ci    attachments in table 9.1.
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if zero is bound to <target>.
5845bd8deadSopenharmony_ci
5855bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <texture> is not the name of a
5865bd8deadSopenharmony_ci    texture object, or if <level> is not a supported texture level for
5875bd8deadSopenharmony_ci    <texture>.
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <texture> is the name of a
5905bd8deadSopenharmony_ci    buffer texture.
5915bd8deadSopenharmony_ci
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    Additionally, a specified image from a texture object can be attached as
5945bd8deadSopenharmony_ci    one of the logical buffers of a currently bound framebuffer object by
5955bd8deadSopenharmony_ci    calling
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci      void FramebufferTexture2D
5985bd8deadSopenharmony_ci
5995bd8deadSopenharmony_ci    ...
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci    The command
6025bd8deadSopenharmony_ci
6035bd8deadSopenharmony_ci      void FramebufferTextureLayer(enum target, enum attachment,
6045bd8deadSopenharmony_ci                                   uint texture, int level, int layer);
6055bd8deadSopenharmony_ci
6065bd8deadSopenharmony_ci    operates similarly to FramebufferTexture2D, except that it attaches a
6075bd8deadSopenharmony_ci    single layer of a three-dimensional, two-dimensional array, or
6085bd8deadSopenharmony_ci    two-dimensional multisample array texture level.
6095bd8deadSopenharmony_ci
6105bd8deadSopenharmony_ci    <target> and <attachment> are specified with the same values, and have
6115bd8deadSopenharmony_ci    the same meanings as the corresponding arguments of
6125bd8deadSopenharmony_ci    FramebufferTexture2D.
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci    <level> specifies the mipmap level of the texture image to be attached
6155bd8deadSopenharmony_ci    to the framebuffer.
6165bd8deadSopenharmony_ci
6175bd8deadSopenharmony_ci    If <texture> is a three-dimensional texture, then <level> must be
6185bd8deadSopenharmony_ci    greater than or equal to zero and less than or equal to log2 of the
6195bd8deadSopenharmony_ci    value of MAX_3D_TEXTURE_SIZE. If <texture> is a two-dimensional array
6205bd8deadSopenharmony_ci    texture, then <level> must be greater than or equal to zero and no
6215bd8deadSopenharmony_ci    larger than log2 of the value of MAX_TEXTURE_SIZE. If <texture> is a
6225bd8deadSopenharmony_ci    two-dimensional multisample array texture, then <level> must be zero.
6235bd8deadSopenharmony_ci
6245bd8deadSopenharmony_ci    <layer> specifies the layer of a two-dimensional image within <texture>.
6255bd8deadSopenharmony_ci
6265bd8deadSopenharmony_ci    Unlike FramebufferTexture2D, no <textarget> parameter is accepted.
6275bd8deadSopenharmony_ci
6285bd8deadSopenharmony_ci    If <texture> is non-zero and the command does not result in an error,
6295bd8deadSopenharmony_ci    the framebuffer attachment state corresponding to <attachment> is
6305bd8deadSopenharmony_ci    updated as in the other FramebufferTexture commands, except that the
6315bd8deadSopenharmony_ci    value of FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is set to <layer>.
6325bd8deadSopenharmony_ci
6335bd8deadSopenharmony_ci    Errors
6345bd8deadSopenharmony_ci
6355bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if <target> is not DRAW_FRAMEBUFFER,
6365bd8deadSopenharmony_ci    READ_FRAMEBUFFER, or FRAMEBUFFER.
6375bd8deadSopenharmony_ci
6385bd8deadSopenharmony_ci    An INVALID_ENUM error is generated if <attachment> is not one of the
6395bd8deadSopenharmony_ci    attachments in table 9.1.
6405bd8deadSopenharmony_ci
6415bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if texture is non-zero and <level>
6425bd8deadSopenharmony_ci    is not a supported texture level for <texture>, as described above.
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <texture> is non-zero and <layer>
6455bd8deadSopenharmony_ci    is larger than the value of MAX_3D_TEXTURE_SIZE minus one (for
6465bd8deadSopenharmony_ci    three-dimensional textures), or larger than the value of
6475bd8deadSopenharmony_ci    MAX_ARRAY_TEXTURE_LAYERS minus one (for array textures).
6485bd8deadSopenharmony_ci
6495bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <texture> is non-zero and <layer>
6505bd8deadSopenharmony_ci    is negative.
6515bd8deadSopenharmony_ci
6525bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <texture> is non-zero and is
6535bd8deadSopenharmony_ci    not the name of a three dimensional, two-dimensional multisample array,
6545bd8deadSopenharmony_ci    or two-dimensional array texture.
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci
6575bd8deadSopenharmony_ci    Modify section 9.2.8.1, "Effects of Attaching a Texture Image" to add
6585bd8deadSopenharmony_ci    to the list of bullet points on p. 220:
6595bd8deadSopenharmony_ci
6605bd8deadSopenharmony_ci    * If FramebufferTextureOES is called and <texture> is the name of a
6615bd8deadSopenharmony_ci      three-dimensional, cube map, two-dimensional multisample array, or
6625bd8deadSopenharmony_ci      two-dimensional array texture, the value of
6635bd8deadSopenharmony_ci      FRAMEBUFFER_ATTACHMENT_LAYERED_OES is set to TRUE; otherwise it is set
6645bd8deadSopenharmony_ci      to FALSE.
6655bd8deadSopenharmony_ci
6665bd8deadSopenharmony_ci
6675bd8deadSopenharmony_ci    Modify section 9.4.1, "Framebuffer Completeness" to replace the bullet
6685bd8deadSopenharmony_ci    point starting "If <image> is a three-dimensional texture" on p. 223:
6695bd8deadSopenharmony_ci
6705bd8deadSopenharmony_ci    * If <image> is a three-dimensional texture or a two-dimensional array
6715bd8deadSopenharmony_ci      texture and the attachment is not layered, the selected layer is less
6725bd8deadSopenharmony_ci      than the depth or layer count, respectively, of the texture.
6735bd8deadSopenharmony_ci
6745bd8deadSopenharmony_ci    * If <image> is a three-dimensional texture or a two-dimensional array
6755bd8deadSopenharmony_ci      texture and the attachment is layered, the depth or layer count,
6765bd8deadSopenharmony_ci      respectively, of the texture is less than or equal to the value of
6775bd8deadSopenharmony_ci      MAX_FRAMEBUFFER_LAYERS_OES.
6785bd8deadSopenharmony_ci
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci    Modify section 9.4.2 "Whole Framebuffer Completeness" to add to the list
6815bd8deadSopenharmony_ci    of bullet points on p. 224:
6825bd8deadSopenharmony_ci
6835bd8deadSopenharmony_ci    * If any framebuffer attachment is layered, all populated attachments
6845bd8deadSopenharmony_ci      must be layered. Additionally, all populated color attachments must be
6855bd8deadSopenharmony_ci      from textures of the same target (i.e., three-dimensional, cube map,
6865bd8deadSopenharmony_ci      two-dimensional array, or two-dimensional multisample array textures).
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ci      { FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES }
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci
6915bd8deadSopenharmony_ci    Add new section 9.7gs on p. 229, following existing section 9.7
6925bd8deadSopenharmony_ci    "Conversion to RGBA Values":
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ci    Section 9.7gs Layered Framebuffers
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci    A framebuffer is considered to be layered if it is complete and all of
6975bd8deadSopenharmony_ci    its populated attachments are layered. When rendering to a layered
6985bd8deadSopenharmony_ci    framebuffer, each fragment generated by the GL is assigned a layer
6995bd8deadSopenharmony_ci    number. The layer number for a fragment is zero if
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci      * geometry shaders are disabled, or
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci      * the current geometry shader does not statically assign a value to
7045bd8deadSopenharmony_ci        the built-in output variable "gl_Layer".
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    Otherwise, the layer for each point, line, or triangle emitted by the
7075bd8deadSopenharmony_ci    geometry shader is taken from the "gl_Layer" output of one of the
7085bd8deadSopenharmony_ci    vertices of the primitive. The vertex used is implementation-dependent
7095bd8deadSopenharmony_ci    and may be queried as described in section 11.1gs.4.
7105bd8deadSopenharmony_ci    To get defined results, all vertices of each primitive emitted should
7115bd8deadSopenharmony_ci    set the same value for "gl_Layer". Since the "EndPrimitive" built-in
7125bd8deadSopenharmony_ci    function starts a new output primitive, defined results can be achieved
7135bd8deadSopenharmony_ci    if "EndPrimitive" is called between two vertices emitted with different
7145bd8deadSopenharmony_ci    layer numbers. A layer number written by a geometry shader has no effect
7155bd8deadSopenharmony_ci    if the framebuffer is not layered.
7165bd8deadSopenharmony_ci
7175bd8deadSopenharmony_ci    When fragments are written to a layered framebuffer, the fragment's
7185bd8deadSopenharmony_ci    layer number selects a single image from the array of images at each
7195bd8deadSopenharmony_ci    attachment point to use for the stencil test (see section 4.1.4), depth
7205bd8deadSopenharmony_ci    buffer test (see section 4.1.5), and for blending and color buffer
7215bd8deadSopenharmony_ci    writes (see section 4.1.7). If the fragment's layer number is negative,
7225bd8deadSopenharmony_ci    or greater than or equal to the minimum number of layers of any
7235bd8deadSopenharmony_ci    attachment, the effects of the fragment on the framebuffer contents are
7245bd8deadSopenharmony_ci    undefined.
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci    When the Clear or ClearBuffer* commands are used to clear a layered
7275bd8deadSopenharmony_ci    framebuffer attachment, all layers of the attachment are cleared.
7285bd8deadSopenharmony_ci
7295bd8deadSopenharmony_ci    When commands such as ReadPixels read from a layered framebuffer, the
7305bd8deadSopenharmony_ci    image at layer zero of the selected attachment is always used to obtain
7315bd8deadSopenharmony_ci    pixel values.
7325bd8deadSopenharmony_ci
7335bd8deadSopenharmony_ci    When cube map texture levels are attached to a layered framebuffer, there
7345bd8deadSopenharmony_ci    are six layers attached, numbered zero through five.  Each layer number is
7355bd8deadSopenharmony_ci    mapped to a cube map face, as indicated in table 8.25.
7365bd8deadSopenharmony_ci
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci    Modify section 10.1, "Primitive Types" to add new figure 10.X1 and new
7395bd8deadSopenharmony_ci    sections 10.1.7la, 10.1.7lsa, 10.1.7ta, and 10.1.7tsa following section
7405bd8deadSopenharmony_ci    10.1.7, "Separate Triangles", on p. 234:
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci
7435bd8deadSopenharmony_ci    Section 10.1.7la Lines with Adjacency
7445bd8deadSopenharmony_ci
7455bd8deadSopenharmony_ci    Add figure 10.X1:
7465bd8deadSopenharmony_ci
7475bd8deadSopenharmony_ci        1 - - - 2----->3 - - - 4     1 - - - 2--->3--->4--->5 - - - 6
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci        5 - - - 6----->7 - - - 8
7505bd8deadSopenharmony_ci
7515bd8deadSopenharmony_ci               (a)                             (b)
7525bd8deadSopenharmony_ci
7535bd8deadSopenharmony_ci      Figure 10.X1 (a) Lines with adjacency, (b) Line strip with adjacency.
7545bd8deadSopenharmony_ci      The vertices connected with solid lines belong to the main primitives;
7555bd8deadSopenharmony_ci      the vertices connected by dashed lines are the adjacent vertices that
7565bd8deadSopenharmony_ci      may be used in a geometry shader.
7575bd8deadSopenharmony_ci
7585bd8deadSopenharmony_ci    Lines with adjacency are specified with <mode> LINES_ADJACENCY_OES, and
7595bd8deadSopenharmony_ci    are independent line segments where each endpoint has a corresponding
7605bd8deadSopenharmony_ci    "adjacent" vertex that can be accessed by a geometry shader (see section
7615bd8deadSopenharmony_ci    11.1gs). If a geometry shader is not active, the "adjacent" vertices are
7625bd8deadSopenharmony_ci    ignored.
7635bd8deadSopenharmony_ci
7645bd8deadSopenharmony_ci    A line segment is drawn from the 4i + 2nd vertex to the 4i + 3rd vertex
7655bd8deadSopenharmony_ci    for each i = 0, 1, ... , n-1, where there are 4n+k vertices passed. k is
7665bd8deadSopenharmony_ci    either 0, 1, 2, or 3; if k is not zero, the final k vertices are
7675bd8deadSopenharmony_ci    ignored. For line segment i, the 4i + 1st and 4i + 4th vertices are
7685bd8deadSopenharmony_ci    considered adjacent to the 4i + 2nd and 4i + 3rd vertices, respectively.
7695bd8deadSopenharmony_ci    See Figure 10.X1.
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci
7725bd8deadSopenharmony_ci    Section 10.1.7lsa Line Strips with Adjacency
7735bd8deadSopenharmony_ci
7745bd8deadSopenharmony_ci    Line strips with adjacency are specified with <mode>
7755bd8deadSopenharmony_ci    LINE_STRIP_ADJACENCY_OES and are similar to line strips, except that
7765bd8deadSopenharmony_ci    each line segment has a pair of adjacent vertices that can be accessed
7775bd8deadSopenharmony_ci    by a geometry shader. If a geometry shader is not active, the "adjacent"
7785bd8deadSopenharmony_ci    vertices are ignored.
7795bd8deadSopenharmony_ci
7805bd8deadSopenharmony_ci    A line segment is drawn from the i + 2nd vertex to the i + 3rd vertex
7815bd8deadSopenharmony_ci    for each i = 0, 1, ..., n-1, where there are n+3 vertices passed. If
7825bd8deadSopenharmony_ci    there are fewer than four vertices, all vertices are ignored. For line
7835bd8deadSopenharmony_ci    segment i, the i + 1st and i + 4th vertex are considered adjacent to the
7845bd8deadSopenharmony_ci    i + 2nd and i + 3rd vertices, respectively. See Figure 10.X1.
7855bd8deadSopenharmony_ci
7865bd8deadSopenharmony_ci
7875bd8deadSopenharmony_ci    Section 10.1.7ta Triangles with Adjacency
7885bd8deadSopenharmony_ci
7895bd8deadSopenharmony_ci    Add new figure 10.X2:
7905bd8deadSopenharmony_ci
7915bd8deadSopenharmony_ci                   2 - - - 3 - - - 4     8 - - - 9 - - - 10
7925bd8deadSopenharmony_ci                           ^\                    ^\
7935bd8deadSopenharmony_ci                     \     | \     |       \     | \     |
7945bd8deadSopenharmony_ci                           |  \                  |  \
7955bd8deadSopenharmony_ci                       \   |   \   |         \   |   \   |
7965bd8deadSopenharmony_ci                           |    \                |    \
7975bd8deadSopenharmony_ci                         \ |     \ |           \ |     \ |
7985bd8deadSopenharmony_ci                           |      v              |      v
7995bd8deadSopenharmony_ci                           1<------5             7<------11
8005bd8deadSopenharmony_ci
8015bd8deadSopenharmony_ci                             \     |               \     |
8025bd8deadSopenharmony_ci
8035bd8deadSopenharmony_ci                               \   |                 \   |
8045bd8deadSopenharmony_ci
8055bd8deadSopenharmony_ci                                 \ |                   \ |
8065bd8deadSopenharmony_ci
8075bd8deadSopenharmony_ci                                   6                     12
8085bd8deadSopenharmony_ci
8095bd8deadSopenharmony_ci      Figure 10.X2 Triangles with adjacency.  The vertices connected with solid
8105bd8deadSopenharmony_ci      lines belong to the main primitive; the vertices connected by dashed
8115bd8deadSopenharmony_ci      lines are the adjacent vertices that may be used in a geometry shader.
8125bd8deadSopenharmony_ci
8135bd8deadSopenharmony_ci
8145bd8deadSopenharmony_ci    Triangles with adjacency are specified with <mode> TRIANGLES_ADJACENCY_OES,
8155bd8deadSopenharmony_ci    and are similar to separate triangles except that
8165bd8deadSopenharmony_ci    each triangle edge has an adjacent vertex that can be accessed by a
8175bd8deadSopenharmony_ci    geometry shader.  If a geometry shader is not active, the
8185bd8deadSopenharmony_ci    "adjacent" vertices are ignored.
8195bd8deadSopenharmony_ci
8205bd8deadSopenharmony_ci    The 6i + 1st, 6i + 3rd, and 6i + 5th vertices (in that order) determine a
8215bd8deadSopenharmony_ci    triangle for each i = 0, 1, ..., n-1, where there are 6n+k vertices
8225bd8deadSopenharmony_ci    passed. k is either 0, 1, 2, 3, 4, or 5; if k is
8235bd8deadSopenharmony_ci    non-zero, the final k vertices are ignored.  For triangle i, the i + 2nd,
8245bd8deadSopenharmony_ci    i + 4th, and i + 6th vertices are considered adjacent to edges from the i
8255bd8deadSopenharmony_ci    + 1st to the i + 3rd, from the i + 3rd to the i + 5th, and from the i +
8265bd8deadSopenharmony_ci    5th to the i + 1st vertices, respectively.  See Figure 10.X2.
8275bd8deadSopenharmony_ci
8285bd8deadSopenharmony_ci
8295bd8deadSopenharmony_ci    Section 10.1.7 tsa Triangle Strips with Adjacency
8305bd8deadSopenharmony_ci
8315bd8deadSopenharmony_ci    Add figure 10.X3:
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci                                  6                     6
8345bd8deadSopenharmony_ci
8355bd8deadSopenharmony_ci                                  | \                   | \
8365bd8deadSopenharmony_ci
8375bd8deadSopenharmony_ci                                  |   \                 |   \
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci                                  |     \               |     \
8405bd8deadSopenharmony_ci
8415bd8deadSopenharmony_ci      2 - - - 3- - - >6   2 - - - 3------>7     2 - - - 3------>7- - - 10
8425bd8deadSopenharmony_ci              ^\                  ^^      |             ^^      ^^      |
8435bd8deadSopenharmony_ci        \     | \     |     \     | \     | \     \     | \     | \
8445bd8deadSopenharmony_ci              |  \                |  \    |             |  \    |  \    |
8455bd8deadSopenharmony_ci          \   |   \   |       \   |   \   |   \     \   |   \   |   \
8465bd8deadSopenharmony_ci              |    \              |    \  |             |    \  |    \  |
8475bd8deadSopenharmony_ci            \ |     \ |         \ |     \ |     \     \ |     \ |     \
8485bd8deadSopenharmony_ci              |      v            |      vv             |      vv      v|
8495bd8deadSopenharmony_ci              1<------5           1<------5 - - - 8     1<------5<------9
8505bd8deadSopenharmony_ci
8515bd8deadSopenharmony_ci                \     |             \     |               \     | \     |
8525bd8deadSopenharmony_ci
8535bd8deadSopenharmony_ci                  \   |               \   |                 \   |   \   |
8545bd8deadSopenharmony_ci
8555bd8deadSopenharmony_ci                    \ |                 \ |                   \ |     \ |
8565bd8deadSopenharmony_ci
8575bd8deadSopenharmony_ci                      4                   4                     4       8
8585bd8deadSopenharmony_ci
8595bd8deadSopenharmony_ci
8605bd8deadSopenharmony_ci                                   6       10
8615bd8deadSopenharmony_ci
8625bd8deadSopenharmony_ci                                   | \     | \
8635bd8deadSopenharmony_ci
8645bd8deadSopenharmony_ci                                   |   \   |   \
8655bd8deadSopenharmony_ci
8665bd8deadSopenharmony_ci                                   |     \ |     \
8675bd8deadSopenharmony_ci                           2 - - - 3------>7------>11
8685bd8deadSopenharmony_ci                                   ^^      ^^      |
8695bd8deadSopenharmony_ci                             \     | \     | \     | \
8705bd8deadSopenharmony_ci                                   |  \    |  \    |
8715bd8deadSopenharmony_ci                               \   |   \   |   \   |   \
8725bd8deadSopenharmony_ci                                   |    \  |    \  |
8735bd8deadSopenharmony_ci                                 \ |     \ |     \ |     \
8745bd8deadSopenharmony_ci                                   |      vv      vv
8755bd8deadSopenharmony_ci                                   1<------5<------9 - - - 12
8765bd8deadSopenharmony_ci
8775bd8deadSopenharmony_ci                                     \     | \     |
8785bd8deadSopenharmony_ci
8795bd8deadSopenharmony_ci                                       \   |   \   |
8805bd8deadSopenharmony_ci
8815bd8deadSopenharmony_ci                                         \ |     \ |
8825bd8deadSopenharmony_ci
8835bd8deadSopenharmony_ci                                           4       8
8845bd8deadSopenharmony_ci
8855bd8deadSopenharmony_ci      Figure 10.X3 Triangle strips with adjacency.  The vertices connected with
8865bd8deadSopenharmony_ci      solid lines belong to the main primitives; the vertices connected by
8875bd8deadSopenharmony_ci      dashed lines are the adjacent vertices that may be used in a geometry
8885bd8deadSopenharmony_ci      shader.
8895bd8deadSopenharmony_ci
8905bd8deadSopenharmony_ci    Triangle strips with adjacency are specified with <mode>
8915bd8deadSopenharmony_ci    TRIANGLE_STRIP_ADJACENCY_OES and are similar to triangle strips except that
8925bd8deadSopenharmony_ci    each line triangle edge has an adjacent vertex that can be accessed by a
8935bd8deadSopenharmony_ci    geometry shader (see section 11.1gs). If a geometry shader is not
8945bd8deadSopenharmony_ci    active, the "adjacent" vertices are ignored.
8955bd8deadSopenharmony_ci
8965bd8deadSopenharmony_ci    In triangle strips with adjacency, n triangles are drawn where there are
8975bd8deadSopenharmony_ci    2 * (n+2) + k vertices passed.  k is either 0 or 1; if k is 1, the
8985bd8deadSopenharmony_ci    final vertex is ignored.  If there are fewer than 6 vertices,
8995bd8deadSopenharmony_ci    the entire primitive is ignored.  Table 10.X1 describes
9005bd8deadSopenharmony_ci    the vertices and order used to draw each triangle, and which vertices are
9015bd8deadSopenharmony_ci    considered adjacent to each edge of the triangle.  See Figure 10.X3.
9025bd8deadSopenharmony_ci
9035bd8deadSopenharmony_ci
9045bd8deadSopenharmony_ci    Add table 10.X1:
9055bd8deadSopenharmony_ci
9065bd8deadSopenharmony_ci                                 primitive          adjacent
9075bd8deadSopenharmony_ci                                 vertices           vertices
9085bd8deadSopenharmony_ci      primitive               1st   2nd   3rd     1/2  2/3  3/1
9095bd8deadSopenharmony_ci      ---------------        ----  ----  ----    ---- ---- ----
9105bd8deadSopenharmony_ci      only (i==0, n==1)        1     3     5       2    6    4
9115bd8deadSopenharmony_ci      first (i==0)             1     3     5       2    7    4
9125bd8deadSopenharmony_ci      middle (i odd)         2i+3  2i+1  2i+5    2i-1 2i+4 2i+7
9135bd8deadSopenharmony_ci      middle (i even)        2i+1  2i+3  2i+5    2i-1 2i+7 2i+4
9145bd8deadSopenharmony_ci      last (i==n-1, i odd)   2i+3  2i+1  2i+5    2i-1 2i+4 2i+6
9155bd8deadSopenharmony_ci      last (i==n-1, i even)  2i+1  2i+3  2i+5    2i-1 2i+6 2i+4
9165bd8deadSopenharmony_ci
9175bd8deadSopenharmony_ci      Table 10.X1:  Triangles generated by triangle strips with adjacency.
9185bd8deadSopenharmony_ci      Each triangle is drawn using the vertices in the "1st", "2nd", and "3rd"
9195bd8deadSopenharmony_ci      columns under "primitive vertices", in that order.  The vertices in the
9205bd8deadSopenharmony_ci      "1/2", "2/3", and "3/1" columns under "adjacent vertices" are considered
9215bd8deadSopenharmony_ci      adjacent to the edges from the first to the second, from the second to
9225bd8deadSopenharmony_ci      the third, and from the third to the first vertex of the triangle,
9235bd8deadSopenharmony_ci      respectively.  The six rows correspond to the six cases:  the first and
9245bd8deadSopenharmony_ci      only triangle (i=0, n=1), the first triangle of several (i=0, n>0),
9255bd8deadSopenharmony_ci      "odd" middle triangles (i=1,3,5...), "even" middle triangles
9265bd8deadSopenharmony_ci      (i=2,4,6,...), and special cases for the last triangle,
9275bd8deadSopenharmony_ci      when i is either even or odd.  For the purposes of this
9285bd8deadSopenharmony_ci      table, the first vertex passed is numbered "1" and the
9295bd8deadSopenharmony_ci      first triangle is numbered "0".
9305bd8deadSopenharmony_ci
9315bd8deadSopenharmony_ci
9325bd8deadSopenharmony_ci    Modify section 10.5, "Drawing Commands using Vertex Arrays"
9335bd8deadSopenharmony_ci
9345bd8deadSopenharmony_ci    On p. 250 in the errors section for the DrawArraysIndirect command,
9355bd8deadSopenharmony_ci    and on p. 254 in the errors section for the DrawElementsIndirect command,
9365bd8deadSopenharmony_ci    delete the errors which state:
9375bd8deadSopenharmony_ci
9385bd8deadSopenharmony_ci    "An INVALID_OPERATION error is generated if transform feedback is
9395bd8deadSopenharmony_ci    active and not paused."
9405bd8deadSopenharmony_ci
9415bd8deadSopenharmony_ci    (thus allowing transform feedback to work with indirect draw commands).
9425bd8deadSopenharmony_ci
9435bd8deadSopenharmony_ci
9445bd8deadSopenharmony_ci    Modify section 11.1.2.1, "Output Variables" on p. 262, starting with the
9455bd8deadSopenharmony_ci    second paragraph of the section:
9465bd8deadSopenharmony_ci
9475bd8deadSopenharmony_ci    The OpenGL ES Shading Language specification also defines a
9485bd8deadSopenharmony_ci    set of built-in outputs that vertex shaders can write to (see
9495bd8deadSopenharmony_ci    section 7.1 ("Built-In Language Variables") of the OpenGL ES Shading
9505bd8deadSopenharmony_ci    Language Specification). These output variables
9515bd8deadSopenharmony_ci    are used to communicate values to the next active stage in the
9525bd8deadSopenharmony_ci    vertex processing pipeline; either the geometry shader, or the
9535bd8deadSopenharmony_ci    fixed-function vertex processing stages leading to rasterization.
9545bd8deadSopenharmony_ci
9555bd8deadSopenharmony_ci    If the output variables are passed directly to the vertex processing
9565bd8deadSopenharmony_ci    stages leading to rasterization, the values of all outputs are expected
9575bd8deadSopenharmony_ci    to be interpolated across the primitive being rendered, unless
9585bd8deadSopenharmony_ci    flatshaded. Otherwise the values of all outputs are collected by the
9595bd8deadSopenharmony_ci    primitive assembly stage and passed on to the subsequent pipeline stage
9605bd8deadSopenharmony_ci    once enough data for one primitive has been collected.
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ci    The number of components (individual scalar numeric values) of output
9635bd8deadSopenharmony_ci    variables that can be written by the vertex shader, whether or not a
9645bd8deadSopenharmony_ci    geometry shader is active, is given by the value of the
9655bd8deadSopenharmony_ci    implementation-dependent constant MAX_VERTEX_OUTPUT_COMPONENTS.
9665bd8deadSopenharmony_ci    For the purposes of counting input and output components
9675bd8deadSopenharmony_ci    consumed by a shader, variables declared as vectors, matrices, and
9685bd8deadSopenharmony_ci    arrays will all consume multiple components.
9695bd8deadSopenharmony_ci
9705bd8deadSopenharmony_ci    When a program is linked...
9715bd8deadSopenharmony_ci
9725bd8deadSopenharmony_ci    Additionally, when linking a program containing only a vertex and
9735bd8deadSopenharmony_ci    fragment shader, there is a limit on the total number of components...
9745bd8deadSopenharmony_ci
9755bd8deadSopenharmony_ci    Each program object can specify a set of output variables from one
9765bd8deadSopenharmony_ci    shader to be recorded in transform feedback mode (see section 12.1).
9775bd8deadSopenharmony_ci    The variables that can be recorded are those emitted by the first active
9785bd8deadSopenharmony_ci    shader, in order, from the following list:
9795bd8deadSopenharmony_ci
9805bd8deadSopenharmony_ci    * geometry shader
9815bd8deadSopenharmony_ci    * vertex shader
9825bd8deadSopenharmony_ci
9835bd8deadSopenharmony_ci    The set of variables to record is specified with the command
9845bd8deadSopenharmony_ci
9855bd8deadSopenharmony_ci    void TransformFeedbackVaryings ...
9865bd8deadSopenharmony_ci
9875bd8deadSopenharmony_ci
9885bd8deadSopenharmony_ci    Modify starting with the list of TransformFeedbackVaryings link failures
9895bd8deadSopenharmony_ci    on p. 263:
9905bd8deadSopenharmony_ci
9915bd8deadSopenharmony_ci    ... A program will fail to link if:
9925bd8deadSopenharmony_ci
9935bd8deadSopenharmony_ci    * the <count> specified by TransformFeedbackVaryings is non-zero, but
9945bd8deadSopenharmony_ci      the program object has no vertex or geometry shader;
9955bd8deadSopenharmony_ci    * any variable name specified in the <varyings> array is not declared as
9965bd8deadSopenharmony_ci      a built-in or user-defined output variable in the shader stage whose
9975bd8deadSopenharmony_ci      outputs can be recorded;
9985bd8deadSopenharmony_ci    * any two entries in the <varyings> array specify the same output
9995bd8deadSopenharmony_ci      variable;
10005bd8deadSopenharmony_ci    * the total number of components to capture in any output in <varyings>
10015bd8deadSopenharmony_ci      is greater than the value of
10025bd8deadSopenharmony_ci      MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and the buffer mode is
10035bd8deadSopenharmony_ci      SEPARATE_ATTRIBS; or
10045bd8deadSopenharmony_ci    * the total number of components to capture is greater than the value of
10055bd8deadSopenharmony_ci      MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and the buffer mode is
10065bd8deadSopenharmony_ci      INTERLEAVED_ATTRIBS.
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci    When a program is linked ...
10095bd8deadSopenharmony_ci
10105bd8deadSopenharmony_ci
10115bd8deadSopenharmony_ci    Modify section 11.1.3 "Shader Execution"
10125bd8deadSopenharmony_ci
10135bd8deadSopenharmony_ci    Change the first paragraph of the section on p. 264:
10145bd8deadSopenharmony_ci
10155bd8deadSopenharmony_ci    If there is an active program object present for the vertex or geometry
10165bd8deadSopenharmony_ci    shader stages, the executable code for those active programs is used to
10175bd8deadSopenharmony_ci    process incoming vertex values. The following sequence of operations is
10185bd8deadSopenharmony_ci    performed:
10195bd8deadSopenharmony_ci
10205bd8deadSopenharmony_ci    * Vertices are processed by the vertex shader (see section 11.1) and
10215bd8deadSopenharmony_ci      assembled into primitives as described in sections 10.1 through 10.3.
10225bd8deadSopenharmony_ci    * If the current program contains a geometry shader, each individual
10235bd8deadSopenharmony_ci      primitive is processed by the geometry shader (see section 11.1gs).
10245bd8deadSopenharmony_ci      Otherwise, primitives are passed through unmodified. If active, the
10255bd8deadSopenharmony_ci      geometry shader consumes its input primitive. However, each geometry
10265bd8deadSopenharmony_ci      shader invocation may emit new vertices, which are arranged into
10275bd8deadSopenharmony_ci      primitives and passed to subsequent pipeline stages.
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ci    Following shader execution, the fixed-function operations described in
10305bd8deadSopenharmony_ci    chapter 12 are applied.
10315bd8deadSopenharmony_ci
10325bd8deadSopenharmony_ci    Special considerations for ...
10335bd8deadSopenharmony_ci
10345bd8deadSopenharmony_ci
10355bd8deadSopenharmony_ci    Rename section 11.1.3.1 "Shader Texturing" to "Shader Only Texturing"
10365bd8deadSopenharmony_ci    on p. 264.
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci
10395bd8deadSopenharmony_ci    Modify the bullet list in section 11.1.3.5 "Texture Access" on p. 266 to
10405bd8deadSopenharmony_ci    add a limit for geometry shaders:
10415bd8deadSopenharmony_ci
10425bd8deadSopenharmony_ci    * MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES (for geometry shaders)
10435bd8deadSopenharmony_ci
10445bd8deadSopenharmony_ci
10455bd8deadSopenharmony_ci    Modify the bullet list in section 11.1.3.6 "Atomic Counter Access" on p.
10465bd8deadSopenharmony_ci    268 to add a limit for geometry shaders:
10475bd8deadSopenharmony_ci
10485bd8deadSopenharmony_ci    * MAX_GEOMETRY_ATOMIC_COUNTERS_OES (for geometry shaders)
10495bd8deadSopenharmony_ci
10505bd8deadSopenharmony_ci
10515bd8deadSopenharmony_ci    Modify the bullet list in section 11.1.3.7 "Image Access" on p. 268 to
10525bd8deadSopenharmony_ci    add a limit for geometry shaders:
10535bd8deadSopenharmony_ci
10545bd8deadSopenharmony_ci    * MAX_GEOMETRY_IMAGE_UNIFORMS_OES (for geometry shaders)
10555bd8deadSopenharmony_ci
10565bd8deadSopenharmony_ci
10575bd8deadSopenharmony_ci    Modify the bullet list in section 11.1.3.8 "Shader Storage Buffer
10585bd8deadSopenharmony_ci    Access" on p. 268 to add a limit for geometry shaders:
10595bd8deadSopenharmony_ci
10605bd8deadSopenharmony_ci    * MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES (for geometry shaders)
10615bd8deadSopenharmony_ci
10625bd8deadSopenharmony_ci
10635bd8deadSopenharmony_ci
10645bd8deadSopenharmony_ci    Modify section 11.1.3.11 "Validation" to add to the list of validation
10655bd8deadSopenharmony_ci    errors on p. 270:
10665bd8deadSopenharmony_ci
10675bd8deadSopenharmony_ci    * One program object is active for at least two shader stages and a
10685bd8deadSopenharmony_ci      second program is active for a shader stage between two stages for
10695bd8deadSopenharmony_ci      which the first program was active.
10705bd8deadSopenharmony_ci
10715bd8deadSopenharmony_ci    * There is an active program for the geometry stage with corresponding
10725bd8deadSopenharmony_ci      executable shader, but there is no active program with an executable
10735bd8deadSopenharmony_ci      vertex shader.
10745bd8deadSopenharmony_ci
10755bd8deadSopenharmony_ci
10765bd8deadSopenharmony_ci    Add new section 11.1gs, "Geometry Shaders" on p. 272, following
10775bd8deadSopenharmony_ci    section 11.1, "Vertex Shaders"
10785bd8deadSopenharmony_ci
10795bd8deadSopenharmony_ci    Section 11.1.gs Geometry Shaders
10805bd8deadSopenharmony_ci
10815bd8deadSopenharmony_ci    After vertices are processed, they are arranged into primitives, as
10825bd8deadSopenharmony_ci    described in section 10.1 (Primitive Types). This section describes
10835bd8deadSopenharmony_ci    <geometry shaders>, an additional pipeline stage defining operations to
10845bd8deadSopenharmony_ci    further process those primitives. Geometry shaders are defined by source
10855bd8deadSopenharmony_ci    code in the OpenGL ES Shading Language, in the same manner as vertex
10865bd8deadSopenharmony_ci    shaders. They operate on a single primitive at a time and emit one or
10875bd8deadSopenharmony_ci    more output primitives, all of the same type, which are then processed
10885bd8deadSopenharmony_ci    like an equivalent GL primitive specified by the application. The
10895bd8deadSopenharmony_ci    original primitive is discarded after geometry shader execution. The
10905bd8deadSopenharmony_ci    inputs available to a geometry shader are the transformed attributes of
10915bd8deadSopenharmony_ci    all the vertices that belong to the primitive. Additional <adjacency
10925bd8deadSopenharmony_ci    primitives> are available which also make the transformed attributes of
10935bd8deadSopenharmony_ci    neighboring vertices available to the shader. The results of the shader
10945bd8deadSopenharmony_ci    are a new set of transformed vertices, arranged into primitives by the
10955bd8deadSopenharmony_ci    shader.
10965bd8deadSopenharmony_ci
10975bd8deadSopenharmony_ci    The geometry shader pipeline stage is inserted after primitive assembly,
10985bd8deadSopenharmony_ci    prior to transform feedback (see section 12.1), as discussed in section
10995bd8deadSopenharmony_ci    11.1.3.
11005bd8deadSopenharmony_ci
11015bd8deadSopenharmony_ci    Geometry shaders are created as described in section 7.1 using a <type>
11025bd8deadSopenharmony_ci    of GEOMETRY_SHADER_OES. They are attached to and used in program objects
11035bd8deadSopenharmony_ci    as described in section 7.3. When the program object currently in use
11045bd8deadSopenharmony_ci    includes a geometry shader, its geometry shader is considered active,
11055bd8deadSopenharmony_ci    and is used to process primitives. If the program object has no geometry
11065bd8deadSopenharmony_ci    shader, this stage is bypassed.
11075bd8deadSopenharmony_ci
11085bd8deadSopenharmony_ci    A non-separable program object or program pipeline object that includes
11095bd8deadSopenharmony_ci    a geometry shader must also include a vertex shader.
11105bd8deadSopenharmony_ci
11115bd8deadSopenharmony_ci    Errors
11125bd8deadSopenharmony_ci
11135bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by any command that transfers
11145bd8deadSopenharmony_ci    vertices to the GL if the current program state has a geometry shader
11155bd8deadSopenharmony_ci    but no vertex shader.
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci
11185bd8deadSopenharmony_ci    Section 11.1gs.1, Geometry Shader Input Primitives
11195bd8deadSopenharmony_ci
11205bd8deadSopenharmony_ci    A geometry shader can operate on one of five input primitive types.
11215bd8deadSopenharmony_ci    Depending on the input primitive type, one to six input vertices are
11225bd8deadSopenharmony_ci    available when the shader is executed. Each input primitive type
11235bd8deadSopenharmony_ci    supports a subset of the primitives provided by the GL.
11245bd8deadSopenharmony_ci
11255bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by any command that transfers
11265bd8deadSopenharmony_ci    vertices to the GL if a geometry shader is active and the primitive
11275bd8deadSopenharmony_ci    <mode> parameter is incompatible with the input primitive type of the
11285bd8deadSopenharmony_ci    geometry shader of the active geometry program object, as discussed
11295bd8deadSopenharmony_ci    below.
11305bd8deadSopenharmony_ci
11315bd8deadSopenharmony_ci    A geometry shader that accesses more input vertices than are available
11325bd8deadSopenharmony_ci    for a given input primitive type can be successfully compiled, because
11335bd8deadSopenharmony_ci    the input primitive type is not part of the shader object. However, a
11345bd8deadSopenharmony_ci    program object containing a shader object that accesses more input
11355bd8deadSopenharmony_ci    vertices than are available for the input primitive type of the program
11365bd8deadSopenharmony_ci    object will not link.
11375bd8deadSopenharmony_ci
11385bd8deadSopenharmony_ci    The input primitive type is specified in the geometry shader source code
11395bd8deadSopenharmony_ci    using an input layout qualifier, as described in the OpenGL ES Shading
11405bd8deadSopenharmony_ci    Language Specification. A program will fail to link if the input
11415bd8deadSopenharmony_ci    primitive type is not specified by the geometry shader object attached
11425bd8deadSopenharmony_ci    to the program. The input primitive type may be queried by calling
11435bd8deadSopenharmony_ci    GetProgramiv with the symbolic constant GEOMETRY_LINKED_INPUT_TYPE_OES.
11445bd8deadSopenharmony_ci    The supported types and the corresponding OpenGL ES Shading Language
11455bd8deadSopenharmony_ci    input layout qualifier keywords are:
11465bd8deadSopenharmony_ci
11475bd8deadSopenharmony_ci    Points (points)
11485bd8deadSopenharmony_ci
11495bd8deadSopenharmony_ci    Geometry shaders that operate on points are valid only for the POINTS
11505bd8deadSopenharmony_ci    primitive type. There is only a single vertex available for each
11515bd8deadSopenharmony_ci    geometry shader invocation.
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ci    Lines (lines)
11545bd8deadSopenharmony_ci
11555bd8deadSopenharmony_ci    Geometry shaders that operate on line segments are valid only for the
11565bd8deadSopenharmony_ci    LINES, LINE_STRIP, and LINE_LOOP primitive types. There are two vertices
11575bd8deadSopenharmony_ci    available for each geometry shader invocation. The first vertex refers
11585bd8deadSopenharmony_ci    to the vertex at the beginning of the line segment and the second vertex
11595bd8deadSopenharmony_ci    refers to the vertex at the end of the line segment. See also section
11605bd8deadSopenharmony_ci    11.1gs.4.
11615bd8deadSopenharmony_ci
11625bd8deadSopenharmony_ci    Lines with Adjacency (lines_adjacency)
11635bd8deadSopenharmony_ci
11645bd8deadSopenharmony_ci    Geometry shaders that operate on line segments with adjacent vertices
11655bd8deadSopenharmony_ci    are valid only for the LINES_ADJACENCY_OES and LINE_STRIP_ADJACENCY_OES
11665bd8deadSopenharmony_ci    primitive types. There are four vertices available for each program
11675bd8deadSopenharmony_ci    invocation. The second vertex refers to attributes of the vertex at the
11685bd8deadSopenharmony_ci    beginning of the line segment and the third vertex refers to the vertex
11695bd8deadSopenharmony_ci    at the end of the line segment. The first and fourth vertices refer to
11705bd8deadSopenharmony_ci    the vertices adjacent to the beginning and end of the line segment,
11715bd8deadSopenharmony_ci    respectively.
11725bd8deadSopenharmony_ci
11735bd8deadSopenharmony_ci    Triangles (triangles)
11745bd8deadSopenharmony_ci
11755bd8deadSopenharmony_ci    Geometry shaders that operate on triangles are valid for the TRIANGLES,
11765bd8deadSopenharmony_ci    TRIANGLE_STRIP and TRIANGLE_FAN primitive types. There are three
11775bd8deadSopenharmony_ci    vertices available for each program invocation. The first, second and
11785bd8deadSopenharmony_ci    third vertices refer to attributes of the first, second and third vertex
11795bd8deadSopenharmony_ci    of the triangle, respectively.
11805bd8deadSopenharmony_ci
11815bd8deadSopenharmony_ci    Triangles with Adjacency (triangles_adjacency)
11825bd8deadSopenharmony_ci
11835bd8deadSopenharmony_ci    Geometry shaders that operate on triangles with adjacent vertices are
11845bd8deadSopenharmony_ci    valid for the TRIANGLES_ADJACENCY_OES and TRIANGLE_STRIP_ADJACENCY_OES
11855bd8deadSopenharmony_ci    primitive types. There are six vertices available for each program
11865bd8deadSopenharmony_ci    invocation. The first, third and fifth vertices refer to attributes of
11875bd8deadSopenharmony_ci    the first, second and third vertex of the triangle, respectively. The
11885bd8deadSopenharmony_ci    second, fourth and sixth vertices refer to attributes of the vertices
11895bd8deadSopenharmony_ci    adjacent to the edges from the first to the second vertex, from the
11905bd8deadSopenharmony_ci    second to the third vertex, and from the third to the first vertex,
11915bd8deadSopenharmony_ci    respectively.
11925bd8deadSopenharmony_ci
11935bd8deadSopenharmony_ci
11945bd8deadSopenharmony_ci    Section 11.1gs.2, Geometry Shader Output Primitives
11955bd8deadSopenharmony_ci
11965bd8deadSopenharmony_ci    A geometry shader can generate primitives of one of three types. The
11975bd8deadSopenharmony_ci    supported output primitive types are points (POINTS), line strips
11985bd8deadSopenharmony_ci    (LINE_STRIP), and triangle strips (TRIANGLE_STRIP). The vertices output
11995bd8deadSopenharmony_ci    by the geometry shader are assembled into points, lines, or triangles
12005bd8deadSopenharmony_ci    based on the output primitive type in the manner described in section
12015bd8deadSopenharmony_ci    10.5. The resulting primitives are then further processed as described
12025bd8deadSopenharmony_ci    in section 11.1gs.4. If the number of vertices emitted by the geometry
12035bd8deadSopenharmony_ci    shader is not sufficient to produce a single primitive, nothing is
12045bd8deadSopenharmony_ci    drawn. The number of vertices output by the geometry shader is limited
12055bd8deadSopenharmony_ci    to a maximum count specified in the shader.
12065bd8deadSopenharmony_ci
12075bd8deadSopenharmony_ci    The output primitive type and maximum output vertex count are specified
12085bd8deadSopenharmony_ci    in the geometry shader source code using an output layout qualifier, as
12095bd8deadSopenharmony_ci    described in section 4.4.2.gs ("Geometry Outputs") of the OpenGL ES
12105bd8deadSopenharmony_ci    Shading Language Specification. A program will fail to link if either
12115bd8deadSopenharmony_ci    the output primitive type or maximum output vertex count are not
12125bd8deadSopenharmony_ci    specified by the geometry shader object attached to the program. The
12135bd8deadSopenharmony_ci    output primitive type and maximum output vertex count of a linked
12145bd8deadSopenharmony_ci    program may be queried by calling GetProgramiv with the symbolic
12155bd8deadSopenharmony_ci    constants GEOMETRY_LINKED_OUTPUT_TYPE_OES and
12165bd8deadSopenharmony_ci    GEOMETRY_LINKED_VERTICES_OUT_OES, respectively.
12175bd8deadSopenharmony_ci
12185bd8deadSopenharmony_ci
12195bd8deadSopenharmony_ci    Section 11.1gs.3 Geometry Shader Variables
12205bd8deadSopenharmony_ci
12215bd8deadSopenharmony_ci    Geometry shaders can access uniforms belonging to the current program
12225bd8deadSopenharmony_ci    object. Limits on uniform storage and methods for manipulating uniforms
12235bd8deadSopenharmony_ci    are described in section 7.6.
12245bd8deadSopenharmony_ci
12255bd8deadSopenharmony_ci    Geometry shaders also have access to samplers to perform texturing
12265bd8deadSopenharmony_ci    operations, as described in section 7.9.
12275bd8deadSopenharmony_ci
12285bd8deadSopenharmony_ci    Geometry shaders can access the transformed attributes of all vertices
12295bd8deadSopenharmony_ci    for their input primitive type using input variables. A vertex shader
12305bd8deadSopenharmony_ci    writing to output variables generates the values of these input
12315bd8deadSopenharmony_ci    variables. Values for any inputs that are not written by a vertex shader
12325bd8deadSopenharmony_ci    are undefined. Additionally, a geometry shader has access to a built-in
12335bd8deadSopenharmony_ci    variable that holds the ID of the current primitive. This ID is
12345bd8deadSopenharmony_ci    generated by the primitive assembly stage that sits in between the
12355bd8deadSopenharmony_ci    vertex and geometry shader.
12365bd8deadSopenharmony_ci
12375bd8deadSopenharmony_ci    Additionally, geometry shaders can write to one or more output variables
12385bd8deadSopenharmony_ci    for each vertex they output. These values are optionally flatshaded
12395bd8deadSopenharmony_ci    (using the OpenGL ES Shading Language varying qualifier "flat") and
12405bd8deadSopenharmony_ci    clipped, then the clipped values interpolated across the primitive (if
12415bd8deadSopenharmony_ci    not flatshaded). The results of these interpolations are available to
12425bd8deadSopenharmony_ci    the fragment shader.
12435bd8deadSopenharmony_ci
12445bd8deadSopenharmony_ci
12455bd8deadSopenharmony_ci    Section 11.1gs.4, Geometry Shader Execution Environment
12465bd8deadSopenharmony_ci
12475bd8deadSopenharmony_ci    If there is an active program for the geometry stage, the executable
12485bd8deadSopenharmony_ci    version of the program's geometry shader is used to process primitives
12495bd8deadSopenharmony_ci    resulting from the primitive assembly stage.
12505bd8deadSopenharmony_ci
12515bd8deadSopenharmony_ci    There are several special considerations for geometry shader execution
12525bd8deadSopenharmony_ci    described in the following sections.
12535bd8deadSopenharmony_ci
12545bd8deadSopenharmony_ci
12555bd8deadSopenharmony_ci    Section 11.1gs.4.1 Texture Access
12565bd8deadSopenharmony_ci
12575bd8deadSopenharmony_ci    Section 11.1.3.1 describes texture lookup functionality accessible to a
12585bd8deadSopenharmony_ci    vertex shader. The texel fetch and texture size query functionality
12595bd8deadSopenharmony_ci    described there also applies to geometry shaders.
12605bd8deadSopenharmony_ci
12615bd8deadSopenharmony_ci
12625bd8deadSopenharmony_ci    Section 11.1gs.4.2 Instanced Geometry Shaders
12635bd8deadSopenharmony_ci
12645bd8deadSopenharmony_ci    For each input primitive received by the geometry shader pipeline stage,
12655bd8deadSopenharmony_ci    the geometry shader may be run once or multiple times. The number of
12665bd8deadSopenharmony_ci    times a geometry shader should be executed for each input primitive may
12675bd8deadSopenharmony_ci    be specified using a layout qualifier in a geometry shader of a linked
12685bd8deadSopenharmony_ci    program. If the invocation count is not specified in any layout
12695bd8deadSopenharmony_ci    qualifier, the invocation count will be one.
12705bd8deadSopenharmony_ci
12715bd8deadSopenharmony_ci    Each separate geometry shader invocation is assigned a unique invocation
12725bd8deadSopenharmony_ci    number. For a geometry shader with <N> invocations, each input primitive
12735bd8deadSopenharmony_ci    spawns <N> invocations, numbered 0 through <N>-1. The built-in uniform
12745bd8deadSopenharmony_ci    gl_InvocationID may be used by a geometry shader invocation to determine
12755bd8deadSopenharmony_ci    its invocation number.
12765bd8deadSopenharmony_ci
12775bd8deadSopenharmony_ci    When executing instanced geometry shaders, the output primitives
12785bd8deadSopenharmony_ci    generated from each input primitive are passed to subsequent pipeline
12795bd8deadSopenharmony_ci    stages using the shader invocation number to order the output. The first
12805bd8deadSopenharmony_ci    primitives received by the subsequent pipeline stages are those emitted
12815bd8deadSopenharmony_ci    by the shader invocation numbered zero, followed by those from the
12825bd8deadSopenharmony_ci    shader invocation numbered one, and so forth. Additionally, all output
12835bd8deadSopenharmony_ci    primitives generated from a given input primitive are passed to
12845bd8deadSopenharmony_ci    subsequent pipeline stages before any output primitives generated from
12855bd8deadSopenharmony_ci    subsequent input primitives.
12865bd8deadSopenharmony_ci
12875bd8deadSopenharmony_ci
12885bd8deadSopenharmony_ci    Section 11.1gs.4.3 Geometry Shader Inputs
12895bd8deadSopenharmony_ci
12905bd8deadSopenharmony_ci    Section 7.1 ("Built-In Language Variables") of the OpenGL ES Shading
12915bd8deadSopenharmony_ci    Language Specification describes the built-in variable array gl_in[]
12925bd8deadSopenharmony_ci    available as input to a geometry shader. gl_in[] receives values from
12935bd8deadSopenharmony_ci    the equivalent built-in output variables written by the vertex shader.
12945bd8deadSopenharmony_ci    Each array element of gl_in[] is a structure holding values for a
12955bd8deadSopenharmony_ci    specific vertex of the input primitive. The length of gl_in[] is
12965bd8deadSopenharmony_ci    determined by the geometry shader input type (see section 11.1gs.1). The
12975bd8deadSopenharmony_ci    members of each element of the gl_in[] array are:
12985bd8deadSopenharmony_ci
12995bd8deadSopenharmony_ci      [[ If OES_geometry_point_size is supported: ]]
13005bd8deadSopenharmony_ci    * structure member gl_PointSize holds the per-vertex point size written
13015bd8deadSopenharmony_ci      by the previous shader to its built-in output variable gl_PointSize.
13025bd8deadSopenharmony_ci      If the previous shader does not write gl_PointSize, the value of
13035bd8deadSopenharmony_ci      gl_PointSize is undefined.
13045bd8deadSopenharmony_ci
13055bd8deadSopenharmony_ci    * structure member gl_Position holds the per-vertex position, as written
13065bd8deadSopenharmony_ci      by the previous shader to its built-in output variable gl_Position.
13075bd8deadSopenharmony_ci      Note that writing to gl_Position from either the vertex or geometry
13085bd8deadSopenharmony_ci      shader is optional (also see section 7.1 ("Built-In Language
13095bd8deadSopenharmony_ci      Variables") of the OpenGL ES Shading Language Specification)
13105bd8deadSopenharmony_ci
13115bd8deadSopenharmony_ci    Geometry shaders also have available the built-in input variable
13125bd8deadSopenharmony_ci    gl_PrimitiveIDIn, which is not an array and has no vertex shader
13135bd8deadSopenharmony_ci    equivalent. It is filled with the number of primitives processed by the
13145bd8deadSopenharmony_ci    drawing command which generated the input vertices. The first primitive
13155bd8deadSopenharmony_ci    generated by a drawing command is numbered zero, and the primitive ID
13165bd8deadSopenharmony_ci    counter is incremented after every individual point, line, or triangle
13175bd8deadSopenharmony_ci    primitive is processed. For triangles drawn in point or line mode, the
13185bd8deadSopenharmony_ci    primitive ID counter is incremented only once, even though multiple
13195bd8deadSopenharmony_ci    points or lines may eventually be drawn. The counter is reset to zero
13205bd8deadSopenharmony_ci    between each instance drawn. Restarting a primitive topology using the
13215bd8deadSopenharmony_ci    primitive restart index has no effect on the primitive ID counter.
13225bd8deadSopenharmony_ci
13235bd8deadSopenharmony_ci    Similarly to the built-in inputs, each user-defined input has a value
13245bd8deadSopenharmony_ci    for each vertex and thus needs needs to be declared as arrays or inside
13255bd8deadSopenharmony_ci    input blocks declared as arrays. Declaring an array size is optional. If
13265bd8deadSopenharmony_ci    no size is specified, it will be inferred by the linker from the input
13275bd8deadSopenharmony_ci    primitive type. If a size is specified, it must match the number of
13285bd8deadSopenharmony_ci    vertices for the input primitive type; otherwise a link error will
13295bd8deadSopenharmony_ci    occur. The OpenGL ES Shading Language doesn't support multi-dimensional
13305bd8deadSopenharmony_ci    arrays as shader inputs or outputs; therefore, user-defined geometry
13315bd8deadSopenharmony_ci    shader inputs corresponding to vertex shader outputs declared as arrays
13325bd8deadSopenharmony_ci    must be declared as array members of an input block that is itself
13335bd8deadSopenharmony_ci    declared as an array. See section 4.3.6 ("Output Variables") of the
13345bd8deadSopenharmony_ci    OpenGL ES Shading Language Specification for more information.
13355bd8deadSopenharmony_ci
13365bd8deadSopenharmony_ci    Similarly to the limit on vertex shader output components (see section
13375bd8deadSopenharmony_ci    11.1.2.1), there is a limit on the number of components of input
13385bd8deadSopenharmony_ci    variables that can be read by the geometry shader, given by the value of
13395bd8deadSopenharmony_ci    the implementation-dependent constant MAX_GEOMETRY_INPUT_COMPONENTS_OES.
13405bd8deadSopenharmony_ci
13415bd8deadSopenharmony_ci    When a program is linked, all components of any input read by a geometry
13425bd8deadSopenharmony_ci    shader will count against this limit. A program whose geometry shader
13435bd8deadSopenharmony_ci    exceeds this limit may fail to link, unless device-dependent
13445bd8deadSopenharmony_ci    optimizations are able to make the program fit within available hardware
13455bd8deadSopenharmony_ci    resources.
13465bd8deadSopenharmony_ci
13475bd8deadSopenharmony_ci    Component counting rules for different variable types and variable
13485bd8deadSopenharmony_ci    declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS (see
13495bd8deadSopenharmony_ci    section 11.1.2.1).
13505bd8deadSopenharmony_ci
13515bd8deadSopenharmony_ci
13525bd8deadSopenharmony_ci    Section 11.1gs.4.4 Geometry Shader Outputs
13535bd8deadSopenharmony_ci
13545bd8deadSopenharmony_ci    A geometry shader is limited in the number of vertices it may emit per
13555bd8deadSopenharmony_ci    invocation. The maximum number of vertices a geometry shader can
13565bd8deadSopenharmony_ci    possibly emit is specified in the geometry shader source and may be
13575bd8deadSopenharmony_ci    queried after linking by calling GetProgramiv with the symbolic constant
13585bd8deadSopenharmony_ci    GEOMETRY_LINKED_VERTICES_OUT_OES. If a single invocation of a geometry
13595bd8deadSopenharmony_ci    shader emits more vertices than this value, the emitted vertices may
13605bd8deadSopenharmony_ci    have no effect.
13615bd8deadSopenharmony_ci
13625bd8deadSopenharmony_ci    There are two implementation-dependent limits on the value of
13635bd8deadSopenharmony_ci    GEOMETRY_LINKED_VERTICES_OUT_OES; it may not exceed the value of
13645bd8deadSopenharmony_ci    MAX_GEOMETRY_OUTPUT_VERTICES_OES, and the product of the total number of
13655bd8deadSopenharmony_ci    vertices and the sum of all components of all active output variables
13665bd8deadSopenharmony_ci    may not exceed the value of MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES.
13675bd8deadSopenharmony_ci    LinkProgram will fail if it determines that the total component limit
13685bd8deadSopenharmony_ci    would be violated.
13695bd8deadSopenharmony_ci
13705bd8deadSopenharmony_ci    A geometry shader can write to built-in as well as user-defined output
13715bd8deadSopenharmony_ci    variables. These values are expected to be interpolated across the
13725bd8deadSopenharmony_ci    primitive it outputs, unless they are specified to be flatshaded. To
13735bd8deadSopenharmony_ci    enable seamlessly inserting or removing a geometry shader from a program
13745bd8deadSopenharmony_ci    object, the rules, names and types of the built-in and user-defined
13755bd8deadSopenharmony_ci    output variables are the same as for the vertex shader. Refer to section
13765bd8deadSopenharmony_ci    11.1.2.1, and to sections 4.3.6 ("Output Variables") and 7.1 ("Built-In
13775bd8deadSopenharmony_ci    Language Variables") of the the OpenGL ES Shading Language Specification
13785bd8deadSopenharmony_ci    for more detail.
13795bd8deadSopenharmony_ci
13805bd8deadSopenharmony_ci    After a geometry shader emits a vertex, all output variables are
13815bd8deadSopenharmony_ci    undefined, as described in section 8.12gs ("Geometry Shader Functions")
13825bd8deadSopenharmony_ci    of the OpenGL Shading Language Specification.
13835bd8deadSopenharmony_ci
13845bd8deadSopenharmony_ci    The built-in output gl_Position is intended to hold the homogeneous
13855bd8deadSopenharmony_ci    vertex position. Writing gl_Position is optional.
13865bd8deadSopenharmony_ci
13875bd8deadSopenharmony_ci      [[ If OES_geometry_point_size is supported: ]]
13885bd8deadSopenharmony_ci    The built-in output gl_PointSize, if written, holds the size of the
13895bd8deadSopenharmony_ci    point to be rasterized, measured in pixels.
13905bd8deadSopenharmony_ci
13915bd8deadSopenharmony_ci    The built-in output gl_PrimitiveID holds the primitive ID counter read
13925bd8deadSopenharmony_ci    by the fragment shader, replacing the value of gl_PrimitiveID generated
13935bd8deadSopenharmony_ci    by drawing commands when no geometry shader is active. The geometry
13945bd8deadSopenharmony_ci    shader must write to gl_PrimitiveID for the provoking vertex (see
13955bd8deadSopenharmony_ci    section 12.3) of a primitive being generated, or the primitive ID
13965bd8deadSopenharmony_ci    counter read by the fragment shader for that primitive is undefined.
13975bd8deadSopenharmony_ci
13985bd8deadSopenharmony_ci    The built-in output gl_Layer is used in layered rendering, and discussed
13995bd8deadSopenharmony_ci    further in the next section.
14005bd8deadSopenharmony_ci
14015bd8deadSopenharmony_ci    Similarly to the limit on vertex shader output components (see section
14025bd8deadSopenharmony_ci    11.1.2.1), there is a limit on the number of components of output
14035bd8deadSopenharmony_ci    variables that can be written by the geometry shader, given by the value
14045bd8deadSopenharmony_ci    of the implementation-dependent constant
14055bd8deadSopenharmony_ci    MAX_GEOMETRY_OUTPUT_COMPONENTS_OES.
14065bd8deadSopenharmony_ci
14075bd8deadSopenharmony_ci    When a program is linked, all components of any output variable written
14085bd8deadSopenharmony_ci    by a geometry shader will count against this limit. A program whose
14095bd8deadSopenharmony_ci    geometry shader exceeds this limit may fail to link, unless
14105bd8deadSopenharmony_ci    device-dependent optimizations are able to make the program fit within
14115bd8deadSopenharmony_ci    available hardware resources.
14125bd8deadSopenharmony_ci
14135bd8deadSopenharmony_ci    Component counting rules for different variable types and variable
14145bd8deadSopenharmony_ci    declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS. (see
14155bd8deadSopenharmony_ci    section 11.1.2.1).
14165bd8deadSopenharmony_ci
14175bd8deadSopenharmony_ci
14185bd8deadSopenharmony_ci    Section 11.1gs.4.5 Layer Selection
14195bd8deadSopenharmony_ci
14205bd8deadSopenharmony_ci    Geometry shaders can be used to render to one of several different
14215bd8deadSopenharmony_ci    layers of cube map textures, three-dimensional textures, or
14225bd8deadSopenharmony_ci    two-dimensional texture arrays. This functionality allows an application
14235bd8deadSopenharmony_ci    to bind an entire complex texture to a framebuffer object, and render
14245bd8deadSopenharmony_ci    primitives to arbitrary layers computed at run time. For example, this
14255bd8deadSopenharmony_ci    mechanism can be used to project and render a scene onto all six faces
14265bd8deadSopenharmony_ci    of a cube map texture in one pass. The layer to render to is specified
14275bd8deadSopenharmony_ci    by writing to the built-in output variable "gl_Layer". Layered rendering
14285bd8deadSopenharmony_ci    requires the use of framebuffer objects (see section 9.7gs).
14295bd8deadSopenharmony_ci
14305bd8deadSopenharmony_ci    The specific vertex of a primitive that is used to select the rendering
14315bd8deadSopenharmony_ci    layer is implementation-dependent and thus portable applications will
14325bd8deadSopenharmony_ci    assign the same layer for all vertices in a primitive. The vertex
14335bd8deadSopenharmony_ci    convention followed for "gl_Layer" may be determined by calling
14345bd8deadSopenharmony_ci    GetIntegerv with the symbolic constant LAYER_PROVOKING_VERTEX_OES. If
14355bd8deadSopenharmony_ci    the value returned is FIRST_VERTEX_CONVENTION_OES, selection is always
14365bd8deadSopenharmony_ci    taken from the first vertex of a primitive. If the value returned is
14375bd8deadSopenharmony_ci    LAST_VERTEX_CONVENTION_OES, the selection is always taken from the last
14385bd8deadSopenharmony_ci    vertex of a primitive. If the value returned is UNDEFINED_VERTEX_OES,
14395bd8deadSopenharmony_ci    the selection is not guaranteed to be taken from any specific vertex in
14405bd8deadSopenharmony_ci    the primitive. The vertex considered the provoking vertex for particular
14415bd8deadSopenharmony_ci    primitive types is given in table 12.2.
14425bd8deadSopenharmony_ci
14435bd8deadSopenharmony_ci
14445bd8deadSopenharmony_ci    Section 11.1gs.4.6 Primitive Type Mismatches and Drawing Commands
14455bd8deadSopenharmony_ci
14465bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by any command that transfers
14475bd8deadSopenharmony_ci    vertices to the GL, and no fragments will be rendered, if a mismatch
14485bd8deadSopenharmony_ci    exists between the type of primitive being drawn and the input primitive
14495bd8deadSopenharmony_ci    type of a geometry shader. A mismatch exists under any of the following
14505bd8deadSopenharmony_ci    conditions:
14515bd8deadSopenharmony_ci
14525bd8deadSopenharmony_ci      * the input primitive type of the current geometry shader is
14535bd8deadSopenharmony_ci        POINTS and <mode> is not POINTS,
14545bd8deadSopenharmony_ci
14555bd8deadSopenharmony_ci      * the input primitive type of the current geometry shader is
14565bd8deadSopenharmony_ci        LINES and <mode> is not LINES, LINE_STRIP, or LINE_LOOP,
14575bd8deadSopenharmony_ci
14585bd8deadSopenharmony_ci      * the input primitive type of the current geometry shader is
14595bd8deadSopenharmony_ci        TRIANGLES and <mode> is not TRIANGLES, TRIANGLE_STRIP or
14605bd8deadSopenharmony_ci        TRIANGLE_FAN,
14615bd8deadSopenharmony_ci
14625bd8deadSopenharmony_ci      * the input primitive type of the current geometry shader is
14635bd8deadSopenharmony_ci        LINES_ADJACENCY_OES and <mode> is not LINES_ADJACENCY_OES or
14645bd8deadSopenharmony_ci        LINE_STRIP_ADJACENCY_OES, or
14655bd8deadSopenharmony_ci
14665bd8deadSopenharmony_ci      * the input primitive type of the current geometry shader is
14675bd8deadSopenharmony_ci        TRIANGLES_ADJACENCY_OES and <mode> is not
14685bd8deadSopenharmony_ci        TRIANGLES_ADJACENCY_OES or TRIANGLE_STRIP_ADJACENCY_OES.
14695bd8deadSopenharmony_ci
14705bd8deadSopenharmony_ci
14715bd8deadSopenharmony_ci    Modify section 12.1, "Transform Feedback"
14725bd8deadSopenharmony_ci
14735bd8deadSopenharmony_ci    Replace the second paragraph of the section on p. 274:
14745bd8deadSopenharmony_ci
14755bd8deadSopenharmony_ci    The data captured in transform feedback mode depends on the active
14765bd8deadSopenharmony_ci    programs on each of the shader stages. If a program is active for the
14775bd8deadSopenharmony_ci    geometry shader stage, transform feedback captures the vertices of each
14785bd8deadSopenharmony_ci    primitive emitted by the geometry shader. Otherwise, transform feedback
14795bd8deadSopenharmony_ci    captures each primitive processed by the vertex shader.
14805bd8deadSopenharmony_ci
14815bd8deadSopenharmony_ci
14825bd8deadSopenharmony_ci    Modify the second paragraph following ResumeTransformFeedback on p. 277
14835bd8deadSopenharmony_ci
14845bd8deadSopenharmony_ci    When transform feedback is active and not paused, all geometric
14855bd8deadSopenharmony_ci    primitives generated must be compatible with the value of
14865bd8deadSopenharmony_ci    <primitiveMode> passed to BeginTransformFeedback. If a geometry shader
14875bd8deadSopenharmony_ci    is active, the type of primitive emitted by that shader is used instead
14885bd8deadSopenharmony_ci    of the <mode> parameter passed to drawing commands for the purposes of
14895bd8deadSopenharmony_ci    this error check. Any primitive type may be used while transform
14905bd8deadSopenharmony_ci    feedback is paused.
14915bd8deadSopenharmony_ci
14925bd8deadSopenharmony_ci    Add table 12.1gs:
14935bd8deadSopenharmony_ci
14945bd8deadSopenharmony_ci    Transform Feedback  Allowed render primitive
14955bd8deadSopenharmony_ci    <primitiveMode>     <modes>
14965bd8deadSopenharmony_ci    -------------------+----------------------------------------
14975bd8deadSopenharmony_ci    POINTS             | POINTS
14985bd8deadSopenharmony_ci    LINES              | LINES, LINE_LOOP, LINE_STRIP
14995bd8deadSopenharmony_ci    TRIANGLES          | TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN
15005bd8deadSopenharmony_ci    ------------------------------------------------------------
15015bd8deadSopenharmony_ci    Table 12.1gs: Legal combinations of the transform feedback
15025bd8deadSopenharmony_ci    primitive mode, as passed to BeginTransformFeedback, and the
15035bd8deadSopenharmony_ci    current primitive mode.
15045bd8deadSopenharmony_ci
15055bd8deadSopenharmony_ci
15065bd8deadSopenharmony_ci    In the Errors section, replace "An INVALID_OPERATION error is generate
15075bd8deadSopenharmony_ci    by DrawArrays and DrawArraysInstanced if <mode> is not identical to
15085bd8deadSopenharmony_ci    <primitiveMode>" with:
15095bd8deadSopenharmony_ci
15105bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by any command that transfers
15115bd8deadSopenharmony_ci    vertices to the GL if <mode> is not one of the allowed modes in table
15125bd8deadSopenharmony_ci    12.1gs.
15135bd8deadSopenharmony_ci
15145bd8deadSopenharmony_ci    and delete the error condition which states:
15155bd8deadSopenharmony_ci
15165bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by any drawing commands other
15175bd8deadSopenharmony_ci    than DrawArrays and DrawArraysInstanced while transform feedback is
15185bd8deadSopenharmony_ci    active and not paused, regardless of mode.
15195bd8deadSopenharmony_ci
15205bd8deadSopenharmony_ci    Modify the last sentence of the second paragraph on p. 278:
15215bd8deadSopenharmony_ci
15225bd8deadSopenharmony_ci    When writing output variables that are arrays ... The value for any
15235bd8deadSopenharmony_ci    output variable specified to be streamed to a buffer object but not
15245bd8deadSopenharmony_ci    actually written by a vertex or geometry shader is undefined. The
15255bd8deadSopenharmony_ci    results of appending an output variable to a transform feedback buffer
15265bd8deadSopenharmony_ci    are undefined if any component of that variable would be written at an
15275bd8deadSopenharmony_ci    offset not aligned to the size of the component.
15285bd8deadSopenharmony_ci
15295bd8deadSopenharmony_ci
15305bd8deadSopenharmony_ci    Modify the sixth paragraph on p. 278:
15315bd8deadSopenharmony_ci
15325bd8deadSopenharmony_ci    In INTERLEAVED_ATTRIBS mode, the values of one or more output variables
15335bd8deadSopenharmony_ci    written by a vertex or geometry shader are written, interleaved, ...
15345bd8deadSopenharmony_ci
15355bd8deadSopenharmony_ci
15365bd8deadSopenharmony_ci    Modify the eighth paragraph on p. 278, describing errors on buffer
15375bd8deadSopenharmony_ci    overflow:
15385bd8deadSopenharmony_ci
15395bd8deadSopenharmony_ci
15405bd8deadSopenharmony_ci    The error INVALID_OPERATION ... as set by BindBufferRange. No vertices
15415bd8deadSopenharmony_ci    of that primitive are recorded in any buffer object, and the counter
15425bd8deadSopenharmony_ci    corresponding to the asynchronous query target
15435bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN (see section 12.2) is not
15445bd8deadSopenharmony_ci    incremented.
15455bd8deadSopenharmony_ci
15465bd8deadSopenharmony_ci
15475bd8deadSopenharmony_ci    Modify the second paragraph on p. 280:
15485bd8deadSopenharmony_ci
15495bd8deadSopenharmony_ci    When BeginTransformFeedback is called with an active program object
15505bd8deadSopenharmony_ci    containing a vertex or geometry shader, the set of output variables
15515bd8deadSopenharmony_ci    captured ...
15525bd8deadSopenharmony_ci
15535bd8deadSopenharmony_ci
15545bd8deadSopenharmony_ci    Replace section 12.2, "Primitive Queries" on p. 281:
15555bd8deadSopenharmony_ci
15565bd8deadSopenharmony_ci    Primitive queries use query objects to track the number of primitives
15575bd8deadSopenharmony_ci    that are generated by the GL and the number of primitives that are
15585bd8deadSopenharmony_ci    written to buffer objects in transform feedback mode.
15595bd8deadSopenharmony_ci
15605bd8deadSopenharmony_ci    When BeginQuery is called with a target of PRIMITIVES_GENERATED_OES, the
15615bd8deadSopenharmony_ci    primitives generated count maintained by the GL is set to zero. When a
15625bd8deadSopenharmony_ci    generated primitive query is active, the primitives-generated count is
15635bd8deadSopenharmony_ci    incremented every time an emitted primitive reaches the transform
15645bd8deadSopenharmony_ci    feedback stage (see section 12.1), whether or not transform feedback is
15655bd8deadSopenharmony_ci    active. This counter counts the number of primitives emitted by a
15665bd8deadSopenharmony_ci    geometry shader, if active, possibly further tessellated into separate
15675bd8deadSopenharmony_ci    primitives during the transform feedback stage, if active.
15685bd8deadSopenharmony_ci
15695bd8deadSopenharmony_ci    When BeginQuery is called with a target of
15705bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, the transform feedback primitives
15715bd8deadSopenharmony_ci    written count maintained by the GL is set to zero. When the transform
15725bd8deadSopenharmony_ci    feedback primitive written query is active, the transform feedback
15735bd8deadSopenharmony_ci    primitives written count is incremented every time the vertices of a
15745bd8deadSopenharmony_ci    primitive are recorded into a buffer object. If transform feedback is
15755bd8deadSopenharmony_ci    not active or if a primitive to be recorded does not fit in a buffer
15765bd8deadSopenharmony_ci    object, this counter is not incremented.
15775bd8deadSopenharmony_ci
15785bd8deadSopenharmony_ci    These two types of queries can be used together to determine if all
15795bd8deadSopenharmony_ci    primitives have been written to the bound feedback buffer; if both
15805bd8deadSopenharmony_ci    queries are run simultaneously and the query results are equal, all
15815bd8deadSopenharmony_ci    primitives have been written to the buffer. If the number of primitives
15825bd8deadSopenharmony_ci    written is less than the number of primitives generated, the buffer
15835bd8deadSopenharmony_ci    overflowed.
15845bd8deadSopenharmony_ci
15855bd8deadSopenharmony_ci
15865bd8deadSopenharmony_ci    Modify section 12.5 "Coordinate Transformations" on p. 283:
15875bd8deadSopenharmony_ci
15885bd8deadSopenharmony_ci    <Clip coordinates> for a vertex result from shader execution, which
15895bd8deadSopenharmony_ci    yields ...
15905bd8deadSopenharmony_ci
15915bd8deadSopenharmony_ci
15925bd8deadSopenharmony_ci    Modify section 13.3, "Points"
15935bd8deadSopenharmony_ci
15945bd8deadSopenharmony_ci    Replace the second paragraph starting "The point size..." on p. 290:
15955bd8deadSopenharmony_ci
15965bd8deadSopenharmony_ci    The point size is determined by the last active stage before the
15975bd8deadSopenharmony_ci    rasterizer:
15985bd8deadSopenharmony_ci
15995bd8deadSopenharmony_ci    * the geometry shader, if active; or
16005bd8deadSopenharmony_ci    * the vertex shader, otherwise.
16015bd8deadSopenharmony_ci
16025bd8deadSopenharmony_ci    If the last active stage is not a vertex shader and does not statically
16035bd8deadSopenharmony_ci    assign a value to gl_PointSize, the point size is 1.0. Otherwise, the
16045bd8deadSopenharmony_ci    point size is taken from the shader built-in gl_PointSize written by
16055bd8deadSopenharmony_ci    that stage.
16065bd8deadSopenharmony_ci        [[ Note that it is impossible to assign a value to gl_PointSize if
16075bd8deadSopenharmony_ci           OES_geometry_point_size is not supported and enabled in the
16085bd8deadSopenharmony_ci           geometry shader stage. ]]
16095bd8deadSopenharmony_ci
16105bd8deadSopenharmony_ci    If the last active stage is a vertex shader, the point size is taken
16115bd8deadSopenharmony_ci    from the shader built-in gl_PointSize written by the vertex shader.
16125bd8deadSopenharmony_ci
16135bd8deadSopenharmony_ci    In all cases, the point size is clamped to the implementation-dependent
16145bd8deadSopenharmony_ci    point size range. If the value written to gl_PointSize is less than or
16155bd8deadSopenharmony_ci    equal to zero, or if no value is written to gl_PointSize (except as
16165bd8deadSopenharmony_ci    noted above) the point size is undefined. The supported range ...
16175bd8deadSopenharmony_ci
16185bd8deadSopenharmony_ci
16195bd8deadSopenharmony_ci    Modify section 14.2.2, "Shader Inputs"
16205bd8deadSopenharmony_ci
16215bd8deadSopenharmony_ci    Add a new paragraph following the paragraph starting "The built-in
16225bd8deadSopenharmony_ci    variable gl_FrontFacing" on p. 305:
16235bd8deadSopenharmony_ci
16245bd8deadSopenharmony_ci    If a geometry shader is active, the built-in variable gl_PrimitiveID
16255bd8deadSopenharmony_ci    contains the ID value emitted by the geometry shader for the provoking
16265bd8deadSopenharmony_ci    vertex. If no geometry shader is active, gl_PrimitiveID contains the
16275bd8deadSopenharmony_ci    number of primitives processed by the rasterizer since the last drawing
16285bd8deadSopenharmony_ci    command was called. The first primitive generated by a drawing command
16295bd8deadSopenharmony_ci    is numbered zero, and the primitive ID counter is incremented after
16305bd8deadSopenharmony_ci    every individual point, line, or polygon primitive is processed.
16315bd8deadSopenharmony_ci    The counter is reset to zero between each instance drawn.
16325bd8deadSopenharmony_ci
16335bd8deadSopenharmony_ci    Restarting a primitive using the primitive restart index (see section
16345bd8deadSopenharmony_ci    10.3.4) has no effect on the primitive ID counter.
16355bd8deadSopenharmony_ci
16365bd8deadSopenharmony_ci    gl_PrimitiveID is only defined under the same conditions that
16375bd8deadSopenharmony_ci    gl_VertexID is defined, as described under "Shader Inputs" in section
16385bd8deadSopenharmony_ci    11.1.3.9.
16395bd8deadSopenharmony_ci
16405bd8deadSopenharmony_ci    Similarly to the limit on geometry shader output components (see section
16415bd8deadSopenharmony_ci    11.1gs.4), there is a limit on the number of components of built-in and
16425bd8deadSopenharmony_ci    user-defined input variables that can be read by the fragment shader,
16435bd8deadSopenharmony_ci    given by the value of the implementation-dependent constant
16445bd8deadSopenharmony_ci    MAX_FRAGMENT_INPUT_COMPONENTS.
16455bd8deadSopenharmony_ci
16465bd8deadSopenharmony_ci    When a program is linked ...
16475bd8deadSopenharmony_ci
16485bd8deadSopenharmony_ci
16495bd8deadSopenharmony_ci    Modify section 16.2.1, "Blitting Pixel Rectangles" to add following the
16505bd8deadSopenharmony_ci    paragraph starting "When values are written to the draw buffers" on p.
16515bd8deadSopenharmony_ci    337:
16525bd8deadSopenharmony_ci
16535bd8deadSopenharmony_ci    If the read framebuffer is layered (see section 9.7gs), pixel values are
16545bd8deadSopenharmony_ci    read from layer zero. If the draw framebuffer is layered, pixel values
16555bd8deadSopenharmony_ci    are written to layer zero. If both read and draw framebuffers are
16565bd8deadSopenharmony_ci    layered, the blit operation is still performed only on layer zero.
16575bd8deadSopenharmony_ci
16585bd8deadSopenharmony_ci
16595bd8deadSopenharmony_ci    Modify the first sentence of chapter 17, "Compute Shaders" on p. 340:
16605bd8deadSopenharmony_ci
16615bd8deadSopenharmony_ci    In addition to graphics-oriented shading operations such as vertex,
16625bd8deadSopenharmony_ci    geometry, and fragment shading, generic computation ...
16635bd8deadSopenharmony_ci
16645bd8deadSopenharmony_ci
16655bd8deadSopenharmony_ciDependencies on OES_sample_variables
16665bd8deadSopenharmony_ci
16675bd8deadSopenharmony_ci    If OES_sample_variables is not supported, references to
16685bd8deadSopenharmony_ci    the extension edits should be ignored.
16695bd8deadSopenharmony_ci
16705bd8deadSopenharmony_ciDependencies on OES_texture_storage_multisample_2d_array
16715bd8deadSopenharmony_ci
16725bd8deadSopenharmony_ci    If OES_texture_storage_multisample_2d_array is not supported, references
16735bd8deadSopenharmony_ci    to two-dimensional multisample array textures should be ignored.
16745bd8deadSopenharmony_ci
16755bd8deadSopenharmony_ciDependencies on OES_shader_multisample_interpolation
16765bd8deadSopenharmony_ci
16775bd8deadSopenharmony_ci    If OES_shader_multisample_interpolation is not supported, references
16785bd8deadSopenharmony_ci    to "sample in", "sample out" and the extension should be ignored.
16795bd8deadSopenharmony_ci
16805bd8deadSopenharmony_ciDependencies on OES_texture_buffer and EXT_texture_buffer
16815bd8deadSopenharmony_ci
16825bd8deadSopenharmony_ci    If OES_texture_buffer or EXT_texture_buffer is not supported, references
16835bd8deadSopenharmony_ci    to buffer textures should be removed.
16845bd8deadSopenharmony_ci
16855bd8deadSopenharmony_ciDependencies on OES_shader_io_blocks
16865bd8deadSopenharmony_ci
16875bd8deadSopenharmony_ci    If OES_shader_io_blocks is not supported, replace all references to
16885bd8deadSopenharmony_ci    it with references to EXT_shader_io_blocks instead.
16895bd8deadSopenharmony_ci
16905bd8deadSopenharmony_ciNew State
16915bd8deadSopenharmony_ci
16925bd8deadSopenharmony_ci    Add to table 20.14, "Framebuffer (state per framebuffer object)":
16935bd8deadSopenharmony_ci                                                                    Initial
16945bd8deadSopenharmony_ci    Get Value                      Type  Get Command                Value   Description               Sec.
16955bd8deadSopenharmony_ci    ------------------------------ ----  -------------------------  ------- ------------------------  -----
16965bd8deadSopenharmony_ci    FRAMEBUFFER_DEFAULT_LAYERS_OES  Z+   GetFramebufferParameteriv    0     default layer count of    9.2.1
16975bd8deadSopenharmony_ci                                                                            framebuffer w/o
16985bd8deadSopenharmony_ci                                                                            attachments
16995bd8deadSopenharmony_ci
17005bd8deadSopenharmony_ci    Add to table 20.15, "Framebuffer (state per attachment point)":
17015bd8deadSopenharmony_ci
17025bd8deadSopenharmony_ci                                                                                         Initial
17035bd8deadSopenharmony_ci    Get Value                                Type    Get Command                         Value   Description            Sec.
17045bd8deadSopenharmony_ci    ---------------------------------------- ----    ----------------------------------- ------- ---------------------- -------
17055bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_LAYERED_OES       B       GetFramebufferAttachmentParameteriv FALSE   Framebuffer attachment 9.2.8.1
17065bd8deadSopenharmony_ci                                                                                                 is layered
17075bd8deadSopenharmony_ci
17085bd8deadSopenharmony_ci    Modify description of SHADER_TYPE in table 20.18, "Shader Object State":
17095bd8deadSopenharmony_ci
17105bd8deadSopenharmony_ci                                            Initial
17115bd8deadSopenharmony_ci    Get Value           Type    Get Command Value   Description                   Sec.
17125bd8deadSopenharmony_ci    -----------         ----    ----------- ------- ----------------------------- ----
17135bd8deadSopenharmony_ci    SHADER_TYPE         E       GetShaderiv -       Type of shader (shader stage) 7.1
17145bd8deadSopenharmony_ci
17155bd8deadSopenharmony_ci    Add to table 20.19, "Program Pipeline Object State":
17165bd8deadSopenharmony_ci
17175bd8deadSopenharmony_ci                                                   Initial
17185bd8deadSopenharmony_ci    Get Value           Type  Get Command          Value   Description               Sec.
17195bd8deadSopenharmony_ci    ------------------  ----  -------------------- ------- ------------------------  ----
17205bd8deadSopenharmony_ci    GEOMETRY_SHADER_OES Z+    GetProgramPipelineiv 0       Name of current geometry  7.4
17215bd8deadSopenharmony_ci                                                           shader program object
17225bd8deadSopenharmony_ci
17235bd8deadSopenharmony_ci
17245bd8deadSopenharmony_ci    Add to table 20.22, "Program Object State (cont.)":
17255bd8deadSopenharmony_ci
17265bd8deadSopenharmony_ci                                                          Initial
17275bd8deadSopenharmony_ci    Get Value                        Type   Get Command   Value          Description               Sec.
17285bd8deadSopenharmony_ci    -------------------------        ----  ------------   -------------- ------------------------  --------
17295bd8deadSopenharmony_ci    GEOMETRY_LINKED_VERTICES_OUT_OES Z+    GetProgramiv   0              Max.# of output vertices  11.1gs.4
17305bd8deadSopenharmony_ci    GEOMETRY_LINKED_INPUT_TYPE_OES   E     GetProgramiv   TRIANGLES      Primitive input type      11.1gs.1
17315bd8deadSopenharmony_ci    GEOMETRY_LINKED_OUTPUT_TYPE_OES  E     GetProgramiv   TRIANGLE_STRIP Primitive output type     11.1gs.2
17325bd8deadSopenharmony_ci    GEOMETRY_SHADER_INVOCATIONS_OES  Z+    GetProgramiv   1              # of times a geom. shader 7.12
17335bd8deadSopenharmony_ci                                                                         should be executed for
17345bd8deadSopenharmony_ci                                                                         each input primitive
17355bd8deadSopenharmony_ci
17365bd8deadSopenharmony_ci    Add to table 20.28, "Program Object Resource State (cont.)":
17375bd8deadSopenharmony_ci
17385bd8deadSopenharmony_ci                                                                 Initial
17395bd8deadSopenharmony_ci    Get Value                         Type  Get Command          Value   Description             Sec.
17405bd8deadSopenharmony_ci    --------------------------------- ----  -------------------- ------- ----------------------- -----
17415bd8deadSopenharmony_ci    REFERENCED_BY_GEOMETRY_SHADER_OES Z+    GetProgramResourceiv    -    active resource used by 7.3.1
17425bd8deadSopenharmony_ci                                                                         geometry shader
17435bd8deadSopenharmony_ci
17445bd8deadSopenharmony_ci
17455bd8deadSopenharmony_ci    Rename table 20.29, "Vertex Shader State (not part of program objects)"
17465bd8deadSopenharmony_ci    to "Vertex and Geometry Shader State (not part of program objects)".
17475bd8deadSopenharmony_ci
17485bd8deadSopenharmony_ci
17495bd8deadSopenharmony_ciNew Implementation Dependent State
17505bd8deadSopenharmony_ci
17515bd8deadSopenharmony_ci    Add to table 20.40, "Implementation-Dependent Values (cont.)":
17525bd8deadSopenharmony_ci
17535bd8deadSopenharmony_ci    Get Value                      Type  Get Command    Minimum Value  Description                Sec.
17545bd8deadSopenharmony_ci    --------------------------     ----  -----------    -------------  -------------------------- --------
17555bd8deadSopenharmony_ci    MAX_FRAMEBUFFER_LAYERS_OES     Z+    GetIntegerv    256            maximum layer count for    9.2.1
17565bd8deadSopenharmony_ci                                                                       layered framebuffer object
17575bd8deadSopenharmony_ci    LAYER_PROVOKING_VERTEX_OES     E     GetIntegerv    -- (*)         vertex convention followed 11.1gs.4
17585bd8deadSopenharmony_ci                                                                       by the gl_Layer GLSL
17595bd8deadSopenharmony_ci                                                                       variable
17605bd8deadSopenharmony_ci
17615bd8deadSopenharmony_ci    Add new footnote:
17625bd8deadSopenharmony_ci      (*) Note: Valid values are FIRST_VERTEX_CONVENTION_OES,
17635bd8deadSopenharmony_ci      LAST_VERTEX_CONVENTION_OES, and UNDEFINED_VERTEX_OES.
17645bd8deadSopenharmony_ci
17655bd8deadSopenharmony_ci
17665bd8deadSopenharmony_ci
17675bd8deadSopenharmony_ci    Add new table 20.43gs "Implementation Dependent Geometry Shader Limits"
17685bd8deadSopenharmony_ci    following table 20.43 "Implementation Dependent Vertex Shader Limits":
17695bd8deadSopenharmony_ci
17705bd8deadSopenharmony_ci                                                               Min.
17715bd8deadSopenharmony_ci    Get Value                                Type Get Command  Value Description             Sec.
17725bd8deadSopenharmony_ci    ---------------------------------------- ---- -----------  ----- ----------------------- --------
17735bd8deadSopenharmony_ci    MAX_GEOMETRY_UNIFORM_COMPONENTS_OES      Z+   GetIntegerv  1024  Number of comp. for     11.1gs.3
17745bd8deadSopenharmony_ci                                                                     geom. shader uniform
17755bd8deadSopenharmony_ci                                                                     variables
17765bd8deadSopenharmony_ci    MAX_GEOMETRY_UNIFORM_BLOCKS_OES          Z+   GetIntegerv  12    Max number of geom.     7.6.2
17775bd8deadSopenharmony_ci                                                                     uniform buffers per
17785bd8deadSopenharmony_ci                                                                     program
17795bd8deadSopenharmony_ci    MAX_GEOMETRY_INPUT_COMPONENTS_OES        Z+   GetIntegerv  64    Max number of comp.     11.1gs.4
17805bd8deadSopenharmony_ci                                                                     of inputs read by a
17815bd8deadSopenharmony_ci                                                                     geom. shader
17825bd8deadSopenharmony_ci    MAX_GEOMETRY_OUTPUT_COMPONENTS_OES       Z+   GetIntegerv  64    Max number of comp.     11.1gs.4
17835bd8deadSopenharmony_ci                                                                     of outputs written
17845bd8deadSopenharmony_ci                                                                     by a geom. shader
17855bd8deadSopenharmony_ci    MAX_GEOMETRY_OUTPUT_VERTICES_OES         Z+   GetIntegerv  256   Max number of vertices  11.1gs.4
17865bd8deadSopenharmony_ci                                                                     that any geom. shader
17875bd8deadSopenharmony_ci                                                                     can emit
17885bd8deadSopenharmony_ci    MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES Z+   GetIntegerv  1024  Max number of total     11.1gs.4
17895bd8deadSopenharmony_ci                                                                     comp. (all vertices) of
17905bd8deadSopenharmony_ci                                                                     active outputs that a
17915bd8deadSopenharmony_ci                                                                     geom. shader can emit
17925bd8deadSopenharmony_ci    MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES     Z+   GetIntegerv  16    Number of texture       11.1.3.5
17935bd8deadSopenharmony_ci                                                                     image units accessible
17945bd8deadSopenharmony_ci                                                                     by a geom. shader
17955bd8deadSopenharmony_ci    MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES  Z+   GetIntegerv  0     Number of atom. counter 7.7
17965bd8deadSopenharmony_ci                                                                     buffers accessed
17975bd8deadSopenharmony_ci                                                                     by a geom. shader
17985bd8deadSopenharmony_ci    MAX_GEOMETRY_ATOMIC_COUNTERS_OES         Z+   GetIntegerv  0     Number of atomic        11.1.3.6
17995bd8deadSopenharmony_ci                                                                     counters accessed by a
18005bd8deadSopenharmony_ci                                                                     geom. shader
18015bd8deadSopenharmony_ci    MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES   Z+   GetIntegerv  0     Num. of shader storage  7.8
18025bd8deadSopenharmony_ci                                                                     blocks accessed by a
18035bd8deadSopenharmony_ci                                                                     geom. shader
18045bd8deadSopenharmony_ci    MAX_GEOMETRY_SHADER_INVOCATIONS_OES      Z+   GetIntegerv  32    Max supported geom.     11.1gs.4
18055bd8deadSopenharmony_ci                                                                     shader invocation count
18065bd8deadSopenharmony_ci
18075bd8deadSopenharmony_ci
18085bd8deadSopenharmony_ci
18095bd8deadSopenharmony_ci    Add to table 20.46 "Implementation Dependent Aggregate Shader Limits"
18105bd8deadSopenharmony_ci    ([fn] is a dagger mark referring to existing text in the table caption):
18115bd8deadSopenharmony_ci
18125bd8deadSopenharmony_ci                                                                   Minimum
18135bd8deadSopenharmony_ci    Get Value                                    Type  Get Command Value    Description               Sec.
18145bd8deadSopenharmony_ci    -------------------------------------------- ----  ----------- -------- ------------------------- --------
18155bd8deadSopenharmony_ci    MAX_GEOMETRY_IMAGE_UNIFORMS_OES              Z+    GetIntegerv 0        Number of image variables 11.1.3.7
18165bd8deadSopenharmony_ci                                                                            in geometry shaders
18175bd8deadSopenharmony_ci    MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES Z+    GetIntegerv [fn]     No. of words for geom.    7.6.2
18185bd8deadSopenharmony_ci                                                                            shader uniform vars. in
18195bd8deadSopenharmony_ci                                                                            all uniform blocks
18205bd8deadSopenharmony_ci                                                                            (including default)
18215bd8deadSopenharmony_ci
18225bd8deadSopenharmony_ci    Modify existing entries in table 20.46:
18235bd8deadSopenharmony_ci
18245bd8deadSopenharmony_ci                                                                   Minimum
18255bd8deadSopenharmony_ci    Get Value                                    Type  Get Command Value    Description               Sec.
18265bd8deadSopenharmony_ci    -------------------------------------------- ----  ----------- -------- ------------------------- --------
18275bd8deadSopenharmony_ci    MAX_UNIFORM_BUFFER_BINDINGS                  Z+    GetIntegerv 48       Max no. of uniform buf.   7.6.2
18285bd8deadSopenharmony_ci                                                                            binding points
18295bd8deadSopenharmony_ci    MAX_COMBINED_UNIFORM_BLOCKS                  Z+    GetIntegerv 36       Max. no. of uniform       7.6.2
18305bd8deadSopenharmony_ci                                                                            buffers per program
18315bd8deadSopenharmony_ci    MAX_COMBINED_TEXTURE_IMAGE_UNITS             Z+    GetIntegerv 64       Total no. of tex. units   11.1.3.5
18325bd8deadSopenharmony_ci                                                                            accessible by the GL
18335bd8deadSopenharmony_ci
18345bd8deadSopenharmony_ciAdditions to the OpenGL ES Shading Language 3.10 Specification
18355bd8deadSopenharmony_ci
18365bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
18375bd8deadSopenharmony_ci    language features described in this extension:
18385bd8deadSopenharmony_ci
18395bd8deadSopenharmony_ci      #extension GL_OES_geometry_shader : <behavior>
18405bd8deadSopenharmony_ci      #extension GL_OES_geometry_point_size : <behaviour>
18415bd8deadSopenharmony_ci
18425bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.4.
18435bd8deadSopenharmony_ci
18445bd8deadSopenharmony_ci    A new preprocessor #define is added to the OpenGL ES Shading Language:
18455bd8deadSopenharmony_ci
18465bd8deadSopenharmony_ci      #define GL_OES_geometry_shader 1
18475bd8deadSopenharmony_ci      #define GL_OES_geometry_point_size 1
18485bd8deadSopenharmony_ci
18495bd8deadSopenharmony_ci    If the OES_geometry_shader extension is enabled, the
18505bd8deadSopenharmony_ci    OES_shader_io_blocks extension is also implicitly enabled.
18515bd8deadSopenharmony_ci
18525bd8deadSopenharmony_ci
18535bd8deadSopenharmony_ci    Change the introduction to Chapter 2 "Overview of OpenGL ES Shading" as
18545bd8deadSopenharmony_ci    follows:
18555bd8deadSopenharmony_ci
18565bd8deadSopenharmony_ci    The OpenGL ES Shading Language is actually several closely related
18575bd8deadSopenharmony_ci    languages. These languages are used to create shaders for each of the
18585bd8deadSopenharmony_ci    programmable processors contained in the OpenGL ES processing pipeline.
18595bd8deadSopenharmony_ci    Currently, these processors are the compute, vertex, geometry, and
18605bd8deadSopenharmony_ci    fragment processors.
18615bd8deadSopenharmony_ci
18625bd8deadSopenharmony_ci    Unless otherwise noted in this Specification, a language feature applies
18635bd8deadSopenharmony_ci    to all languages, and common usage will refer to these languages as a
18645bd8deadSopenharmony_ci    single language. The specific languages will be referred to by the name
18655bd8deadSopenharmony_ci    of the processor they target: compute, vertex, geometry, or fragment.
18665bd8deadSopenharmony_ci
18675bd8deadSopenharmony_ci
18685bd8deadSopenharmony_ci    Add new subsection 2.gs preceding subsection 2.2 "Fragment Processor":
18695bd8deadSopenharmony_ci
18705bd8deadSopenharmony_ci    Section 2.gs, Geometry Processor
18715bd8deadSopenharmony_ci
18725bd8deadSopenharmony_ci    The <geometry processor> is a programmable unit that operates on data
18735bd8deadSopenharmony_ci    for incoming vertices for a primitive assembled after vertex processing
18745bd8deadSopenharmony_ci    and outputs a sequence of vertices forming output primitives.
18755bd8deadSopenharmony_ci    Compilation units written in the OpenGL ES Shading Language to run on
18765bd8deadSopenharmony_ci    this processor are called <geometry shaders>. When a geometry shader is
18775bd8deadSopenharmony_ci    compiled and linked, it results in a <geometry shader executable> that
18785bd8deadSopenharmony_ci    runs on the geometry processor.
18795bd8deadSopenharmony_ci
18805bd8deadSopenharmony_ci    A single invocation of the geometry shader executable on the geometry
18815bd8deadSopenharmony_ci    processor will operate on a declared input primitive with a fixed number
18825bd8deadSopenharmony_ci    of vertices. This single invocation can emit a variable number of
18835bd8deadSopenharmony_ci    vertices that are assembled into primitives of a declared output
18845bd8deadSopenharmony_ci    primitive type and passed to subsequent pipeline stages.
18855bd8deadSopenharmony_ci
18865bd8deadSopenharmony_ci
18875bd8deadSopenharmony_ci    Modify section 4.3.4 "Input Variables", adding following the paragraph
18885bd8deadSopenharmony_ci    starting "It is expected that ... columns in the matrix" on p. 40:
18895bd8deadSopenharmony_ci
18905bd8deadSopenharmony_ci    Geometry shader input variables get the per-vertex values written out by
18915bd8deadSopenharmony_ci    output variables of the same names in the previous active (vertex)
18925bd8deadSopenharmony_ci    shader stage. For these inputs, "centroid in", "sample in", and
18935bd8deadSopenharmony_ci    interpolation qualifiers are allowed, but are equivalent to "in". Since
18945bd8deadSopenharmony_ci    geometry shaders operate on a set of vertices, each input variable or
18955bd8deadSopenharmony_ci    input block (see section 4.3.9 "Interface Blocks") needs to be declared
18965bd8deadSopenharmony_ci    as an array. For example,
18975bd8deadSopenharmony_ci
18985bd8deadSopenharmony_ci       in float foo[];    // geometry shader input for vertex "out float foo"
18995bd8deadSopenharmony_ci
19005bd8deadSopenharmony_ci    Each element of such an array corresponds to one vertex of the primitive
19015bd8deadSopenharmony_ci    being processed. Each array can optionally have a size declared. The
19025bd8deadSopenharmony_ci    array size will be set by (or if provided must be consistent with) the
19035bd8deadSopenharmony_ci    input layout declaration(s) establishing the type of input primitive, as
19045bd8deadSopenharmony_ci    described later in section 4.4.1 "Input Layout Qualifiers".
19055bd8deadSopenharmony_ci
19065bd8deadSopenharmony_ci    Some inputs and outputs are <arrayed>, meaning that for an interface
19075bd8deadSopenharmony_ci    between two shader stages either the input or output declaration
19085bd8deadSopenharmony_ci    requires an extra level of array indexing for the declarations to match.
19095bd8deadSopenharmony_ci    For example, with the interface between a vertex shader and a geometry
19105bd8deadSopenharmony_ci    shader, vertex shader output variables and geometry shader input
19115bd8deadSopenharmony_ci    variables of the same name must match in type and qualification (other
19125bd8deadSopenharmony_ci    than precision and "out" matching to "in"), except that the geometry
19135bd8deadSopenharmony_ci    shader will have one more array dimension than the vertex shader, to
19145bd8deadSopenharmony_ci    allow for vertex indexing. If such an arrayed interface variable is not
19155bd8deadSopenharmony_ci    declared with the necessary additional input or output array dimension,
19165bd8deadSopenharmony_ci    a link-time error will result.
19175bd8deadSopenharmony_ci
19185bd8deadSopenharmony_ci    For non-arrayed interfaces (meaning array dimensionally stays the same
19195bd8deadSopenharmony_ci    between stages), it is a link-time error if the input variable is not
19205bd8deadSopenharmony_ci    declared with the same type, including array dimensionality, and
19215bd8deadSopenharmony_ci    qualification (other than precision and "out" matching to "in") as the
19225bd8deadSopenharmony_ci    matching output variable.
19235bd8deadSopenharmony_ci
19245bd8deadSopenharmony_ci    Fragment shader inputs get per-fragment values...
19255bd8deadSopenharmony_ci
19265bd8deadSopenharmony_ci
19275bd8deadSopenharmony_ci    Modify section 4.3.6 "Output Variables" starting with the third
19285bd8deadSopenharmony_ci    paragraph of the section, as modified by
19295bd8deadSopenharmony_ci    OES_shader_multisample_interpolation, on p. 42:
19305bd8deadSopenharmony_ci
19315bd8deadSopenharmony_ci    Vertex and geometry output variables output per-vertex data and are
19325bd8deadSopenharmony_ci    declared using the "out", "centroid out", or "sample out" storage
19335bd8deadSopenharmony_ci    qualifiers. ...
19345bd8deadSopenharmony_ci
19355bd8deadSopenharmony_ci    Individual vertex and geometry outputs are declared as in the following
19365bd8deadSopenharmony_ci    examples: ...
19375bd8deadSopenharmony_ci
19385bd8deadSopenharmony_ci        ...
19395bd8deadSopenharmony_ci        flat out vec3 myColor;
19405bd8deadSopenharmony_ci        sample out vec4 perSampleColor;
19415bd8deadSopenharmony_ci
19425bd8deadSopenharmony_ci    These can also appear in interface blocks, as described in section 4.3.9
19435bd8deadSopenharmony_ci    "Interface Blocks". Interface blocks allow simpler addition of arrays to
19445bd8deadSopenharmony_ci    the interface from vertex to geometry shader. They also allow a fragment
19455bd8deadSopenharmony_ci    shader to have the same input interface as a geometry shader for a given
19465bd8deadSopenharmony_ci    vertex shader.
19475bd8deadSopenharmony_ci
19485bd8deadSopenharmony_ci    Fragment outputs output per-fragment data ...
19495bd8deadSopenharmony_ci
19505bd8deadSopenharmony_ci
19515bd8deadSopenharmony_ci    Modify section 4.3.9 "Interface Blocks" as modified by
19525bd8deadSopenharmony_ci    OES_shader_io_blocks, to add following the paragraph starting "When
19535bd8deadSopenharmony_ci    using OpenGL ES API entry points to identify the name":
19545bd8deadSopenharmony_ci
19555bd8deadSopenharmony_ci    Geometry shader input blocks must be declared as arrays and follow the
19565bd8deadSopenharmony_ci    array declaration and linking rules for all geometry shader inputs. All
19575bd8deadSopenharmony_ci    other input and output block arrays must specify an array size.
19585bd8deadSopenharmony_ci
19595bd8deadSopenharmony_ci
19605bd8deadSopenharmony_ci    Modify section 4.4.1 "Input Layout Qualifiers" as modified
19615bd8deadSopenharmony_ci    by OES_shader_io_blocks:
19625bd8deadSopenharmony_ci
19635bd8deadSopenharmony_ci    Insert a new section 4.4.1.gs, before section 4.4.1.fs:
19645bd8deadSopenharmony_ci
19655bd8deadSopenharmony_ci    Section 4.4.1.gs, Geometry Shader Inputs
19665bd8deadSopenharmony_ci
19675bd8deadSopenharmony_ci    Additional layout qualifier identifiers for geometry shader inputs
19685bd8deadSopenharmony_ci    include primitive identifiers and an invocation count identifier:
19695bd8deadSopenharmony_ci
19705bd8deadSopenharmony_ci      <layout-qualifier-id>
19715bd8deadSopenharmony_ci        points
19725bd8deadSopenharmony_ci        lines
19735bd8deadSopenharmony_ci        lines_adjacency
19745bd8deadSopenharmony_ci        triangles
19755bd8deadSopenharmony_ci        triangles_adjacency
19765bd8deadSopenharmony_ci        invocations = integer-constant
19775bd8deadSopenharmony_ci
19785bd8deadSopenharmony_ci    The identifiers points, lines, lines_adjacency, triangles, and
19795bd8deadSopenharmony_ci    triangles_adjacency are used to specify the type of input primitive
19805bd8deadSopenharmony_ci    accepted by the geometry shader, and only one of these is accepted. The
19815bd8deadSopenharmony_ci    geometry shader object in a program must declare this input primitive
19825bd8deadSopenharmony_ci    layout, and all geometry shader input layout declarations in a program
19835bd8deadSopenharmony_ci    must declare the same layout.
19845bd8deadSopenharmony_ci
19855bd8deadSopenharmony_ci    The identifier invocations is used to specify the number of times the
19865bd8deadSopenharmony_ci    geometry shader executable is invoked for each input primitive received.
19875bd8deadSopenharmony_ci    Invocation count declarations are optional. If no invocation count is
19885bd8deadSopenharmony_ci    declared in any geometry shader in a program, the geometry shader will
19895bd8deadSopenharmony_ci    be run once for each input primitive. If an invocation count is
19905bd8deadSopenharmony_ci    declared, all such declarations must specify the same count. If a shader
19915bd8deadSopenharmony_ci    specifies an invocation count greater than the implementation-dependent
19925bd8deadSopenharmony_ci    maximum, it will fail to compile.
19935bd8deadSopenharmony_ci
19945bd8deadSopenharmony_ci    For example,
19955bd8deadSopenharmony_ci
19965bd8deadSopenharmony_ci      layout(triangles, invocations = 6) in;
19975bd8deadSopenharmony_ci
19985bd8deadSopenharmony_ci    will establish that all inputs to the geometry shader are triangles and
19995bd8deadSopenharmony_ci    that the geometry shader executable is run six times for each triangle
20005bd8deadSopenharmony_ci    processed.
20015bd8deadSopenharmony_ci
20025bd8deadSopenharmony_ci    All geometry shader input unsized array declarations will be sized by an
20035bd8deadSopenharmony_ci    earlier input primitive layout qualifier, when present, as per the
20045bd8deadSopenharmony_ci    following table.
20055bd8deadSopenharmony_ci
20065bd8deadSopenharmony_ci        Layout                Size of Input Arrays
20075bd8deadSopenharmony_ci        -------------------   --------------------
20085bd8deadSopenharmony_ci        points                        1
20095bd8deadSopenharmony_ci        lines                         2
20105bd8deadSopenharmony_ci        lines_adjacency               4
20115bd8deadSopenharmony_ci        triangles                     3
20125bd8deadSopenharmony_ci        triangles_adjacency           6
20135bd8deadSopenharmony_ci
20145bd8deadSopenharmony_ci    The intrinsically declared input array gl_in[] will also be sized by any
20155bd8deadSopenharmony_ci    input primitive-layout declaration. Hence, the expression
20165bd8deadSopenharmony_ci
20175bd8deadSopenharmony_ci      gl_in.length()
20185bd8deadSopenharmony_ci
20195bd8deadSopenharmony_ci    will return the value from the table above.
20205bd8deadSopenharmony_ci
20215bd8deadSopenharmony_ci    For inputs declared without an array size, including intrinsically
20225bd8deadSopenharmony_ci    declared inputs (i.e., gl_in), a layout must be declared before any use
20235bd8deadSopenharmony_ci    of the method length or other any array use that requires the array size
20245bd8deadSopenharmony_ci    to be known.
20255bd8deadSopenharmony_ci
20265bd8deadSopenharmony_ci    It is a compile-time error if a layout declaration's array size (from
20275bd8deadSopenharmony_ci    table above) does not match all the explicit array sizes specified in
20285bd8deadSopenharmony_ci    declarations of an input variables in the same shader. The following
20295bd8deadSopenharmony_ci    includes examples of compile-time errors:
20305bd8deadSopenharmony_ci
20315bd8deadSopenharmony_ci      // code sequence within one shader...
20325bd8deadSopenharmony_ci      in vec4 Color1[];      // legal, size still unknown
20335bd8deadSopenharmony_ci      in vec4 Color2[2];     // legal, size is 2
20345bd8deadSopenharmony_ci      in vec4 Color3[3];     // illegal, input sizes are inconsistent
20355bd8deadSopenharmony_ci      layout(lines) in;      // legal for Color2, input size is 2, matching Color2
20365bd8deadSopenharmony_ci      in vec4 Color4[3];     // illegal, contradicts layout of lines
20375bd8deadSopenharmony_ci      layout(lines) in;      // legal, matches other layout() declaration
20385bd8deadSopenharmony_ci      layout(triangles) in;  // illegal, does not match earlier layout() declaration
20395bd8deadSopenharmony_ci
20405bd8deadSopenharmony_ci    It is a link-time error if not all provided sizes (sized input arrays
20415bd8deadSopenharmony_ci    and layout size) match in the geometry shader of a program.
20425bd8deadSopenharmony_ci
20435bd8deadSopenharmony_ci
20445bd8deadSopenharmony_ci    Add new section 4.4.2.gs before section 4.4.2.fs, as added by
20455bd8deadSopenharmony_ci    OES_shader_io_blocks:
20465bd8deadSopenharmony_ci
20475bd8deadSopenharmony_ci
20485bd8deadSopenharmony_ci    Section 4.4.2.gs Geometry Outputs
20495bd8deadSopenharmony_ci
20505bd8deadSopenharmony_ci    Geometry shaders can have two additional types of output layout
20515bd8deadSopenharmony_ci    identifiers: an output primitive type and a maximum output vertex count.
20525bd8deadSopenharmony_ci    The primitive type and vertex count identifiers are allowed only on the
20535bd8deadSopenharmony_ci    interface qualifier out, not on an output block, block member, or
20545bd8deadSopenharmony_ci    variable declaration.
20555bd8deadSopenharmony_ci
20565bd8deadSopenharmony_ci    The layout qualifier identifiers for geometry shader outputs are
20575bd8deadSopenharmony_ci
20585bd8deadSopenharmony_ci      layout-qualifier-id
20595bd8deadSopenharmony_ci          points
20605bd8deadSopenharmony_ci          line_strip
20615bd8deadSopenharmony_ci          triangle_strip
20625bd8deadSopenharmony_ci          max_vertices = integer-constant
20635bd8deadSopenharmony_ci
20645bd8deadSopenharmony_ci    The primitive type identifiers points, line_strip, and triangle_strip
20655bd8deadSopenharmony_ci    are used to specify the type of output primitive produced by the
20665bd8deadSopenharmony_ci    geometry shader, and only one of these is accepted. The geometry shader
20675bd8deadSopenharmony_ci    object in a program must declare an output primitive type, and all
20685bd8deadSopenharmony_ci    geometry shader output primitive type declarations in a program must
20695bd8deadSopenharmony_ci    declare the same primitive type.
20705bd8deadSopenharmony_ci
20715bd8deadSopenharmony_ci    The vertex count identifier max_vertices is used to specify the maximum
20725bd8deadSopenharmony_ci    number of vertices the shader will ever emit in a single invocation. The
20735bd8deadSopenharmony_ci    geometry shader object in a program must declare a maximum output vertex
20745bd8deadSopenharmony_ci    count, and all geometry shader output vertex count declarations in a
20755bd8deadSopenharmony_ci    program must declare the same count.
20765bd8deadSopenharmony_ci
20775bd8deadSopenharmony_ci    In this example,
20785bd8deadSopenharmony_ci
20795bd8deadSopenharmony_ci      layout(triangle_strip, max_vertices = 60) out;  // order does not matter
20805bd8deadSopenharmony_ci      layout(max_vertices = 60) out;      // redeclaration okay
20815bd8deadSopenharmony_ci      layout(triangle_strip) out;         // redeclaration okay
20825bd8deadSopenharmony_ci      layout(points) out;                 // error, contradicts triangle_strip
20835bd8deadSopenharmony_ci      layout(max_vertices = 30) out;      // error, contradicts 60
20845bd8deadSopenharmony_ci
20855bd8deadSopenharmony_ci    all outputs from the geometry shader are triangles and at most 60
20865bd8deadSopenharmony_ci    vertices will be emitted by the shader. It is an error for the maximum
20875bd8deadSopenharmony_ci    number of vertices to be greater than gl_MaxGeometryOutputVertices.
20885bd8deadSopenharmony_ci
20895bd8deadSopenharmony_ci    All geometry shader output layout declarations in a program must declare
20905bd8deadSopenharmony_ci    the same layout and same value for max_vertices. If geometry shaders are
20915bd8deadSopenharmony_ci    in a program, there must be at least one geometry output layout
20925bd8deadSopenharmony_ci    declaration somewhere in that program.
20935bd8deadSopenharmony_ci
20945bd8deadSopenharmony_ci
20955bd8deadSopenharmony_ci    Modify section 4.7.4, "Default Precision Qualifiers":
20965bd8deadSopenharmony_ci
20975bd8deadSopenharmony_ci    Modify the third paragraph on p. 64:
20985bd8deadSopenharmony_ci
20995bd8deadSopenharmony_ci    "All languages except for the fragment language have the following
21005bd8deadSopenharmony_ci    predeclared globally scoped default precision statements: ..."
21015bd8deadSopenharmony_ci
21025bd8deadSopenharmony_ci
21035bd8deadSopenharmony_ci    Add new section 7.1.1gs following section 7.1.1 "Vertex Shader Special
21045bd8deadSopenharmony_ci    Variables":
21055bd8deadSopenharmony_ci
21065bd8deadSopenharmony_ci    Section 7.1.1gs, Geometry Shader Special Variables
21075bd8deadSopenharmony_ci
21085bd8deadSopenharmony_ci    In the geometry language, the built-in variables are intrinsically
21095bd8deadSopenharmony_ci    declared as:
21105bd8deadSopenharmony_ci
21115bd8deadSopenharmony_ci        [[ If OES_geometry_point_size is supported and enabled: ]]
21125bd8deadSopenharmony_ci      in gl_PerVertex {
21135bd8deadSopenharmony_ci          highp vec4 gl_Position;
21145bd8deadSopenharmony_ci          highp float gl_PointSize;
21155bd8deadSopenharmony_ci      } gl_in[];
21165bd8deadSopenharmony_ci
21175bd8deadSopenharmony_ci        [[ Otherwise: ]]
21185bd8deadSopenharmony_ci      in gl_PerVertex {
21195bd8deadSopenharmony_ci          highp vec4 gl_Position;
21205bd8deadSopenharmony_ci      } gl_in[];
21215bd8deadSopenharmony_ci
21225bd8deadSopenharmony_ci      in highp int gl_PrimitiveIDIn;
21235bd8deadSopenharmony_ci      in highp int gl_InvocationID;
21245bd8deadSopenharmony_ci
21255bd8deadSopenharmony_ci        [[ If OES_geometry_point_size is supported and enabled: ]]
21265bd8deadSopenharmony_ci      out gl_PerVertex {
21275bd8deadSopenharmony_ci          highp vec4 gl_Position;
21285bd8deadSopenharmony_ci          highp float gl_PointSize;
21295bd8deadSopenharmony_ci      };
21305bd8deadSopenharmony_ci
21315bd8deadSopenharmony_ci        [[ Otherwise: ]]
21325bd8deadSopenharmony_ci      out gl_PerVertex {
21335bd8deadSopenharmony_ci          highp vec4 gl_Position;
21345bd8deadSopenharmony_ci      };
21355bd8deadSopenharmony_ci
21365bd8deadSopenharmony_ci      out highp int gl_PrimitiveID;
21375bd8deadSopenharmony_ci      out highp int gl_Layer;
21385bd8deadSopenharmony_ci
21395bd8deadSopenharmony_ci
21405bd8deadSopenharmony_ci    Section 7.1.1gs.1, Geometry Shader Input Variables
21415bd8deadSopenharmony_ci
21425bd8deadSopenharmony_ci    gl_Position contains the output written in the previous shader stage to
21435bd8deadSopenharmony_ci    gl_Position.
21445bd8deadSopenharmony_ci
21455bd8deadSopenharmony_ci      [[ If OES_geometry_point_size is supported: ]]
21465bd8deadSopenharmony_ci    gl_PointSize contains the output written in the previous shader stage to
21475bd8deadSopenharmony_ci    gl_PointSize.
21485bd8deadSopenharmony_ci
21495bd8deadSopenharmony_ci    gl_PrimitiveIDIn contains the number of primitives processed by the
21505bd8deadSopenharmony_ci    shader since the current set of rendering primitives was started.
21515bd8deadSopenharmony_ci
21525bd8deadSopenharmony_ci    gl_InvocationID contains the invocation number assigned to the geometry
21535bd8deadSopenharmony_ci    shader invocation. It is assigned integer values in the range [0, N-1],
21545bd8deadSopenharmony_ci    where N is the number of geometry shader invocations per primitive.
21555bd8deadSopenharmony_ci
21565bd8deadSopenharmony_ci
21575bd8deadSopenharmony_ci    Section 7.1.1gs.2, Geometry Shader Output Variables
21585bd8deadSopenharmony_ci
21595bd8deadSopenharmony_ci    gl_Position is used in the same fashion as the corresponding output
21605bd8deadSopenharmony_ci    variable in the vertex shader. Its value is undefined after geometry
21615bd8deadSopenharmony_ci    processing if the shader calls EmitVertex() without having written
21625bd8deadSopenharmony_ci    gl_Position since the last EmitVertex(), or does not write it at all.
21635bd8deadSopenharmony_ci
21645bd8deadSopenharmony_ci      [[ If OES_geometry_point_size is supported: ]]
21655bd8deadSopenharmony_ci    gl_PointSize is used in the same fashion as the corresponding output
21665bd8deadSopenharmony_ci    variable in the vertex shader.
21675bd8deadSopenharmony_ci
21685bd8deadSopenharmony_ci    gl_PrimitiveID is filled with a single integer that serves as a
21695bd8deadSopenharmony_ci    primitive identifier to the fragment shader. This is then available to
21705bd8deadSopenharmony_ci    fragment shaders, which will select the written primitive ID from the
21715bd8deadSopenharmony_ci    provoking vertex of the primitive being shaded. If a fragment shader
21725bd8deadSopenharmony_ci    using gl_PrimitiveID is active and a geometry shader is also active, the
21735bd8deadSopenharmony_ci    geometry shader must write to gl_PrimitiveID or the fragment shader
21745bd8deadSopenharmony_ci    input gl_PrimitiveID is undefined. See section 11.1gs.4 "Geometry Shader
21755bd8deadSopenharmony_ci    Outputs" of the OpenGL ES Specification for more information.
21765bd8deadSopenharmony_ci
21775bd8deadSopenharmony_ci    gl_Layer is used to select a specific layer (or face and layer of a cube
21785bd8deadSopenharmony_ci    map) of a multi-layer framebuffer attachment. The actual layer used will
21795bd8deadSopenharmony_ci    come from one of the vertices in the primitive being shaded. Which
21805bd8deadSopenharmony_ci    vertex the layer comes from is determined as discussed in section
21815bd8deadSopenharmony_ci    11.1gs.4 of the OpenGL ES Specification but may be undefined, so it is
21825bd8deadSopenharmony_ci    best to write the same layer value for all vertices of a primitive. If a
21835bd8deadSopenharmony_ci    shader statically assigns a value to gl_Layer, layered rendering mode is
21845bd8deadSopenharmony_ci    enabled. See section 11.1gs.4 "Geometry Shader Outputs"and section 9.7gs
21855bd8deadSopenharmony_ci    "Layered Framebuffers" of the OpenGL ES Specification for more
21865bd8deadSopenharmony_ci    information. If a shader statically assigns a value to gl_Layer, and
21875bd8deadSopenharmony_ci    there is an execution path through the shader that does not set
21885bd8deadSopenharmony_ci    gl_Layer, then the value of gl_Layer is undefined for executions of the
21895bd8deadSopenharmony_ci    shader that take that path.
21905bd8deadSopenharmony_ci
21915bd8deadSopenharmony_ci
21925bd8deadSopenharmony_ci    Modify section 7.1.2 "Fragment Shader Special Variables", as modified by
21935bd8deadSopenharmony_ci    OES_sample_variables:
21945bd8deadSopenharmony_ci
21955bd8deadSopenharmony_ci    Add to the list of built-in variables:
21965bd8deadSopenharmony_ci
21975bd8deadSopenharmony_ci      in highp int gl_PrimitiveID;
21985bd8deadSopenharmony_ci      in highp int gl_Layer;
21995bd8deadSopenharmony_ci
22005bd8deadSopenharmony_ci    Add descriptions of these variables:
22015bd8deadSopenharmony_ci
22025bd8deadSopenharmony_ci    The input variable gl_PrimitiveID is filled with the value written to
22035bd8deadSopenharmony_ci    the gl_PrimitiveID geometry shader output, if a geometry shader is
22045bd8deadSopenharmony_ci    present. Otherwise, it is filled with the number of primitives processed
22055bd8deadSopenharmony_ci    by the shader since the current set of rendering primitives was started.
22065bd8deadSopenharmony_ci
22075bd8deadSopenharmony_ci    The input variable gl_Layer is filled with the value written to the
22085bd8deadSopenharmony_ci    gl_Layer geometry shader output, if a geometry shader is present. If the
22095bd8deadSopenharmony_ci    geometry stage does not dynamically assign a value to gl_Layer, the
22105bd8deadSopenharmony_ci    value of gl_Layer in the fragment stage will be undefined. If the
22115bd8deadSopenharmony_ci    geometry stage makes no static assignment to gl_Layer, the input value
22125bd8deadSopenharmony_ci    in the fragment stage will be zero. Otherwise, the fragment stage will
22135bd8deadSopenharmony_ci    read the same value written by the geometry stage, even if that value is
22145bd8deadSopenharmony_ci    out of range. If a fragment shader contains a static access to gl_Layer,
22155bd8deadSopenharmony_ci    it will count against the implementation defined limit for the maximum
22165bd8deadSopenharmony_ci    number of inputs to the fragment stage.
22175bd8deadSopenharmony_ci
22185bd8deadSopenharmony_ci    Modify the description of gl_FrontFacing:
22195bd8deadSopenharmony_ci
22205bd8deadSopenharmony_ci    The input variable gl_FrontFacing is true if the fragment belongs to a
22215bd8deadSopenharmony_ci    front-facing primitive. One use of this is to emulate two-sided lighting
22225bd8deadSopenharmony_ci    by selecting one of two colors calculated by a vertex or geometry
22235bd8deadSopenharmony_ci    shader.
22245bd8deadSopenharmony_ci
22255bd8deadSopenharmony_ci
22265bd8deadSopenharmony_ci    Add to Section 7.2 "Built-In Constants", matching the
22275bd8deadSopenharmony_ci    corresponding API implementation-dependent limits:
22285bd8deadSopenharmony_ci
22295bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryInputComponents = 64;
22305bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryOutputComponents = 128;
22315bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryImageUniforms = 0;
22325bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryTextureImageUnits = 16;
22335bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryOutputVertices = 256;
22345bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryTotalOutputComponents = 1024;
22355bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryUniformComponents = 1024;
22365bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryAtomicCounters = 0;
22375bd8deadSopenharmony_ci      const mediump int gl_MaxGeometryAtomicCounterBuffers = 0;
22385bd8deadSopenharmony_ci
22395bd8deadSopenharmony_ci    Modify gl_MaxCombinedTextureImageUnits to match the API:
22405bd8deadSopenharmony_ci
22415bd8deadSopenharmony_ci      const mediump int gl_MaxCombinedTextureImageUnits = 64;
22425bd8deadSopenharmony_ci
22435bd8deadSopenharmony_ci
22445bd8deadSopenharmony_ci    Add new section 8.12gs preceding section 8.13 "Fragment Processing
22455bd8deadSopenharmony_ci    Functions":
22465bd8deadSopenharmony_ci
22475bd8deadSopenharmony_ci    Section 8.12gs, Geometry Shader Functions
22485bd8deadSopenharmony_ci
22495bd8deadSopenharmony_ci    These functions are only available in geometry shaders. They are
22505bd8deadSopenharmony_ci    described in more depth following the table.
22515bd8deadSopenharmony_ci
22525bd8deadSopenharmony_ci        Syntax              Description
22535bd8deadSopenharmony_ci        ------------------- -----------------------------------------------
22545bd8deadSopenharmony_ci        void EmitVertex()   Emits the current values of output variables to
22555bd8deadSopenharmony_ci                            the current output primitive. On return from
22565bd8deadSopenharmony_ci                            this call, the values of output variables are
22575bd8deadSopenharmony_ci                            undefined.
22585bd8deadSopenharmony_ci        void EndPrimitive() Completes the current output primitive and
22595bd8deadSopenharmony_ci                            starts a new one. No vertex is emitted.
22605bd8deadSopenharmony_ci
22615bd8deadSopenharmony_ci    The function EmitVertex() specifies that a vertex is completed. A vertex
22625bd8deadSopenharmony_ci    is added to the current output primitive using the current values of all
22635bd8deadSopenharmony_ci    built-in and user-defined output variables. The values of all output
22645bd8deadSopenharmony_ci    variables are undefined after a call to EmitVertex(). If a geometry
22655bd8deadSopenharmony_ci    shader invocation has emitted more vertices than permitted by the output
22665bd8deadSopenharmony_ci    layout qualifier max_vertices, the results of calling EmitVertex() are
22675bd8deadSopenharmony_ci    undefined.
22685bd8deadSopenharmony_ci
22695bd8deadSopenharmony_ci    The function EndPrimitive() specifies that the current output primitive
22705bd8deadSopenharmony_ci    is completed and a new output primitive (of the same type) will be
22715bd8deadSopenharmony_ci    started by any subsequent EmitVertex(). This function does not emit a
22725bd8deadSopenharmony_ci    vertex. If the output layout is declared to be "points", calling
22735bd8deadSopenharmony_ci    EndPrimitive() is optional.
22745bd8deadSopenharmony_ci
22755bd8deadSopenharmony_ci    A geometry shader starts with an output primitive containing no
22765bd8deadSopenharmony_ci    vertices. When a geometry shader terminates, the current output
22775bd8deadSopenharmony_ci    primitive is automatically completed. It is not necessary to call
22785bd8deadSopenharmony_ci    EndPrimitive() if the geometry shader writes only a single primitive.
22795bd8deadSopenharmony_ci
22805bd8deadSopenharmony_ci
22815bd8deadSopenharmony_ci    Modify section 8.16, "Shader Memory Control Functions" to change the
22825bd8deadSopenharmony_ci    paragraph starting "When these functions return..." on p. 139:
22835bd8deadSopenharmony_ci
22845bd8deadSopenharmony_ci    When these functions return ... the execution of the original shader
22855bd8deadSopenharmony_ci    invocation (e.g., fragment shader invocations for a primitive resulting
22865bd8deadSopenharmony_ci    from a particular vertex or geometry shader invocation).
22875bd8deadSopenharmony_ci
22885bd8deadSopenharmony_ciIssues
22895bd8deadSopenharmony_ci
22905bd8deadSopenharmony_ci    Note: These issues apply specifically to the definition of the
22915bd8deadSopenharmony_ci    OES_geometry_shader specification, which is based on the OpenGL
22925bd8deadSopenharmony_ci    extension ARB_geometry_shader4 as updated in OpenGL 4.x. Resolved issues
22935bd8deadSopenharmony_ci    from ARB_geometry_shader4 have been removed, but remain largely
22945bd8deadSopenharmony_ci    applicable to this extension. ARB_geometry_shader4 can be found in the
22955bd8deadSopenharmony_ci    OpenGL Registry.
22965bd8deadSopenharmony_ci
22975bd8deadSopenharmony_ci    (1) What functionality was removed from ARB_geometry_shader4 / GL 4.4?
22985bd8deadSopenharmony_ci
22995bd8deadSopenharmony_ci      - Interactions with features not supported by the underlying
23005bd8deadSopenharmony_ci        ES 3.1 API and Shading Language, including:
23015bd8deadSopenharmony_ci          * one-dimensional, rectangular, and cube map array textures (cube
23025bd8deadSopenharmony_ci            map array textures are restored in OES_texture_cube_map_array).
23035bd8deadSopenharmony_ci          * vertex program point size mode
23045bd8deadSopenharmony_ci          * viewport arrays and other support for multiple viewports
23055bd8deadSopenharmony_ci          * multiple vertex streams (these require ARB_transform_feedback3)
23065bd8deadSopenharmony_ci          * gl_ClipDistance shader inputs and outputs.
23075bd8deadSopenharmony_ci          * CopyPixels and Bitmap
23085bd8deadSopenharmony_ci          * fixed-functionality vertex and fragment shader stages
23095bd8deadSopenharmony_ci          * "component" layout
23105bd8deadSopenharmony_ci          * Implicit references to glPolygonMode
23115bd8deadSopenharmony_ci          * References allowing or assuming more than one shader object per
23125bd8deadSopenharmony_ci            pipeline stage.
23135bd8deadSopenharmony_ci      - FramebufferTexture3D (use FramebufferTextureLayer instead).
23145bd8deadSopenharmony_ci      - gl_MaxGeometryVaryingComponents
23155bd8deadSopenharmony_ci      - gl_VerticesIn
23165bd8deadSopenharmony_ci      - FramebufferTextureFaceARB (also removed from GL core)
23175bd8deadSopenharmony_ci      - The FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_OES completeness condition,
23185bd8deadSopenharmony_ci        also removed from desktop GL.
23195bd8deadSopenharmony_ci      - Description of limitations of GeForce series 8 chips.
23205bd8deadSopenharmony_ci      - GLSL two-dimensional arrays (already supported by GLSL-ES 3.10 in a
23215bd8deadSopenharmony_ci        more general fashion). Note that while multi-dimensional arrays are
23225bd8deadSopenharmony_ci        supported, they are explicitly not supported as shader inputs and
23235bd8deadSopenharmony_ci        outputs, and that decision is respected here.
23245bd8deadSopenharmony_ci      - multiple compilation units of the same shader type.
23255bd8deadSopenharmony_ci
23265bd8deadSopenharmony_ci    (2) What functionality was changed and added relative to
23275bd8deadSopenharmony_ci        ARB_geometry_shader4 and GL 4.4?
23285bd8deadSopenharmony_ci
23295bd8deadSopenharmony_ci      - OES_geometry_shader closely matches OpenGL 4.4 geometry shader
23305bd8deadSopenharmony_ci        language, rather than ARB_geometry_shader language.
23315bd8deadSopenharmony_ci      - In particular, input and output interface blocks were added from GL
23325bd8deadSopenharmony_ci        4.4 / GLSL 4.40, via the required OES_shader_io_blocks extension.
23335bd8deadSopenharmony_ci      - Interactions were added with OpenGL ES 3.1 functionality including
23345bd8deadSopenharmony_ci        separate shader objects, shader atomic counters, shader storage
23355bd8deadSopenharmony_ci        buffer objects, and shader image load/store.
23365bd8deadSopenharmony_ci      - Geometry instancing was added from ARB_gpu_shader5.
23375bd8deadSopenharmony_ci      - FRAMEBUFFER_DEFAULT_LAYERS_OES and MAX_FRAMEBUFFER_LAYERS_OES state
23385bd8deadSopenharmony_ci        and related spec language from ARB_framebuffer_no_attachments (it
23395bd8deadSopenharmony_ci        was removed from OpenGL ES 3.1).
23405bd8deadSopenharmony_ci      - PRIMITIVES_GENERATED_OES query from OpenGL 3.0, to count primitives
23415bd8deadSopenharmony_ci        due to geometry amplification by geometry shaders.
23425bd8deadSopenharmony_ci      - LAYER_PROVOKING_VERTEX_OES query from ARB_provoking_vertex /
23435bd8deadSopenharmony_ci        ARB_viewport_array (but did not add ProvokingVertex control, just
23445bd8deadSopenharmony_ci        this query).
23455bd8deadSopenharmony_ci      - Specify undefined behavior when appending outputs to XFB buffers if
23465bd8deadSopenharmony_ci        any component would be written at a misaligned offset, from
23475bd8deadSopenharmony_ci        ARB_enhanced_layouts. Bug 11191 is tracking this into ES 3.1, as
23485bd8deadSopenharmony_ci        it's not specific to geometry shaders.
23495bd8deadSopenharmony_ci      - Writing point size from geometry shaders is optional functionality.
23505bd8deadSopenharmony_ci        If it's not supported or written, the point size of 1.0 is used.
23515bd8deadSopenharmony_ci      - Added precision qualifiers to builtins.
23525bd8deadSopenharmony_ci      - Clarification from Bug 11508.
23535bd8deadSopenharmony_ci      - Added program interface query properties relevant to geometry
23545bd8deadSopenharmony_ci        shaders.
23555bd8deadSopenharmony_ci
23565bd8deadSopenharmony_ci    (3) Should GetActiveUniformBlockiv support queries for uniform blocks
23575bd8deadSopenharmony_ci        and atomic counter buffers referenced by geometry shaders?
23585bd8deadSopenharmony_ci
23595bd8deadSopenharmony_ci    RESOLVED: No. Use the new generic program interface query supported by
23605bd8deadSopenharmony_ci    OpenGL ES 3.1, following the behavior of features added to 3.1 such as
23615bd8deadSopenharmony_ci    compute shaders, which also dropped these legacy tokens / queries.
23625bd8deadSopenharmony_ci
23635bd8deadSopenharmony_ci    (4) How are aggregate shader limits computed?
23645bd8deadSopenharmony_ci
23655bd8deadSopenharmony_ci    RESOLVED: Following the GL 4.4 model, but we restrict uniform
23665bd8deadSopenharmony_ci    buffer bindings to 12/stage instead of 14, this results in
23675bd8deadSopenharmony_ci
23685bd8deadSopenharmony_ci        MAX_UNIFORM_BUFFER_BINDINGS = 48
23695bd8deadSopenharmony_ci            This is 12 bindings/stage * 4 shader stages, allowing a static
23705bd8deadSopenharmony_ci            partitioning of the bindings even though at most 5 stages can
23715bd8deadSopenharmony_ci            appear in a program object).
23725bd8deadSopenharmony_ci        MAX_COMBINED_UNIFORM_BLOCKS = 36
23735bd8deadSopenharmony_ci            This is 12 blocks/stage * 3 stages, since compute shaders can't
23745bd8deadSopenharmony_ci            be mixed with other stages.
23755bd8deadSopenharmony_ci        MAX_COMBINED_TEXTURE_IMAGE_UNITS = 64
23765bd8deadSopenharmony_ci            This is 16 textures/stage * 4 stages.
23775bd8deadSopenharmony_ci
23785bd8deadSopenharmony_ci    Khronos internal bugs 5870, 8891, and 9424 cover the ARB's thinking on
23795bd8deadSopenharmony_ci    these limits for GL 4.0 and beyond.
23805bd8deadSopenharmony_ci
23815bd8deadSopenharmony_ci    (5) Are arrays supported as shader inputs and outputs?
23825bd8deadSopenharmony_ci
23835bd8deadSopenharmony_ci    RESOLVED: No. In several places in the tessellation and geometry API
23845bd8deadSopenharmony_ci    language based on GL 4.4, it says that "the OpenGL ES Shading Language
23855bd8deadSopenharmony_ci    doesn't support multi-dimensional arrays" and restricts declarations of
23865bd8deadSopenharmony_ci    inputs and outputs which are array members to blocks themselves declared
23875bd8deadSopenharmony_ci    as arrays.
23885bd8deadSopenharmony_ci
23895bd8deadSopenharmony_ci    Strictly speaking this is no longer true. GLSL-ES 3.10 supports
23905bd8deadSopenharmony_ci    multi-dimensional arrays, but arrays of
23915bd8deadSopenharmony_ci    arrays are not allowed as shader inputs or outputs.
23925bd8deadSopenharmony_ci
23935bd8deadSopenharmony_ci    Given this constraint, and since the same constraint is in OpenGL 4.4,
23945bd8deadSopenharmony_ci    I've resolved this by continuing to limit array inputs and outputs
23955bd8deadSopenharmony_ci    in this fashion, and change the language to "...doesn't support
23965bd8deadSopenharmony_ci    multi-dimensional arrays as shader inputs or outputs".
23975bd8deadSopenharmony_ci
23985bd8deadSopenharmony_ci    (6) What component counting rules are used for inputs and outputs?
23995bd8deadSopenharmony_ci
24005bd8deadSopenharmony_ci    RESOLVED: In several places I've inserted language from OpenGL 4.4 to
24015bd8deadSopenharmony_ci    the effect of
24025bd8deadSopenharmony_ci
24035bd8deadSopenharmony_ci       "Component counting rules for different variable types and variable
24045bd8deadSopenharmony_ci        declarations are the same as for MAX_VERTEX_OUTPUT_COMPONENTS (see
24055bd8deadSopenharmony_ci        section 11.1.2.1)."
24065bd8deadSopenharmony_ci
24075bd8deadSopenharmony_ci    I think this is essentially cleaning up an oversight in the earlier ARB
24085bd8deadSopenharmony_ci    extension language but it is a bit orthogonal to the extension
24095bd8deadSopenharmony_ci    functionality and I'm bringing it up in case this is a potential issue.
24105bd8deadSopenharmony_ci
24115bd8deadSopenharmony_ci    (7) What component counting rules are used for the default
24125bd8deadSopenharmony_ci    uniform block?
24135bd8deadSopenharmony_ci
24145bd8deadSopenharmony_ci    RESOLVED: In several places I've inserted language from OpenGL 4.2 to
24155bd8deadSopenharmony_ci    the effect of
24165bd8deadSopenharmony_ci
24175bd8deadSopenharmony_ci       "A uniform matrix in the default uniform block with single-precision
24185bd8deadSopenharmony_ci        components will consume no more than 4 x min(r,c) uniform
24195bd8deadSopenharmony_ci        components."
24205bd8deadSopenharmony_ci
24215bd8deadSopenharmony_ci    This is based on bug 5432 and is language that was later expanded in
24225bd8deadSopenharmony_ci    OpenGL 4.4 and refactored into the generic "Uniform Variables" section,
24235bd8deadSopenharmony_ci    which is something we should consider in the EXT extensions as well to
24245bd8deadSopenharmony_ci    avoid duplication. I believe it is what we want but am noting it for the
24255bd8deadSopenharmony_ci    same reason as the language in issue (7). I'm hoping to be able to
24265bd8deadSopenharmony_ci    include this refactored language into the OpenGL ES 3.1 Specification,
24275bd8deadSopenharmony_ci    so we can refer to it more easily here. Tracking bug 11192 has been
24285bd8deadSopenharmony_ci    opened for this and this language was approved there.
24295bd8deadSopenharmony_ci
24305bd8deadSopenharmony_ci    (8) What should the minimum value of MAX_GEOMETRY_UNIFORM_COMPONENTS_OES
24315bd8deadSopenharmony_ci    be?
24325bd8deadSopenharmony_ci
24335bd8deadSopenharmony_ci    RESOLVED: GL 4.4 has 512, but we use 1024 to match the ES vertex
24345bd8deadSopenharmony_ci    shader limit.
24355bd8deadSopenharmony_ci
24365bd8deadSopenharmony_ci    (9) What should the minimum value of MAX_GEOMETRY_OUTPUT_COMPONENTS_OES
24375bd8deadSopenharmony_ci    be?
24385bd8deadSopenharmony_ci
24395bd8deadSopenharmony_ci    RESOLVED: This was reduced to 64 in revision 3, from an initial value of
24405bd8deadSopenharmony_ci    128 (matching GL 4.4), to match the limits on vertex shader outputs and
24415bd8deadSopenharmony_ci    fragment shader inputs (Bug 12823).
24425bd8deadSopenharmony_ci
24435bd8deadSopenharmony_ci    (10) What naming and token values should we use for
24445bd8deadSopenharmony_ci    GEOMETRY_VERTICES_OUT_OES, GEOMETRY_INPUT_TYPE_OES, and
24455bd8deadSopenharmony_ci    GEOMETRY_OUTPUT_TYPE_OES?
24465bd8deadSopenharmony_ci
24475bd8deadSopenharmony_ci    DISCUSSION: In EXT_geometry_shader4 and ARB_geometry_shader4, the
24485bd8deadSopenharmony_ci    vertice and input and output type are specified by a program parameter
24495bd8deadSopenharmony_ci    state. OpenGL 3.2 requires this to be provided in the shader text and
24505bd8deadSopenharmony_ci    provided a query for these values after linking. Since this was a
24515bd8deadSopenharmony_ci    functionality change the similarly named enumerants were given different
24525bd8deadSopenharmony_ci    values. Thus we have the following token names and enumerants in GL:
24535bd8deadSopenharmony_ci
24545bd8deadSopenharmony_ci    (from EXT_geometry_shader4)
24555bd8deadSopenharmony_ci        GEOMETRY_VERTICES_OUT_EXT        0x8DDA
24565bd8deadSopenharmony_ci        GEOMETRY_INPUT_TYPE_EXT          0x8DDB
24575bd8deadSopenharmony_ci        GEOMETRY_OUTPUT_TYPE_EXT         0x8DDC
24585bd8deadSopenharmony_ci
24595bd8deadSopenharmony_ci    (from ARB_geometry_shader4)
24605bd8deadSopenharmony_ci        GEOMETRY_VERTICES_OUT_ARB        0x8DDA
24615bd8deadSopenharmony_ci        GEOMETRY_INPUT_TYPE_ARB          0x8DDB
24625bd8deadSopenharmony_ci        GEOMETRY_OUTPUT_TYPE_ARB         0x8DDC
24635bd8deadSopenharmony_ci
24645bd8deadSopenharmony_ci    (from OpenGL 3.2)
24655bd8deadSopenharmony_ci        GEOMETRY_VERTICES_OUT            0x8916
24665bd8deadSopenharmony_ci        GEOMETRY_INPUT_TYPE              0x8917
24675bd8deadSopenharmony_ci        GEOMETRY_OUTPUT_TYPE             0x8918
24685bd8deadSopenharmony_ci
24695bd8deadSopenharmony_ci    Now for this extensions we are providing the GL 3.2-type functionality
24705bd8deadSopenharmony_ci    and thus we should use the token *values* from GL core.  However,
24715bd8deadSopenharmony_ci    it is expected that this extension will ship as an EXT, so we would
24725bd8deadSopenharmony_ci    end up with:
24735bd8deadSopenharmony_ci        GEOMETRY_VERTICES_OUT_EXT        0x8916
24745bd8deadSopenharmony_ci        GEOMETRY_INPUT_TYPE_EXT          0x8917
24755bd8deadSopenharmony_ci        GEOMETRY_OUTPUT_TYPE_EXT         0x8918
24765bd8deadSopenharmony_ci    which gives us the same token names as the EXT_geometry_shader4 but
24775bd8deadSopenharmony_ci    the same token values as OpenGL 3.2. This would potentially be
24785bd8deadSopenharmony_ci    quite confusing if headers are mix and matched.
24795bd8deadSopenharmony_ci
24805bd8deadSopenharmony_ci    OPTIONS: If this extension ships as an EXT,
24815bd8deadSopenharmony_ci    a) invent a new suffix. Ideally we'd have a different EXT-like suffix
24825bd8deadSopenharmony_ci    to disambiguate between GL and ES multivendor extensions.  However this
24835bd8deadSopenharmony_ci    has not happened yet.
24845bd8deadSopenharmony_ci    b) we use a _VENDOR suffix for these 3 enumerants to disambiguate them
24855bd8deadSopenharmony_ci    c) change the tokens to GEOMETRY_LINKED_*_EXT, with the expectation that
24865bd8deadSopenharmony_ci    we'd rename them back if this becomes core functionality.
24875bd8deadSopenharmony_ci
24885bd8deadSopenharmony_ci    RESOLVED.  Pick c). We will include the "_LINKED" term in the tokens
24895bd8deadSopenharmony_ci    to indicate that they represent the values generated at link time. At
24905bd8deadSopenharmony_ci    such a time as this becomes core functionality in ES, they should
24915bd8deadSopenharmony_ci    be renamed back to be the same as the GL tokens (possibly with an
24925bd8deadSopenharmony_ci    alias for compatibility with this extension).
24935bd8deadSopenharmony_ci
24945bd8deadSopenharmony_ci    (11) How should we handle the enablement of input/output blocks in
24955bd8deadSopenharmony_ci    non-geometry stages?
24965bd8deadSopenharmony_ci
24975bd8deadSopenharmony_ci    RESOLVED: Early drafts of this extension added a number
24985bd8deadSopenharmony_ci    of capabilities that were not specific to geometry shaders, namely:
24995bd8deadSopenharmony_ci     * allowed the declaration and use of input and output blocks
25005bd8deadSopenharmony_ci     * moved the built-in "per-vertex" in/out variables into the
25015bd8deadSopenharmony_ci       built-in gl_PerVertex block
25025bd8deadSopenharmony_ci     * allowed the redeclaration of the gl_PerVertex block.
25035bd8deadSopenharmony_ci
25045bd8deadSopenharmony_ci    In OpenGL these capabilities are provided by the GLSL 1.50 version.
25055bd8deadSopenharmony_ci    Furthermore, when separable programs are in use, OpenGL *requires*
25065bd8deadSopenharmony_ci    that the gl_PerVertex block be declared in any shader which uses any of
25075bd8deadSopenharmony_ci    its members (including vertex and fragment shaders).
25085bd8deadSopenharmony_ci
25095bd8deadSopenharmony_ci    Since this capability is being added as an extension to OpenGL ES 3.1
25105bd8deadSopenharmony_ci    we don't have a core shading language version to hang this feature
25115bd8deadSopenharmony_ci    off of and thus we need an extension to enable this.
25125bd8deadSopenharmony_ci
25135bd8deadSopenharmony_ci    Using the earlier drafts, we would have needed to use the
25145bd8deadSopenharmony_ci    OES_geometry_shader #extension in vertex or fragment shaders to enable
25155bd8deadSopenharmony_ci    this functionality. Since this was rather unintuitive and this
25165bd8deadSopenharmony_ci    functionality does have utility on it's own, we opted instead to pull
25175bd8deadSopenharmony_ci    this out to a separate extension that is a required dependency
25185bd8deadSopenharmony_ci    (OES_shader_io_blocks).
25195bd8deadSopenharmony_ci
25205bd8deadSopenharmony_ci    The geometry (and tessellation) extensions will automatically imply
25215bd8deadSopenharmony_ci    that the OES_shader_io_blocks functionality is enabled, since it is
25225bd8deadSopenharmony_ci    impossible to use them in a useful manner without accessing
25235bd8deadSopenharmony_ci    gl_PerVertex input/output blocks.
25245bd8deadSopenharmony_ci
25255bd8deadSopenharmony_ci    (12) Due to HW limitations, some vendors may not be able
25265bd8deadSopenharmony_ci    to support writing gl_PointSize from geometry shaders, how should we
25275bd8deadSopenharmony_ci    accomodate this?
25285bd8deadSopenharmony_ci
25295bd8deadSopenharmony_ci    RESOLVED: There are two extensions described in this document. The
25305bd8deadSopenharmony_ci    base extension does not support writing to gl_PointSize from geometry
25315bd8deadSopenharmony_ci    shaders and the gl_PerVertex block does not include gl_PointSize.
25325bd8deadSopenharmony_ci    Additionally there is a layered extension which provides the ability
25335bd8deadSopenharmony_ci    to write to gl_PointSize from geometry shaders.  When this extension
25345bd8deadSopenharmony_ci    is enabled, the gl_PerVertex block does include gl_PointSize and it
25355bd8deadSopenharmony_ci    can be written from geometry shaders as normal.
25365bd8deadSopenharmony_ci
25375bd8deadSopenharmony_ci    If the point-size extension is not supported, all points written
25385bd8deadSopenharmony_ci    from a geometry shader will have size of one. If the point-size
25395bd8deadSopenharmony_ci    extension is supported but not enabled, or if it's enabled but
25405bd8deadSopenharmony_ci    gl_PointSize is not written, it as if a point size of one was written.
25415bd8deadSopenharmony_ci    Otherwise, if you statically assign gl_PointSize in the last stage
25425bd8deadSopenharmony_ci    before the rasterizer, the (potentially clamped) value written will
25435bd8deadSopenharmony_ci    determine the size of the point for rasterization.
25445bd8deadSopenharmony_ci
25455bd8deadSopenharmony_ci    (13) Does this extension change how transform feedback operates
25465bd8deadSopenharmony_ci    compared to unextended OpenGL ES 3.0 or 3.1?
25475bd8deadSopenharmony_ci
25485bd8deadSopenharmony_ci    RESOLVED: Yes. Because dynamic geometry amplification in a geometry
25495bd8deadSopenharmony_ci    shader can make it difficult if not impossible to predict the amount
25505bd8deadSopenharmony_ci    of geometry that may be generated in advance of executing the shader,
25515bd8deadSopenharmony_ci    the draw-time error for transform feedback buffer overflow conditions
25525bd8deadSopenharmony_ci    is removed and replaced with the GL behavior (primitives are not written
25535bd8deadSopenharmony_ci    and the corresponding counter is not updated). Since we no longer
25545bd8deadSopenharmony_ci    require being able to predict how much geometry will be generated, we
25555bd8deadSopenharmony_ci    also lift the restriction that only DrawArray* commands are supported
25565bd8deadSopenharmony_ci    and also support the DrawElements* commands for transform feedback.
25575bd8deadSopenharmony_ci    We also allow Draw*Indirect to be used with transform feedback.
25585bd8deadSopenharmony_ci
25595bd8deadSopenharmony_ci    (14) Should GetShaderPrecisionFormat support the new GEOMETRY_SHADER_OES
25605bd8deadSopenharmony_ci    stage?
25615bd8deadSopenharmony_ci
25625bd8deadSopenharmony_ci    RESOLVED: No. Following the precedence of OpenGL ES 3.1 which did not
25635bd8deadSopenharmony_ci    extend this query to COMPUTE_SHADERS due to the following reason:
25645bd8deadSopenharmony_ci    GetShaderPrecisionFormat is listed in ES 3.0 appendix F.1 Legacy Features
25655bd8deadSopenharmony_ci    whose use is not recommended.  Adding new capabilities to a feature that
25665bd8deadSopenharmony_ci    is effectively deprecated seems silly (Bug 11464).
25675bd8deadSopenharmony_ci
25685bd8deadSopenharmony_ciRevision History
25695bd8deadSopenharmony_ci
25705bd8deadSopenharmony_ci    Rev.    Date   Author    Changes
25715bd8deadSopenharmony_ci    ----  -------- --------- -------------------------------------------------
25725bd8deadSopenharmony_ci     4    05/31/16 Jon Leech Note that primitive ID counters are reset to zero
25735bd8deadSopenharmony_ci                             after each instance drawn (Bug 14024).
25745bd8deadSopenharmony_ci     3    07/23/15 Jon Leech Reduce minimum value of
25755bd8deadSopenharmony_ci                             MAX_GEOMETRY_OUTPUT_COMPONENTS_OES to 64 (Bug
25765bd8deadSopenharmony_ci                             12823).
25775bd8deadSopenharmony_ci     2    10/08/14 Olson     change max_vertices identifier to integer-constant
25785bd8deadSopenharmony_ci                             to match other ES layout-qualifier-ids
25795bd8deadSopenharmony_ci                             (Bug 12878)
25805bd8deadSopenharmony_ci     1    06/18/14 dkoch     Initial OES version based on EXT.
25815bd8deadSopenharmony_ci                             No functional changes.
2582