15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_separate_shader_objects
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_separate_shader_objects
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Contributors to ARB_separate_shader_objects and 
125bd8deadSopenharmony_ci    ARB_explicit_attrib_location desktop OpenGL extensions from which this 
135bd8deadSopenharmony_ci    extension borrows heavily
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciContact
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    Benj Lipchak, Apple (lipchak 'at' apple.com)
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciStatus
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Complete
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    NOTE: there is an unrelated OpenGL extension also named
245bd8deadSopenharmony_ci    "GL_EXT_separate_shader_objects", found in the OpenGL extension registry
255bd8deadSopenharmony_ci    at http://www.opengl.org/registry/ . These two extensions have similar
265bd8deadSopenharmony_ci    purposes, but completely different interfaces.
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciVersion
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Date: November 08, 2013
315bd8deadSopenharmony_ci    Revision: 7
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciNumber
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    OpenGL ES Extension #101
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciDependencies
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    Requires OpenGL ES 2.0.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Written based on the wording of the OpenGL ES 2.0.25 Full Specification
425bd8deadSopenharmony_ci    (November 2, 2010).
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Written based on the wording of The OpenGL ES Shading Language 1.0.17
455bd8deadSopenharmony_ci    Specification (May 12, 2009).
465bd8deadSopenharmony_ci    
475bd8deadSopenharmony_ci    OpenGL ES 3.0 affects the definition of this extension.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    NV_non_square_matrices affects the definition of this extension.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciOverview
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension is a subset of ARB_separate_shader_objects appropriate for
545bd8deadSopenharmony_ci    OpenGL ES, and also tacks on ARB_explicit_attrib_location functionality.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    Conventional GLSL requires multiple shader stages (vertex and fragment) to
575bd8deadSopenharmony_ci    be linked into a single monolithic program object to specify a GLSL shader 
585bd8deadSopenharmony_ci    for each stage.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    While GLSL's monolithic approach has some advantages for optimizing shaders 
615bd8deadSopenharmony_ci    as a unit that span multiple stages, GPU hardware supports a more flexible 
625bd8deadSopenharmony_ci    mix-and-match approach to specifying shaders independently for these 
635bd8deadSopenharmony_ci    different shader stages.  Many developers build their shader content around
645bd8deadSopenharmony_ci    the mix-and-match approach where they can use a single vertex shader with 
655bd8deadSopenharmony_ci    multiple fragment shaders (or vice versa).
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    This extension adopts a "mix-and-match" shader stage model for GLSL 
685bd8deadSopenharmony_ci    allowing multiple different GLSL program objects to be bound at once each 
695bd8deadSopenharmony_ci    to an individual rendering pipeline stage independently of other stage 
705bd8deadSopenharmony_ci    bindings. This allows program objects to contain only the shader stages 
715bd8deadSopenharmony_ci    that best suit the application's needs.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    This extension introduces the program pipeline object that serves as a 
745bd8deadSopenharmony_ci    container for the program bound to any particular rendering stage.  It can 
755bd8deadSopenharmony_ci    be bound, unbound, and rebound to simply save and restore the complete 
765bd8deadSopenharmony_ci    shader stage to program object bindings.  Like framebuffer
775bd8deadSopenharmony_ci    and vertex array objects, program pipeline objects are "container"
785bd8deadSopenharmony_ci    objects that are not shared between contexts.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    To bind a program object to a specific shader stage or set of stages, 
815bd8deadSopenharmony_ci    UseProgramStagesEXT is used.  The VERTEX_SHADER_BIT_EXT and 
825bd8deadSopenharmony_ci    FRAGMENT_SHADER_BIT_EXT tokens refer to the conventional vertex and 
835bd8deadSopenharmony_ci    fragment stages, respectively. ActiveShaderProgramEXT specifies the 
845bd8deadSopenharmony_ci    program that Uniform* commands will update.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    While ActiveShaderProgramEXT provides a selector for setting and querying 
875bd8deadSopenharmony_ci    uniform values of a program object with the conventional Uniform* commands,
885bd8deadSopenharmony_ci    the ProgramUniform* commands provide a selector-free way to modify uniforms
895bd8deadSopenharmony_ci    of a GLSL program object without an explicit bind. This selector-free model
905bd8deadSopenharmony_ci    reduces API overhead and provides a cleaner interface for applications.
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    Separate linking creates the possibility that certain output varyings of a 
935bd8deadSopenharmony_ci    shader may go unread by the subsequent shader input varyings. In this 
945bd8deadSopenharmony_ci    case, the output varyings are simply ignored. It is also possible input 
955bd8deadSopenharmony_ci    varyings from a shader may not be written as output varyings of a preceding
965bd8deadSopenharmony_ci    shader. In this case, the unwritten input varying values are undefined.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    This extension also introduces a layout location qualifier to GLSL to pre-
995bd8deadSopenharmony_ci    assign attribute and varying locations to shader variables.  This allows 
1005bd8deadSopenharmony_ci    applications to globally assign a particular semantic meaning, such as 
1015bd8deadSopenharmony_ci    diffuse color or vertex normal, to a particular attribute and/or varying 
1025bd8deadSopenharmony_ci    location without knowing how that variable will be named in any particular 
1035bd8deadSopenharmony_ci    shader.
1045bd8deadSopenharmony_ci    
1055bd8deadSopenharmony_ciNew Procedures and Functions
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    void UseProgramStagesEXT(uint pipeline, bitfield stages,
1085bd8deadSopenharmony_ci                             uint program);
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    void ActiveShaderProgramEXT(uint pipeline, uint program);
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    uint CreateShaderProgramvEXT(enum type, sizei count,
1135bd8deadSopenharmony_ci                                 const char **strings);
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    void BindProgramPipelineEXT(uint pipeline);
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    void DeleteProgramPipelinesEXT(sizei n, const uint *pipelines);
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    void GenProgramPipelinesEXT(sizei n, uint *pipelines);
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    boolean IsProgramPipelineEXT(uint pipeline);
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    void ProgramParameteriEXT(uint program, enum pname, int value);
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci    void GetProgramPipelineivEXT(uint pipeline, enum pname, int *params);
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    void ProgramUniform1iEXT(uint program, int location,
1285bd8deadSopenharmony_ci                             int x);
1295bd8deadSopenharmony_ci    void ProgramUniform2iEXT(uint program, int location,
1305bd8deadSopenharmony_ci                             int x, int y);
1315bd8deadSopenharmony_ci    void ProgramUniform3iEXT(uint program, int location,
1325bd8deadSopenharmony_ci                             int x, int y, int z);
1335bd8deadSopenharmony_ci    void ProgramUniform4iEXT(uint program, int location,
1345bd8deadSopenharmony_ci                             int x, int y, int z, int w);
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    void ProgramUniform1fEXT(uint program, int location,
1375bd8deadSopenharmony_ci                             float x);
1385bd8deadSopenharmony_ci    void ProgramUniform2fEXT(uint program, int location,
1395bd8deadSopenharmony_ci                             float x, float y);
1405bd8deadSopenharmony_ci    void ProgramUniform3fEXT(uint program, int location,
1415bd8deadSopenharmony_ci                             float x, float y, float z);
1425bd8deadSopenharmony_ci    void ProgramUniform4fEXT(uint program, int location,
1435bd8deadSopenharmony_ci                             float x, float y, float z, float w);
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    void ProgramUniform1uiEXT(uint program, int location,
1465bd8deadSopenharmony_ci                              uint x);
1475bd8deadSopenharmony_ci    void ProgramUniform2uiEXT(uint program, int location,
1485bd8deadSopenharmony_ci                              uint x, uint y);
1495bd8deadSopenharmony_ci    void ProgramUniform3uiEXT(uint program, int location,
1505bd8deadSopenharmony_ci                              uint x, uint y, uint z);
1515bd8deadSopenharmony_ci    void ProgramUniform4uiEXT(uint program, int location,
1525bd8deadSopenharmony_ci                              uint x, uint y, uint z, uint w);
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    void ProgramUniform1ivEXT(uint program, int location,
1555bd8deadSopenharmony_ci                              sizei count, const int *value);
1565bd8deadSopenharmony_ci    void ProgramUniform2ivEXT(uint program, int location,
1575bd8deadSopenharmony_ci                              sizei count, const int *value);
1585bd8deadSopenharmony_ci    void ProgramUniform3ivEXT(uint program, int location,
1595bd8deadSopenharmony_ci                              sizei count, const int *value);
1605bd8deadSopenharmony_ci    void ProgramUniform4ivEXT(uint program, int location,
1615bd8deadSopenharmony_ci                              sizei count, const int *value);
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    void ProgramUniform1fvEXT(uint program, int location,
1645bd8deadSopenharmony_ci                              sizei count, const float *value);
1655bd8deadSopenharmony_ci    void ProgramUniform2fvEXT(uint program, int location,
1665bd8deadSopenharmony_ci                              sizei count, const float *value);
1675bd8deadSopenharmony_ci    void ProgramUniform3fvEXT(uint program, int location,
1685bd8deadSopenharmony_ci                              sizei count, const float *value);
1695bd8deadSopenharmony_ci    void ProgramUniform4fvEXT(uint program, int location,
1705bd8deadSopenharmony_ci                              sizei count, const float *value);
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    void ProgramUniform1uivEXT(uint program, int location,
1735bd8deadSopenharmony_ci                               sizei count, const uint *value);
1745bd8deadSopenharmony_ci    void ProgramUniform2uivEXT(uint program, int location,
1755bd8deadSopenharmony_ci                               sizei count, const uint *value);
1765bd8deadSopenharmony_ci    void ProgramUniform3uivEXT(uint program, int location,
1775bd8deadSopenharmony_ci                               sizei count, const uint *value);
1785bd8deadSopenharmony_ci    void ProgramUniform4uivEXT(uint program, int location,
1795bd8deadSopenharmony_ci                               sizei count, const uint *value);
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    void ProgramUniformMatrix2fvEXT(uint program, int location,
1825bd8deadSopenharmony_ci                                    sizei count, boolean transpose,
1835bd8deadSopenharmony_ci                                    const float *value);
1845bd8deadSopenharmony_ci    void ProgramUniformMatrix3fvEXT(uint program, int location,
1855bd8deadSopenharmony_ci                                    sizei count, boolean transpose,
1865bd8deadSopenharmony_ci                                    const float *value);
1875bd8deadSopenharmony_ci    void ProgramUniformMatrix4fvEXT(uint program, int location,
1885bd8deadSopenharmony_ci                                    sizei count, boolean transpose,
1895bd8deadSopenharmony_ci                                    const float *value);
1905bd8deadSopenharmony_ci    void ProgramUniformMatrix2x3fvEXT(uint program, int location,
1915bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
1925bd8deadSopenharmony_ci                                     const float *value);
1935bd8deadSopenharmony_ci    void ProgramUniformMatrix3x2fvEXT(uint program, int location,
1945bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
1955bd8deadSopenharmony_ci                                     const float *value);
1965bd8deadSopenharmony_ci    void ProgramUniformMatrix2x4fvEXT(uint program, int location,
1975bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
1985bd8deadSopenharmony_ci                                     const float *value);
1995bd8deadSopenharmony_ci    void ProgramUniformMatrix4x2fvEXT(uint program, int location,
2005bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
2015bd8deadSopenharmony_ci                                     const float *value);
2025bd8deadSopenharmony_ci    void ProgramUniformMatrix3x4fvEXT(uint program, int location,
2035bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
2045bd8deadSopenharmony_ci                                     const float *value);
2055bd8deadSopenharmony_ci    void ProgramUniformMatrix4x3fvEXT(uint program, int location,
2065bd8deadSopenharmony_ci                                     sizei count, boolean transpose,
2075bd8deadSopenharmony_ci                                     const float *value);
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci   void ValidateProgramPipelineEXT(uint pipeline);
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci   void GetProgramPipelineInfoLogEXT(uint pipeline, sizei bufSize,
2135bd8deadSopenharmony_ci                                     sizei *length, char *infoLog);
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ciNew Tokens
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    Accepted by <stages> parameter to UseProgramStagesEXT:
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci        VERTEX_SHADER_BIT_EXT                0x00000001
2205bd8deadSopenharmony_ci        FRAGMENT_SHADER_BIT_EXT              0x00000002
2215bd8deadSopenharmony_ci        ALL_SHADER_BITS_EXT                  0xFFFFFFFF
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    Accepted by the <pname> parameter of ProgramParameteriEXT and
2245bd8deadSopenharmony_ci    GetProgramiv:
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci        PROGRAM_SEPARABLE_EXT                0x8258
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    Accepted by <type> parameter to GetProgramPipelineivEXT:
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci        ACTIVE_PROGRAM_EXT                   0x8259
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, and
2335bd8deadSopenharmony_ci    GetFloatv:
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci        PROGRAM_PIPELINE_BINDING_EXT         0x825A
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation):
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci -- Section 2.10 "Vertex Shaders" (page 26)
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    Modify the fourth and fifth paragraphs:
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    "To use a vertex shader, shader source code is first loaded into a shader 
2445bd8deadSopenharmony_ci    object and then compiled. Alternatively, pre-compiled shader binary code 
2455bd8deadSopenharmony_ci    may be directly loaded into a shader object. An OpenGL ES implementation 
2465bd8deadSopenharmony_ci    must support one of these methods for loading shaders. If the boolean value
2475bd8deadSopenharmony_ci    SHADER_COMPILER is TRUE, then the shader compiler is supported. If the 
2485bd8deadSopenharmony_ci    integer value NUM_SHADER_BINARY_FORMATS is greater than zero, then shader 
2495bd8deadSopenharmony_ci    binary loading is supported.
2505bd8deadSopenharmony_ci    
2515bd8deadSopenharmony_ci    A shader object corresponds to a stage in the rendering pipeline referred 
2525bd8deadSopenharmony_ci    to as its shader stage or type. A vertex shader object is attached to a 
2535bd8deadSopenharmony_ci    program object. The program object is then linked, which generates 
2545bd8deadSopenharmony_ci    executable code from the compiled shader object(s) attached to the program. 
2555bd8deadSopenharmony_ci    When program objects are bound to a shader stage, they become the current 
2565bd8deadSopenharmony_ci    program object for that stage. When the current program object for the 
2575bd8deadSopenharmony_ci    vertex stage includes a vertex shader, it is considered the active program 
2585bd8deadSopenharmony_ci    object for the vertex stage. The current program object for all stages may
2595bd8deadSopenharmony_ci    be set at once using a single unified program object, or the current 
2605bd8deadSopenharmony_ci    program object may be set for each stage individually using a separable 
2615bd8deadSopenharmony_ci    program object where different separable program objects may be current for
2625bd8deadSopenharmony_ci    other stages. The set of separable program objects current for all stages
2635bd8deadSopenharmony_ci    are collected in a program pipeline object that must be bound for use.
2645bd8deadSopenharmony_ci    When a linked program object is made active for the vertex stage, the 
2655bd8deadSopenharmony_ci    executable code for the vertex shaders it contains is used to process 
2665bd8deadSopenharmony_ci    vertices."
2675bd8deadSopenharmony_ci    
2685bd8deadSopenharmony_ci    Modify the last sentence in the sixth paragraph:
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    "... A single program object can contain either a vertex shader, a fragment
2715bd8deadSopenharmony_ci    shader, or both."
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ci    Modify the seventh paragraph:
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    "When the program object currently in use for the vertex stage
2765bd8deadSopenharmony_ci    includes a vertex shader, its vertex shader is considered active and
2775bd8deadSopenharmony_ci    is used to process vertices. If the current vertex stage program
2785bd8deadSopenharmony_ci    object has no vertex shader or no program object is current for the
2795bd8deadSopenharmony_ci    vertex stage, the results of vertex shader execution are undefined."
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci -- Section 2.10.3 "Program Objects" (page 30) 
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    Modify the description of linking failures following the description of
2845bd8deadSopenharmony_ci    LinkProgram to read:
2855bd8deadSopenharmony_ci    
2865bd8deadSopenharmony_ci    "... if <program> is not separable and does not contain both a vertex and a
2875bd8deadSopenharmony_ci    fragment shader, ..."
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci    Modify second paragraph, p. 31:
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci    "If a program has been successfully linked by LinkProgram, it can be made
2925bd8deadSopenharmony_ci    part of the current rendering state for all shader stages with the command
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci        void UseProgram(uint program);
2955bd8deadSopenharmony_ci
2965bd8deadSopenharmony_ci    If <program> is non-zero, this command will make <program> the current
2975bd8deadSopenharmony_ci    program object. This will install executable code as part of the current
2985bd8deadSopenharmony_ci    rendering state for each shader stage present when the program was last
2995bd8deadSopenharmony_ci    successfully linked. If UseProgram is called with <program> set to zero,
3005bd8deadSopenharmony_ci    then there is no current program object. If <program> has not been
3015bd8deadSopenharmony_ci    successfully linked, the error INVALID_OPERATION is generated and the
3025bd8deadSopenharmony_ci    current rendering state is not modified."
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    Insert paragraph immediately after preceding paragraph:
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    "The executable code for an individual shader stage is taken from the
3075bd8deadSopenharmony_ci    current program for that stage. If there is a current program object
3085bd8deadSopenharmony_ci    established by UseProgram, that program is considered current for all
3095bd8deadSopenharmony_ci    stages. Otherwise, if there is a bound program pipeline object (section
3105bd8deadSopenharmony_ci    2.10.PPO), the program bound to the appropriate stage of the pipeline
3115bd8deadSopenharmony_ci    object is considered current. If there is no current program object or
3125bd8deadSopenharmony_ci    bound program pipeline object, no program is current for any stage. The
3135bd8deadSopenharmony_ci    current program for a stage is considered active if it contains executable
3145bd8deadSopenharmony_ci    code for that stage; otherwise, no program is considered active for that
3155bd8deadSopenharmony_ci    stage. If there is no active program for the vertex or fragment shader
3165bd8deadSopenharmony_ci    stages, the results of vertex and/or fragment processing will be undefined. 
3175bd8deadSopenharmony_ci    However, this is not an error."
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    Modify fourth and fifth paragraphs, p. 31:
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    "If a program object that is active for any shader stage is re-linked
3225bd8deadSopenharmony_ci    successfully, the LinkProgram command will install the generated
3235bd8deadSopenharmony_ci    executable code as part of the current rendering state for all shader
3245bd8deadSopenharmony_ci    stages where the program is active. Additionally, the newly generated
3255bd8deadSopenharmony_ci    executable code is made part of the state of any program pipeline for all
3265bd8deadSopenharmony_ci    stages where the program is attached.
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci    If a program object that is active for any shader stage is re-linked
3295bd8deadSopenharmony_ci    unsuccessfully, the link status will be set to FALSE, but existing
3305bd8deadSopenharmony_ci    executables and associated state will remain part of the current rendering
3315bd8deadSopenharmony_ci    state until a subsequent call to UseProgram, UseProgramStagesEXT, or
3325bd8deadSopenharmony_ci    BindProgramPipelineEXT removes them from use. If such a program is 
3335bd8deadSopenharmony_ci    attached to any program pipeline object, the existing executables and 
3345bd8deadSopenharmony_ci    associated state will remain part of the program pipeline object until a 
3355bd8deadSopenharmony_ci    subsequent call to UseProgramStagesEXT removes them from use. An 
3365bd8deadSopenharmony_ci    unsuccessfully linked program may not be made part of the current rendering 
3375bd8deadSopenharmony_ci    state by UseProgram or added to program pipeline objects by 
3385bd8deadSopenharmony_ci    UseProgramStagesEXT until it is successfully re-linked. If such a program 
3395bd8deadSopenharmony_ci    was attached to a program pipeline at the time of a failed link, its 
3405bd8deadSopenharmony_ci    existing executable may still be made part of the current rendering state 
3415bd8deadSopenharmony_ci    indirectly by BindProgramPipelineEXT."
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    Insert prior to the description of DeleteProgram, p. 31:
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    "Program parameters control aspects of how the program is linked,
3465bd8deadSopenharmony_ci    executed, or stored. To set a program parameter, call
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci        void ProgramParameteriEXT(uint program, enum pname, int value);
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci    <pname> identifies which parameter to set for program object
3515bd8deadSopenharmony_ci    <program>. <value> holds the value being set.
3525bd8deadSopenharmony_ci    
3535bd8deadSopenharmony_ci    If <pname> is PROGRAM_SEPARABLE_EXT, <value> must be TRUE or FALSE
3545bd8deadSopenharmony_ci    and indicates whether the <program> can be bound for individual
3555bd8deadSopenharmony_ci    pipeline stages via UseProgramStagesEXT after it is next linked."
3565bd8deadSopenharmony_ci        
3575bd8deadSopenharmony_ci    Modify the last paragraph of the section, p. 31:
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    "If <program> is not current for any GL context, is not the active
3605bd8deadSopenharmony_ci    program for any program pipeline object, and is not the current
3615bd8deadSopenharmony_ci    program for any stage of any program pipeline object, it is deleted
3625bd8deadSopenharmony_ci    immediately. Otherwise, <program> is flagged ..."
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci    Insert at the end of the section, p. 31:
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci    "The command
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci        uint CreateShaderProgramvEXT(enum type, sizei count,
3695bd8deadSopenharmony_ci                                     const char **strings);
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    creates a stand-alone program from an array of null-terminated source 
3725bd8deadSopenharmony_ci    code strings for a single shader type.  CreateShaderProgramvEXT
3735bd8deadSopenharmony_ci    is equivalent to the following command sequence:
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci        const uint shader = CreateShader(type);
3765bd8deadSopenharmony_ci        if (shader) {
3775bd8deadSopenharmony_ci            ShaderSource(shader, count, strings, NULL);
3785bd8deadSopenharmony_ci            CompileShader(shader);
3795bd8deadSopenharmony_ci            const uint program = CreateProgram();
3805bd8deadSopenharmony_ci            if (program) {
3815bd8deadSopenharmony_ci                int compiled = FALSE;
3825bd8deadSopenharmony_ci                GetShaderiv(shader, COMPILE_STATUS, &compiled);
3835bd8deadSopenharmony_ci                ProgramParameteriEXT(program, PROGRAM_SEPARABLE_EXT, TRUE);
3845bd8deadSopenharmony_ci                if (compiled) {
3855bd8deadSopenharmony_ci                    AttachShader(program, shader);
3865bd8deadSopenharmony_ci                    LinkProgram(program);
3875bd8deadSopenharmony_ci                    DetachShader(program, shader);
3885bd8deadSopenharmony_ci                }
3895bd8deadSopenharmony_ci                append-shader-info-log-to-program-info-log
3905bd8deadSopenharmony_ci            }
3915bd8deadSopenharmony_ci            DeleteShader(shader);
3925bd8deadSopenharmony_ci            return program;
3935bd8deadSopenharmony_ci        } else {
3945bd8deadSopenharmony_ci            return 0;
3955bd8deadSopenharmony_ci        }
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    The program may not actually link if the output variables in the
3985bd8deadSopenharmony_ci    shader attached to the final stage of the linked program take up
3995bd8deadSopenharmony_ci    too many locations. If this situation arises, the info log may
4005bd8deadSopenharmony_ci    explain this.
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    Because no shader is returned by CreateShaderProgramvEXT and the
4035bd8deadSopenharmony_ci    shader that is created is deleted in the course of the command
4045bd8deadSopenharmony_ci    sequence, the info log of the shader object is copied to the program
4055bd8deadSopenharmony_ci    so the shader's failed info log for the failed compilation is
4065bd8deadSopenharmony_ci    accessible to the application."
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci -- Add new section 2.10.PPO "Program Pipeline Objects" after 2.10.3
4095bd8deadSopenharmony_ci    "Program Objects"
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    "Instead of packaging all shader stages into a single program object,
4125bd8deadSopenharmony_ci    shader types might be contained in multiple program objects each
4135bd8deadSopenharmony_ci    consisting of part of the complete pipeline. A program object may
4145bd8deadSopenharmony_ci    even contain only a single shader stage. This facilitates greater
4155bd8deadSopenharmony_ci    flexibility when combining different shaders in various ways without
4165bd8deadSopenharmony_ci    requiring a program object for each combination.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    Program bindings associating program objects with shader types are
4195bd8deadSopenharmony_ci    collected to form a program pipeline object.
4205bd8deadSopenharmony_ci
4215bd8deadSopenharmony_ci    The command
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ci        void GenProgramPipelinesEXT(sizei n, uint *pipelines);
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    returns <n> previously unused program pipeline object names in
4265bd8deadSopenharmony_ci    <pipelines>. These names are marked as used, for the purposes of
4275bd8deadSopenharmony_ci    GenProgramPipelinesEXT only, but they acquire state only when they are
4285bd8deadSopenharmony_ci    first bound.
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci    Program pipeline objects are deleted by calling
4315bd8deadSopenharmony_ci
4325bd8deadSopenharmony_ci        void DeleteProgramPipelinesEXT(sizei n, const uint *pipelines);
4335bd8deadSopenharmony_ci    
4345bd8deadSopenharmony_ci    <pipelines> contains <n> names of program pipeline objects to be
4355bd8deadSopenharmony_ci    deleted. Once a program pipeline object is deleted, it has no
4365bd8deadSopenharmony_ci    contents and its name becomes unused. If an object that is currently
4375bd8deadSopenharmony_ci    bound is deleted, the binding for that object reverts to zero and no
4385bd8deadSopenharmony_ci    program pipeline object becomes current. Unused names in <pipelines>
4395bd8deadSopenharmony_ci    are silently ignored, as is the value zero.
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    A program pipeline object is created by binding a name returned by
4425bd8deadSopenharmony_ci    GenProgramPipelinesEXT with the command
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci        void BindProgramPipelineEXT(uint pipeline);
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci    <pipeline> is the program pipeline object name. The resulting program
4475bd8deadSopenharmony_ci    pipeline object is a new state vector, comprising all the state and with
4485bd8deadSopenharmony_ci    the same initial values listed in table 6.PPO.
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci    BindProgramPipelineEXT may also be used to bind an existing program
4515bd8deadSopenharmony_ci    pipeline object. If the bind is successful, no change is made to
4525bd8deadSopenharmony_ci    the state of the bound program pipeline object, and any previous
4535bd8deadSopenharmony_ci    binding is broken. If BindProgramPipelineEXT is called with <pipeline>
4545bd8deadSopenharmony_ci    set to zero, then there is no current program pipeline object.
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci    If no current program object has been established by UseProgram, the
4575bd8deadSopenharmony_ci    program objects used for each shader stage and for uniform updates are
4585bd8deadSopenharmony_ci    taken from the bound program pipeline object, if any. If there is a
4595bd8deadSopenharmony_ci    current program object established by UseProgram, the bound program
4605bd8deadSopenharmony_ci    pipeline object has no effect on rendering or uniform updates. When a
4615bd8deadSopenharmony_ci    bound program pipeline object is used for rendering, individual shader
4625bd8deadSopenharmony_ci    executables are taken from its program objects as described in the
4635bd8deadSopenharmony_ci    discussion of UseProgram in section 2.10.3.
4645bd8deadSopenharmony_ci
4655bd8deadSopenharmony_ci    BindProgramPipelineEXT fails and an INVALID_OPERATION error is
4665bd8deadSopenharmony_ci    generated if <pipeline> is not zero or a name returned from a
4675bd8deadSopenharmony_ci    previous call to GenProgramPipelinesEXT, or if such a name has since
4685bd8deadSopenharmony_ci    been deleted with DeleteProgramPipelinesEXT.
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ci    The executables in a program object associated with one or more
4715bd8deadSopenharmony_ci    shader stages can be made part of the program pipeline state for
4725bd8deadSopenharmony_ci    those shader stages with the command:
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci       void UseProgramStagesEXT(uint pipeline, bitfield stages,
4755bd8deadSopenharmony_ci                                uint program);
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    where <pipeline> is the program pipeline object to be updated,
4785bd8deadSopenharmony_ci    <stages> is the bitwise OR of accepted constants representing
4795bd8deadSopenharmony_ci    shader stages, and <program> is the program object from which the
4805bd8deadSopenharmony_ci    executables are taken. The bits set in <stages> indicate the program
4815bd8deadSopenharmony_ci    stages for which the program object named by <program> becomes
4825bd8deadSopenharmony_ci    current. These stages may include vertex or fragment indicated by 
4835bd8deadSopenharmony_ci    VERTEX_SHADER_BIT_EXT or FRAGMENT_SHADER_BIT_EXT respectively. The 
4845bd8deadSopenharmony_ci    constant ALL_SHADER_BITS_EXT indicates <program> is to be made current 
4855bd8deadSopenharmony_ci    for all shader stages. If <program> refers to a program object with a valid
4865bd8deadSopenharmony_ci    shader attached for an indicated shader stage, this call installs
4875bd8deadSopenharmony_ci    the executable code for that stage in the indicated program pipeline
4885bd8deadSopenharmony_ci    object state. If UseProgramStagesEXT is called with <program> set to
4895bd8deadSopenharmony_ci    zero or with a program object that contains no executable code for the
4905bd8deadSopenharmony_ci    given stages, it is as if the pipeline object has no programmable stage
4915bd8deadSopenharmony_ci    configured for the indicated shader stages.  If <stages> is not the
4925bd8deadSopenharmony_ci    special value ALL_SHADER_BITS_EXT and has a bit set that is not 
4935bd8deadSopenharmony_ci    recognized, the error INVALID_VALUE is generated. If the program object 
4945bd8deadSopenharmony_ci    named by <program> was linked without the PROGRAM_SEPARABLE_EXT parameter
4955bd8deadSopenharmony_ci    set or was not linked successfully, the error INVALID_OPERATION is 
4965bd8deadSopenharmony_ci    generated and the corresponding shader stages in the <pipeline> 
4975bd8deadSopenharmony_ci    program pipeline object are not modified.
4985bd8deadSopenharmony_ci
4995bd8deadSopenharmony_ci    If <pipeline> is a name that has been generated (without subsequent
5005bd8deadSopenharmony_ci    deletion) by GenProgramPipelinesEXT, but refers to a program pipeline
5015bd8deadSopenharmony_ci    object that has not been previously bound, the GL first creates a
5025bd8deadSopenharmony_ci    new state vector in the same manner as when BindProgramPipelineEXT
5035bd8deadSopenharmony_ci    creates a new program pipeline object. If <pipeline> is not a name
5045bd8deadSopenharmony_ci    returned from a previous call to GenProgramPipelinesEXT or if such a
5055bd8deadSopenharmony_ci    name has since been deleted by DeleteProgramPipelinesEXT, an 
5065bd8deadSopenharmony_ci    INVALID_OPERATION error is generated.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci    The command
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci        void ActiveShaderProgramEXT(uint pipeline, uint program);
5115bd8deadSopenharmony_ci
5125bd8deadSopenharmony_ci    sets the linked program named by <program> to be the active program
5135bd8deadSopenharmony_ci    (discussed later in the secion 2.10.4) for the program pipeline
5145bd8deadSopenharmony_ci    object <pipeline>.  If <program> has not been successfully linked,
5155bd8deadSopenharmony_ci    the error INVALID_OPERATION is generated and active program is not
5165bd8deadSopenharmony_ci    modified.
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci    If <pipeline> is a name that has been generated (without subsequent
5195bd8deadSopenharmony_ci    deletion) by GenProgramPipelinesEXT, but refers to a program pipeline
5205bd8deadSopenharmony_ci    object that has not been previously bound, the GL first creates a
5215bd8deadSopenharmony_ci    new state vector in the same manner as when BindProgramPipelineEXT
5225bd8deadSopenharmony_ci    creates a new program pipeline object. If <pipeline> is not a name
5235bd8deadSopenharmony_ci    returned from a previous call to GenProgramPipelinesEXT or if such a
5245bd8deadSopenharmony_ci    name has since been deleted by DeleteProgramPipelinesEXT, an 
5255bd8deadSopenharmony_ci    INVALID_OPERATION error is generated.
5265bd8deadSopenharmony_ci
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci    Shader Interface Matching
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    When linking a non-separable program object with multiple shader types,
5315bd8deadSopenharmony_ci    the outputs of one stage form an interface with the inputs of the next
5325bd8deadSopenharmony_ci    stage. These inputs and outputs must typically match in name, type,
5335bd8deadSopenharmony_ci    and qualification.  When both sides of an interface are contained in
5345bd8deadSopenharmony_ci    the same program object, LinkProgram will detect mismatches on an
5355bd8deadSopenharmony_ci    interface and generate link errors.
5365bd8deadSopenharmony_ci
5375bd8deadSopenharmony_ci    With separable program objects, interfaces between shader stages may
5385bd8deadSopenharmony_ci    involve the outputs from one program object and the inputs from a
5395bd8deadSopenharmony_ci    second program object. For such interfaces, it is not possible to
5405bd8deadSopenharmony_ci    detect mismatches at link time, because the programs are linked
5415bd8deadSopenharmony_ci    separately. When each such program is linked, all inputs or outputs
5425bd8deadSopenharmony_ci    interfacing with another program stage are treated as active. The
5435bd8deadSopenharmony_ci    linker will generate an executable that assumes the presence of a
5445bd8deadSopenharmony_ci    compatible program on the other side of the interface. If a mismatch
5455bd8deadSopenharmony_ci    between programs occurs, no GL error will be generated, but some or all
5465bd8deadSopenharmony_ci    of the inputs on the interface will be undefined.
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ci    At an interface between program objects, the inputs and outputs are
5495bd8deadSopenharmony_ci    considered to match exactly if and only if:
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci      * For every user-declared input variable declared, there is an output
5525bd8deadSopenharmony_ci        variable declared in the previous shader matching exactly in name,
5535bd8deadSopenharmony_ci        type, and qualification.
5545bd8deadSopenharmony_ci
5555bd8deadSopenharmony_ci      * There are no user-defined output variables declared without a matching
5565bd8deadSopenharmony_ci        input variable declaration.
5575bd8deadSopenharmony_ci
5585bd8deadSopenharmony_ci    When the set of inputs and outputs on an interface between programs
5595bd8deadSopenharmony_ci    matches exactly, all inputs are well-defined unless the corresponding
5605bd8deadSopenharmony_ci    outputs were not written in the previous shader. However, any mismatch
5615bd8deadSopenharmony_ci    between inputs and outputs results in all inputs being undefined except
5625bd8deadSopenharmony_ci    for cases noted below. Even if an input has a corresponding output
5635bd8deadSopenharmony_ci    that matches exactly, mismatches on other inputs or outputs may
5645bd8deadSopenharmony_ci    adversely affect the executable code generated to read or write the
5655bd8deadSopenharmony_ci    matching variable.
5665bd8deadSopenharmony_ci
5675bd8deadSopenharmony_ci    The inputs and outputs on an interface between programs need not match
5685bd8deadSopenharmony_ci    exactly when input and output location qualifiers (sections 4.3.6.1 and
5695bd8deadSopenharmony_ci    4.3.6.2 of the GLSL Specification) are used.  When using location
5705bd8deadSopenharmony_ci    qualifiers, any input with an input location qualifier will be
5715bd8deadSopenharmony_ci    well-defined as long as the other program writes to an output with the
5725bd8deadSopenharmony_ci    same location qualifier, data type, and qualification.  Also, an input
5735bd8deadSopenharmony_ci    will be well-defined if the other program writes to an output matching
5745bd8deadSopenharmony_ci    the input in everything but data type as long as the output data type  
5755bd8deadSopenharmony_ci    has the same basic component type and more components.  The names of 
5765bd8deadSopenharmony_ci    variables need not match when matching by location.  For the purposes 
5775bd8deadSopenharmony_ci    of interface matching, an input with a location qualifier is considered 
5785bd8deadSopenharmony_ci    to match a corresponding output only if that output has an identical 
5795bd8deadSopenharmony_ci    location qualifier.
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci    Built-in inputs or outputs do not affect interface matching.  Any such 
5825bd8deadSopenharmony_ci    built-in inputs are well-defined unless they are derived from built-in 
5835bd8deadSopenharmony_ci    outputs not written by the previous shader stage.
5845bd8deadSopenharmony_ci
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci    Program Pipeline Object State
5875bd8deadSopenharmony_ci
5885bd8deadSopenharmony_ci    The state required to support program pipeline objects consists of
5895bd8deadSopenharmony_ci    a single binding name of the current program pipeline object. This
5905bd8deadSopenharmony_ci    binding is initially zero indicating no program pipeline object is
5915bd8deadSopenharmony_ci    bound.
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    The state of each program pipeline object consists of:
5945bd8deadSopenharmony_ci
5955bd8deadSopenharmony_ci    * Three unsigned integers (initially all zero) are  required to hold
5965bd8deadSopenharmony_ci      each respective name of the current vertex stage program, current 
5975bd8deadSopenharmony_ci      fragment stage program, and active program respectively.
5985bd8deadSopenharmony_ci    * A Boolean holding the status of the last validation attempt,
5995bd8deadSopenharmony_ci      initially false.
6005bd8deadSopenharmony_ci    * An array of type char containing the information log, initially
6015bd8deadSopenharmony_ci      empty.
6025bd8deadSopenharmony_ci    * An integer holding the length of the information log."
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci -- Section 2.10.4 "Shader Variables" subsection "Vertex Attributes"
6055bd8deadSopenharmony_ci 
6065bd8deadSopenharmony_ci    Change the first sentence of the second full paragraph (p. 34):
6075bd8deadSopenharmony_ci    
6085bd8deadSopenharmony_ci    "When a program is linked, any active attributes without a binding
6095bd8deadSopenharmony_ci    specified either through BindAttribLocation or explicitly set
6105bd8deadSopenharmony_ci    within the shader text will be automatically bound to vertex
6115bd8deadSopenharmony_ci    attributes by the GL."
6125bd8deadSopenharmony_ci    
6135bd8deadSopenharmony_ci    Add the following sentence to the end of that same paragraph:
6145bd8deadSopenharmony_ci    
6155bd8deadSopenharmony_ci    "If an active attribute has a binding explicitly set within the shader text
6165bd8deadSopenharmony_ci    and a different binding assigned by BindAttribLocation, the assignment in 
6175bd8deadSopenharmony_ci    the shader text is used."
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci -- Section 2.10.4 "Shader Variables" subsection "Uniform Variables"
6205bd8deadSopenharmony_ci
6215bd8deadSopenharmony_ci    Replace the paragraph introducing Uniform* (p. 37):
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci    "To load values into the uniform variables of the active program object, 
6245bd8deadSopenharmony_ci    use the commands
6255bd8deadSopenharmony_ci
6265bd8deadSopenharmony_ci        ... 
6275bd8deadSopenharmony_ci    
6285bd8deadSopenharmony_ci    If a non-zero program object is bound by UseProgram, it is the
6295bd8deadSopenharmony_ci    active program object whose uniforms are updated by these commands.
6305bd8deadSopenharmony_ci    If no program object is bound using UseProgram, the active program
6315bd8deadSopenharmony_ci    object of the current program pipeline object set by 
6325bd8deadSopenharmony_ci    ActiveShaderProgramEXT is the active program object. If the current 
6335bd8deadSopenharmony_ci    program pipeline object has no active program or there is no current 
6345bd8deadSopenharmony_ci    program pipeline object, then there is no active program.
6355bd8deadSopenharmony_ci        
6365bd8deadSopenharmony_ci    The given values are loaded into the ... "
6375bd8deadSopenharmony_ci
6385bd8deadSopenharmony_ci    Change the last bullet in the "Uniform Variables" subsection (p. 38) to:
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci    "* if there is no active program in use."
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    Add to the end of the "Uniform Variables" subsection (p. 38): 
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci    To load values into the uniform variables of a program which may not 
6455bd8deadSopenharmony_ci    necessarily be bound, use the commands
6465bd8deadSopenharmony_ci
6475bd8deadSopenharmony_ci        void ProgramUniform{1234}{if}EXT(uint program, int location,
6485bd8deadSopenharmony_ci                                         T value);
6495bd8deadSopenharmony_ci        void ProgramUniform{1234}uiEXT(uint program, int location,
6505bd8deadSopenharmony_ci                                       T value);
6515bd8deadSopenharmony_ci        void ProgramUniform{1234}{if}vEXT(uint program, int location,
6525bd8deadSopenharmony_ci                                          sizei count, const T *value);
6535bd8deadSopenharmony_ci        void ProgramUniform{1234}uivEXT(uint program, int location,
6545bd8deadSopenharmony_ci                                          sizei count, const uint *value);
6555bd8deadSopenharmony_ci        void ProgramUniformMatrix{234}fvEXT(uint program, int location,
6565bd8deadSopenharmony_ci                                            sizei count, boolean transpose,
6575bd8deadSopenharmony_ci                                            const float *value);
6585bd8deadSopenharmony_ci        void ProgramUniformMatrix{2x3,3x2,2x4,
6595bd8deadSopenharmony_ci                                  4x2,3x4,4x3}fvEXT(uint program, 
6605bd8deadSopenharmony_ci                                                    int location,
6615bd8deadSopenharmony_ci                                                    sizei count, 
6625bd8deadSopenharmony_ci                                                    boolean transpose,
6635bd8deadSopenharmony_ci                                                    const float *value);
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci    These commands operate identically to the corresponding commands
6665bd8deadSopenharmony_ci    above without "Program" in the command name except, rather than
6675bd8deadSopenharmony_ci    updating the currently active program object, these "Program"
6685bd8deadSopenharmony_ci    commands update the program object named by the initial <program>
6695bd8deadSopenharmony_ci    parameter. The remaining parameters following the initial <program>
6705bd8deadSopenharmony_ci    parameter match the parameters for the corresponding non-"Program"
6715bd8deadSopenharmony_ci    uniform command. If <program> is not the name of a created program
6725bd8deadSopenharmony_ci    or shader object, the error INVALID_VALUE is generated. If <program>
6735bd8deadSopenharmony_ci    identifies a shader object or a program object that has not been
6745bd8deadSopenharmony_ci    linked successfully, the error INVALID_OPERATION is generated.
6755bd8deadSopenharmony_ci
6765bd8deadSopenharmony_ci -- Section 2.10.5 "Shader Execution" (p. 40) 
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci    Change the first paragraph:
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci    "If there is an active program object present for the vertex stage, the 
6815bd8deadSopenharmony_ci    executable code for this active program is used to process incoming vertex
6825bd8deadSopenharmony_ci    values."
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci    Change first paragraph of subsection "Validation", p. 41:
6855bd8deadSopenharmony_ci
6865bd8deadSopenharmony_ci    "It is not always possible to determine at link time if a program object 
6875bd8deadSopenharmony_ci    can execute successfully, given that LinkProgram can not know the state of 
6885bd8deadSopenharmony_ci    the remainder of the pipeline.  Therefore validation is done when the first
6895bd8deadSopenharmony_ci    rendering command (DrawArrays or DrawElements) is issued, to determine if 
6905bd8deadSopenharmony_ci    the set of active program objects can be executed. If the current set of 
6915bd8deadSopenharmony_ci    active program objects cannot be executed, no primitives
6925bd8deadSopenharmony_ci    are processed and the error INVALID_OPERATION will be generated."
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ci    Add to the list in the second paragraph of subsection "Validation" (p. 41):
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci    "* A program object is active for at least one, but not all of the
6975bd8deadSopenharmony_ci      shader stages that were present when the program was linked.
6985bd8deadSopenharmony_ci
6995bd8deadSopenharmony_ci    * There is no current unified program object and the current program
7005bd8deadSopenharmony_ci      pipeline object includes a program object that was relinked since
7015bd8deadSopenharmony_ci      being applied to the pipeline object via UseProgramStagesEXT with the
7025bd8deadSopenharmony_ci      PROGRAM_SEPARABLE_EXT parameter set to FALSE."
7035bd8deadSopenharmony_ci
7045bd8deadSopenharmony_ci    Add after the description of ValidateProgram in subsection
7055bd8deadSopenharmony_ci    "Validation":
7065bd8deadSopenharmony_ci
7075bd8deadSopenharmony_ci    "Separable program objects may have validation failures that cannot
7085bd8deadSopenharmony_ci    be detected without the complete program pipeline. Mismatched
7095bd8deadSopenharmony_ci    interfaces, improper usage of program objects together, and the same
7105bd8deadSopenharmony_ci    state-dependent failures can result in validation errors for such
7115bd8deadSopenharmony_ci    program objects. As a development aid, use the command
7125bd8deadSopenharmony_ci
7135bd8deadSopenharmony_ci        void ValidateProgramPipelineEXT(uint pipeline);
7145bd8deadSopenharmony_ci    
7155bd8deadSopenharmony_ci    to validate the program pipeline object <pipeline> against the
7165bd8deadSopenharmony_ci    current GL state. Each program pipeline object has a boolean status,
7175bd8deadSopenharmony_ci    VALIDATE_STATUS, that is modified as a result of validation. This
7185bd8deadSopenharmony_ci    status can be queried with GetProgramPipelineivEXT (See section 6.1.8).
7195bd8deadSopenharmony_ci    If validation succeeded, the program pipeline object is guaranteed
7205bd8deadSopenharmony_ci    to execute given the current GL state. 
7215bd8deadSopenharmony_ci
7225bd8deadSopenharmony_ci    If <pipeline> is a name that has been generated (without subsequent
7235bd8deadSopenharmony_ci    deletion) by GenProgramPipelinesEXT, but refers to a program pipeline
7245bd8deadSopenharmony_ci    object that has not been previously bound, the GL first creates a
7255bd8deadSopenharmony_ci    new state vector in the same manner as when BindProgramPipelineEXT
7265bd8deadSopenharmony_ci    creates a new program pipeline object. If <pipeline> is not a name
7275bd8deadSopenharmony_ci    returned from a previous call to GenProgramPipelinesEXT or if such a
7285bd8deadSopenharmony_ci    name has since been deleted by DeleteProgramPipelinesEXT, an 
7295bd8deadSopenharmony_ci    INVALID_OPERATION error is generated.
7305bd8deadSopenharmony_ci
7315bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
7325bd8deadSopenharmony_ci
7335bd8deadSopenharmony_ci -- Section 3.8 "Fragment Shaders" (p. 86) 
7345bd8deadSopenharmony_ci
7355bd8deadSopenharmony_ci    Replace the last paragraph with:
7365bd8deadSopenharmony_ci
7375bd8deadSopenharmony_ci    "When the program object currently in use for the fragment stage
7385bd8deadSopenharmony_ci    includes a fragment shader, its fragment shader is considered active and
7395bd8deadSopenharmony_ci    is used to process fragments. If the current fragment stage program
7405bd8deadSopenharmony_ci    object has no fragment shader or no program object is current for the
7415bd8deadSopenharmony_ci    fragment stage, the results of fragment shader execution are undefined."
7425bd8deadSopenharmony_ci    
7435bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment 
7445bd8deadSopenharmony_ciOperations and the Frame Buffer)
7455bd8deadSopenharmony_ci
7465bd8deadSopenharmony_ci    None
7475bd8deadSopenharmony_ci
7485bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions)
7495bd8deadSopenharmony_ci
7505bd8deadSopenharmony_ci    None
7515bd8deadSopenharmony_ci
7525bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State 
7535bd8deadSopenharmony_ciRequests)
7545bd8deadSopenharmony_ci
7555bd8deadSopenharmony_ci -- Section 6.1.8 "Shader and Program Queries"
7565bd8deadSopenharmony_ci    
7575bd8deadSopenharmony_ci    Add to GetProgramiv description:
7585bd8deadSopenharmony_ci
7595bd8deadSopenharmony_ci    "If <pname> is PROGRAM_SEPARABLE_EXT, TRUE is returned if the program has
7605bd8deadSopenharmony_ci    been flagged for use as a separable program object that can be bound
7615bd8deadSopenharmony_ci    to individual shader stages with UseProgramStagesEXT."
7625bd8deadSopenharmony_ci
7635bd8deadSopenharmony_ci    Add after GetProgramiv description:
7645bd8deadSopenharmony_ci
7655bd8deadSopenharmony_ci    "The command 
7665bd8deadSopenharmony_ci
7675bd8deadSopenharmony_ci        boolean IsProgramPipelineEXT(uint pipeline);
7685bd8deadSopenharmony_ci
7695bd8deadSopenharmony_ci    returns TRUE if <pipeline> is the name of a program pipeline object.
7705bd8deadSopenharmony_ci    If <pipeline> is zero, or a non-zero value that is not the name of a
7715bd8deadSopenharmony_ci    program pipeline object, IsProgramPipelineEXT returns FALSE. No error
7725bd8deadSopenharmony_ci    is generated if <pipeline> is not a valid program pipeline object
7735bd8deadSopenharmony_ci    name.
7745bd8deadSopenharmony_ci
7755bd8deadSopenharmony_ci    The command
7765bd8deadSopenharmony_ci
7775bd8deadSopenharmony_ci        GetProgramPipelineivEXT(uint pipeline, enum pname, int *params);
7785bd8deadSopenharmony_ci
7795bd8deadSopenharmony_ci    returns properties of the program pipeline object named <pipeline>
7805bd8deadSopenharmony_ci    in <params>. The parameter value to return is specified by <pname>.
7815bd8deadSopenharmony_ci
7825bd8deadSopenharmony_ci    If <pipeline> is a name that has been generated (without subsequent
7835bd8deadSopenharmony_ci    deletion) by GenProgramPipelinesEXT, but refers to a program pipeline
7845bd8deadSopenharmony_ci    object that has not been previously bound, the GL first creates a
7855bd8deadSopenharmony_ci    new state vector in the same manner as when BindProgramPipelineEXT
7865bd8deadSopenharmony_ci    creates a new program pipeline object. If <pipeline> is not a name
7875bd8deadSopenharmony_ci    returned from a previous call to GenProgramPipelinesEXT or if such a
7885bd8deadSopenharmony_ci    name has since been deleted by DeleteProgramPipelinesEXT, an 
7895bd8deadSopenharmony_ci    INVALID_OPERATION error is generated.
7905bd8deadSopenharmony_ci
7915bd8deadSopenharmony_ci    If <pname> is ACTIVE_PROGRAM_EXT, the name of the active program
7925bd8deadSopenharmony_ci    object of the program pipeline object is returned.
7935bd8deadSopenharmony_ci    
7945bd8deadSopenharmony_ci    If <pname> is VERTEX_SHADER, the name of the current program
7955bd8deadSopenharmony_ci    object for the vertex shader type of the program pipeline object is
7965bd8deadSopenharmony_ci    returned.
7975bd8deadSopenharmony_ci       
7985bd8deadSopenharmony_ci    If <pname> is FRAGMENT_SHADER, the name of the current program
7995bd8deadSopenharmony_ci    object for the fragment shader type of the program pipeline object
8005bd8deadSopenharmony_ci    is returned.
8015bd8deadSopenharmony_ci       
8025bd8deadSopenharmony_ci    If <pname> is VALIDATE_STATUS, the validation status of the
8035bd8deadSopenharmony_ci    program pipeline object, as determined by ValidateProgramPipelineEXT
8045bd8deadSopenharmony_ci    (see section 2.10.5) is returned.
8055bd8deadSopenharmony_ci
8065bd8deadSopenharmony_ci    If <pname> is INFO_LOG_LENGTH, the length of the info log,
8075bd8deadSopenharmony_ci    including a null terminator, is returned. If there is no info log,
8085bd8deadSopenharmony_ci    zero is returned."
8095bd8deadSopenharmony_ci    
8105bd8deadSopenharmony_ci    Change paragraph describing GetShaderInfoLog and GetProgram:
8115bd8deadSopenharmony_ci
8125bd8deadSopenharmony_ci    "A string that contains information about the last compilation
8135bd8deadSopenharmony_ci    attempt on a shader object, last link or validation attempt on a
8145bd8deadSopenharmony_ci    program object, or last validation attempt on a program pipeline
8155bd8deadSopenharmony_ci    object, called the info log, can be obtained with the commands
8165bd8deadSopenharmony_ci
8175bd8deadSopenharmony_ci        void GetShaderInfoLog(uint shader, sizei bufSize,
8185bd8deadSopenharmony_ci                              sizei *length, char *infoLog);
8195bd8deadSopenharmony_ci        void GetProgramInfoLog(uint program, sizei bufSize,
8205bd8deadSopenharmony_ci                              sizei *length, char *infoLog);
8215bd8deadSopenharmony_ci        void GetProgramPipelineInfoLogEXT(uint pipeline, sizei bufSize,
8225bd8deadSopenharmony_ci                                          sizei *length, char *infoLog);
8235bd8deadSopenharmony_ci
8245bd8deadSopenharmony_ci    These commands return the info log string in <infoLog>. This string
8255bd8deadSopenharmony_ci    will be null-terminated. The actual number of characters written
8265bd8deadSopenharmony_ci    into <infoLog>, excluding the null terminator, is returned in
8275bd8deadSopenharmony_ci    <length>. If <length> is NULL, then no length is returned. The
8285bd8deadSopenharmony_ci    maximum number of characters that may be written into <infoLog>,
8295bd8deadSopenharmony_ci    including the null terminator, is specified by <bufSize>. The number
8305bd8deadSopenharmony_ci    of characters in the info log can be queried with GetShaderiv,
8315bd8deadSopenharmony_ci    GetProgramiv, or GetProgramPipelineivEXT with INFO_LOG_LENGTH. If
8325bd8deadSopenharmony_ci    <shader> is a shader object, the returned info log will either be an
8335bd8deadSopenharmony_ci    empty string or it will contain information about the last compil-
8345bd8deadSopenharmony_ci    ation attempt for that object. If <program> is a program object, the
8355bd8deadSopenharmony_ci    returned info log will either be an empty string or it will contain
8365bd8deadSopenharmony_ci    information about the last link attempt or last validation attempt
8375bd8deadSopenharmony_ci    for that object. If <pipeline> is a program pipeline object, the
8385bd8deadSopenharmony_ci    returned info log will either be an empty string or it will contain
8395bd8deadSopenharmony_ci    information about the last validation attempt for that object.
8405bd8deadSopenharmony_ci
8415bd8deadSopenharmony_ciAdditions to Appendix D of the OpenGL ES 2.0 Specification (Shared Objects and 
8425bd8deadSopenharmony_ciMultiple Contexts)
8435bd8deadSopenharmony_ci
8445bd8deadSopenharmony_ci    (add sentence to third paragraph, p. 164) Program pipeline objects are not
8455bd8deadSopenharmony_ci    shared.
8465bd8deadSopenharmony_ci
8475bd8deadSopenharmony_ciAdditions to the OpenGL ES Shading Language Specification, Version 1.0.17
8485bd8deadSopenharmony_ci
8495bd8deadSopenharmony_ci    Including the following line in a shader can be used to control
8505bd8deadSopenharmony_ci    the language feature described in thie extension:
8515bd8deadSopenharmony_ci
8525bd8deadSopenharmony_ci        #extension GL_EXT_separate_shader_objects : <behavior>
8535bd8deadSopenharmony_ci
8545bd8deadSopenharmony_ci    where <behavior> is as described in section 3.3.
8555bd8deadSopenharmony_ci
8565bd8deadSopenharmony_ci    A new preprocessor #define is added to the OpenGL ES Shading Language:
8575bd8deadSopenharmony_ci
8585bd8deadSopenharmony_ci        #define GL_EXT_separate_shader_objects 1
8595bd8deadSopenharmony_ci
8605bd8deadSopenharmony_ci -- Section 4.3.3 "Attribute" (page 30):
8615bd8deadSopenharmony_ci
8625bd8deadSopenharmony_ci    Add new section 4.3.3.1 "Attribute Layout Qualifiers"
8635bd8deadSopenharmony_ci    
8645bd8deadSopenharmony_ci    "Vertex shaders allow location layout qualifiers on attribute variable
8655bd8deadSopenharmony_ci    declarations.  The location layout qualifier identifier for vertex shader 
8665bd8deadSopenharmony_ci    attributes is:
8675bd8deadSopenharmony_ci
8685bd8deadSopenharmony_ci      layout-qualifier-id
8695bd8deadSopenharmony_ci        location = integer-constant
8705bd8deadSopenharmony_ci
8715bd8deadSopenharmony_ci    Only one argument is accepted.  For example,
8725bd8deadSopenharmony_ci
8735bd8deadSopenharmony_ci      layout(location = 3) attribute vec4 normal;
8745bd8deadSopenharmony_ci
8755bd8deadSopenharmony_ci    establishes that the vertex shader attribute <normal> is copied in from
8765bd8deadSopenharmony_ci    vector location number 3.
8775bd8deadSopenharmony_ci
8785bd8deadSopenharmony_ci    If an input variable with no location assigned in the shader text has a
8795bd8deadSopenharmony_ci    location specified through the OpenGL ES API, the API-assigned location will
8805bd8deadSopenharmony_ci    be used.  Otherwise, such variables will be assigned a location by the
8815bd8deadSopenharmony_ci    linker.  See section 2.10.4 of the OpenGL Specification for more details.
8825bd8deadSopenharmony_ci    A link error will occur if an attribute variable is declared in multiple
8835bd8deadSopenharmony_ci    vertex shaders with conflicting locations.
8845bd8deadSopenharmony_ci
8855bd8deadSopenharmony_ci
8865bd8deadSopenharmony_ci -- Section 4.3.5 "Varying" (page 31):
8875bd8deadSopenharmony_ci
8885bd8deadSopenharmony_ci    Add to the end of the section:
8895bd8deadSopenharmony_ci
8905bd8deadSopenharmony_ci    "When an interface between shader stages is formed using shaders from two
8915bd8deadSopenharmony_ci    separate program objects, it is not possible to detect mismatches between
8925bd8deadSopenharmony_ci    vertex shader varying outputs and fragment shader varying inputs when the 
8935bd8deadSopenharmony_ci    programs are linked. When there are mismatches between inputs and outputs 
8945bd8deadSopenharmony_ci    on such interfaces, the values passed across the interface will be 
8955bd8deadSopenharmony_ci    partially or completely undefined. Shaders can ensure matches across such 
8965bd8deadSopenharmony_ci    interfaces either by using varying layout qualifiers (Section 4.3.5.1) or 
8975bd8deadSopenharmony_ci    by using identical varying declarations.  Complete rules for interface
8985bd8deadSopenharmony_ci    matching are found in the "Shader Interface Matching" portion of section
8995bd8deadSopenharmony_ci    2.10.PPO of the OpenGL Specification."
9005bd8deadSopenharmony_ci
9015bd8deadSopenharmony_ci    Add new section 4.3.5.1 "Varying Layout Qualifiers"
9025bd8deadSopenharmony_ci
9035bd8deadSopenharmony_ci    "All shaders allow location layout qualifiers on varying variable
9045bd8deadSopenharmony_ci    declarations. The location layout qualifier identifier for varyings is:
9055bd8deadSopenharmony_ci
9065bd8deadSopenharmony_ci        layout-qualifier-id
9075bd8deadSopenharmony_ci            location = integer-constant
9085bd8deadSopenharmony_ci
9095bd8deadSopenharmony_ci    Only one argument is accepted. For example,
9105bd8deadSopenharmony_ci        layout(location = 3) varying vec4 normal;
9115bd8deadSopenharmony_ci
9125bd8deadSopenharmony_ci    establishes that the shader varying <normal> is assigned to vector
9135bd8deadSopenharmony_ci    location number 3.
9145bd8deadSopenharmony_ci
9155bd8deadSopenharmony_ci    If the declared varying is an array of size <n> and each element takes up
9165bd8deadSopenharmony_ci    <m> locations, it will be assigned <m>*<n> consecutive locations starting
9175bd8deadSopenharmony_ci    with the location specified.  For example,
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci        layout(location = 6) varying vec4 colors[3];
9205bd8deadSopenharmony_ci
9215bd8deadSopenharmony_ci    will establish that the input <colors> is assigned to vector
9225bd8deadSopenharmony_ci    location numbers 6, 7, and 8.
9235bd8deadSopenharmony_ci
9245bd8deadSopenharmony_ci    If the declared varying is an <n>x<m> matrix, it will be assigned multiple 
9255bd8deadSopenharmony_ci    locations starting with the location specified. The number of locations 
9265bd8deadSopenharmony_ci    assigned for each matrix will be the same as for an <n>-element array of 
9275bd8deadSopenharmony_ci    <m>-component vectors. For example,
9285bd8deadSopenharmony_ci
9295bd8deadSopenharmony_ci        layout(location = 9) varying mat4 transforms[2];
9305bd8deadSopenharmony_ci
9315bd8deadSopenharmony_ci    will establish that varying <transforms> is assigned to vector location
9325bd8deadSopenharmony_ci    numbers 9-16, with transforms[0] being assigned to locations 9-12 and
9335bd8deadSopenharmony_ci    transforms[1] being assigned to locations 13-16.
9345bd8deadSopenharmony_ci
9355bd8deadSopenharmony_ci    The number of varying locations available to a shader is limited to the 
9365bd8deadSopenharmony_ci    implementation-dependent advertised maximum varying vector count.
9375bd8deadSopenharmony_ci    A program will fail to link if any attached shader uses a location greater
9385bd8deadSopenharmony_ci    than or equal to the number of supported locations, unless
9395bd8deadSopenharmony_ci    device-dependent optimizations are able to make the program fit within
9405bd8deadSopenharmony_ci    available hardware resources.
9415bd8deadSopenharmony_ci
9425bd8deadSopenharmony_ci    A program will fail to link if any two varying variables are assigned to 
9435bd8deadSopenharmony_ci    the same location, or if explicit location assignments leave the linker 
9445bd8deadSopenharmony_ci    unable to find space for other variables without explicit assignments."
9455bd8deadSopenharmony_ci
9465bd8deadSopenharmony_ciDependencies on OpenGL ES 3.0
9475bd8deadSopenharmony_ci
9485bd8deadSopenharmony_ci    If OpenGL ES 3.0 isn't present, references to
9495bd8deadSopenharmony_ci    ProgramUniform{1234}ui[v] should be ignored. Also, any redundant
9505bd8deadSopenharmony_ci    language about explicit shader variable locations set within the
9515bd8deadSopenharmony_ci    shader text should also be ignored.
9525bd8deadSopenharmony_ci
9535bd8deadSopenharmony_ci    If neither OpenGL ES 3.0 nor NV_non_square_matrices is present,
9545bd8deadSopenharmony_ci    references to ProgramUniformMatrix{2x3,3x2,2x4,4x2,3x4,4x3}fv
9555bd8deadSopenharmony_ci    should be ignored.
9565bd8deadSopenharmony_ci    
9575bd8deadSopenharmony_ci    The behavior of mixing GLSL ES 1.00 shaders with GLSL ES 3.00 shaders
9585bd8deadSopenharmony_ci    in the same rendering pipeline is undefined.
9595bd8deadSopenharmony_ci    
9605bd8deadSopenharmony_ci    If the GL is OpenGL ES 3.0, make the following changes:
9615bd8deadSopenharmony_ci    
9625bd8deadSopenharmony_ci    Replace this sentence from the first paragraph of section 2.10.PPO Shader 
9635bd8deadSopenharmony_ci    Interface Matching:
9645bd8deadSopenharmony_ci    
9655bd8deadSopenharmony_ci    "These inputs and outputs must typically match in name, type, and 
9665bd8deadSopenharmony_ci    qualification."
9675bd8deadSopenharmony_ci    
9685bd8deadSopenharmony_ci    with the following language:
9695bd8deadSopenharmony_ci    
9705bd8deadSopenharmony_ci    "An output variable is considered to match an input variable in the
9715bd8deadSopenharmony_ci    subequent shader if:
9725bd8deadSopenharmony_ci
9735bd8deadSopenharmony_ci        * the two variables match in name, type, and qualification; or
9745bd8deadSopenharmony_ci
9755bd8deadSopenharmony_ci        * the two variables are declared with the same location layout
9765bd8deadSopenharmony_ci          qualifier and match in type and qualification."
9775bd8deadSopenharmony_ci    
9785bd8deadSopenharmony_ci    Add this paragraph after the first paragraph of section 2.10.PPO:
9795bd8deadSopenharmony_ci    
9805bd8deadSopenharmony_ci    "Variables declared as structures are considered to match in type if and 
9815bd8deadSopenharmony_ci    only if structure members match in name, type, qualification, and 
9825bd8deadSopenharmony_ci    declaration order.  Variables declared as arrays are considered to match 
9835bd8deadSopenharmony_ci    in type only if both declarations specify the same element type and array 
9845bd8deadSopenharmony_ci    size.  The rules for determining if variables match in qualification are
9855bd8deadSopenharmony_ci    found in the OpenGL Shading Language Specification."
9865bd8deadSopenharmony_ci    
9875bd8deadSopenharmony_ci    Replace the last paragraph from section 2.10.PPO:
9885bd8deadSopenharmony_ci    
9895bd8deadSopenharmony_ci    "Built-in inputs or outputs do not affect interface matching.  Any such 
9905bd8deadSopenharmony_ci    built-in inputs are well-defined unless they are derived from built-in 
9915bd8deadSopenharmony_ci    outputs not written by the previous shader stage."
9925bd8deadSopenharmony_ci    
9935bd8deadSopenharmony_ci    with the following new language:
9945bd8deadSopenharmony_ci    
9955bd8deadSopenharmony_ci    "When using GLSL ES 1.00 shaders, built-in inputs or outputs do not affect 
9965bd8deadSopenharmony_ci    interface matching. Any such built-in inputs are well-defined unless they 
9975bd8deadSopenharmony_ci    are derived from built-in outputs not written by the previous shader stage.
9985bd8deadSopenharmony_ci    
9995bd8deadSopenharmony_ci    When using GLSL ES 3.00 shaders in separable programs, gl_Position and 
10005bd8deadSopenharmony_ci    gl_PointSize built-in outputs must be redeclared according to Section 7.5 
10015bd8deadSopenharmony_ci    of the OpenGL Shading Language Specification. Other built-in inputs or 
10025bd8deadSopenharmony_ci    outputs do not affect interface matching. Any such built-in inputs are 
10035bd8deadSopenharmony_ci    well-defined unless they are derived from built-in outputs not written by 
10045bd8deadSopenharmony_ci    the previous shader stage."
10055bd8deadSopenharmony_ci    
10065bd8deadSopenharmony_ci    and add to GLSL ES 3.00 new section 7.5, Built-In Redeclaration and 
10075bd8deadSopenharmony_ci    Separable Programs:
10085bd8deadSopenharmony_ci    
10095bd8deadSopenharmony_ci    "The following vertex shader outputs may be redeclared at global scope to
10105bd8deadSopenharmony_ci    specify a built-in output interface, with or without special qualifiers:
10115bd8deadSopenharmony_ci
10125bd8deadSopenharmony_ci        gl_Position
10135bd8deadSopenharmony_ci        gl_PointSize
10145bd8deadSopenharmony_ci
10155bd8deadSopenharmony_ci      When compiling shaders using either of the above variables, both such
10165bd8deadSopenharmony_ci      variables must be redeclared prior to use.  ((Note:  This restriction
10175bd8deadSopenharmony_ci      applies only to shaders using version 300 that enable the
10185bd8deadSopenharmony_ci      EXT_separate_shader_objects extension; shaders not enabling the
10195bd8deadSopenharmony_ci      extension do not have this requirement.))  A separable program object
10205bd8deadSopenharmony_ci      will fail to link if any attached shader uses one of the above variables
10215bd8deadSopenharmony_ci      without redeclaration."
10225bd8deadSopenharmony_ci
10235bd8deadSopenharmony_ciDependencies on NV_non_square_matrices
10245bd8deadSopenharmony_ci
10255bd8deadSopenharmony_ci    If NV_non_square_matrices is supported,
10265bd8deadSopenharmony_ci    ProgramUniformMatrix{2x3,3x2,2x4,4x2,3x4,4x3}fvEXT is supported in
10275bd8deadSopenharmony_ci    OpenGL ES 2.0.
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ciErrors
10305bd8deadSopenharmony_ci
10315bd8deadSopenharmony_ci    UseProgramStagesEXT generates INVALID_OPERATION if the program
10325bd8deadSopenharmony_ci    parameter has not been successfully linked.
10335bd8deadSopenharmony_ci
10345bd8deadSopenharmony_ci    UseProgramStagesEXT generates INVALID_VALUE if <stages> has a bit
10355bd8deadSopenharmony_ci    set for any other than VERTEX_SHADER_BIT_EXT or 
10365bd8deadSopenharmony_ci    FRAGMENT_SHADER_BIT_EXT, unless <stages> is ALL_SHADER_BITS_EXT.
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci    ActiveShaderProgramEXT generates INVALID_OPERATION if <program>
10395bd8deadSopenharmony_ci    has not been successfully linked.
10405bd8deadSopenharmony_ci
10415bd8deadSopenharmony_ci    DrawArrays and DrawElements generate INVALID_OPERATION when a program 
10425bd8deadSopenharmony_ci    object with multiple attached shaders is active for one or more, but not 
10435bd8deadSopenharmony_ci    all of the shader program types corresponding to the shaders that are
10445bd8deadSopenharmony_ci    attached.
10455bd8deadSopenharmony_ci
10465bd8deadSopenharmony_ciNew State
10475bd8deadSopenharmony_ci
10485bd8deadSopenharmony_ci    Add to table 6.15 (Program Object State):
10495bd8deadSopenharmony_ci    
10505bd8deadSopenharmony_ci                                                       Initial
10515bd8deadSopenharmony_ci    Get Value           Type  Get Command              Value    Description               Sec   
10525bd8deadSopenharmony_ci    ------------------  ----  -----------------------  -------  ------------------------  ------
10535bd8deadSopenharmony_ci    PROGRAM_PIPELINE_-  Z+    GetIntegerv              0        Current program pipeline  2.10.PPO
10545bd8deadSopenharmony_ci    BINDING_EXT                                                 object binding
10555bd8deadSopenharmony_ci
10565bd8deadSopenharmony_ci    Add new table 6.PPO (Program Pipeline Object State):
10575bd8deadSopenharmony_ci
10585bd8deadSopenharmony_ci                                                            Initial
10595bd8deadSopenharmony_ci    Get Value           Type  Get Command                   Value    Description               Sec   
10605bd8deadSopenharmony_ci    ------------------  ----  ----------------------------  -------  ------------------------  ------
10615bd8deadSopenharmony_ci    ACTIVE_PROGRAM_EXT  Z+    GetProgramPipelineivEXT       0        The program object        2.10.PPO
10625bd8deadSopenharmony_ci                                                                     that Uniform* commands
10635bd8deadSopenharmony_ci                                                                     update when PPO bound
10645bd8deadSopenharmony_ci    VERTEX_SHADER       Z+    GetProgramPipelineivEXT       0        Name of current vertex    2.10.PPO
10655bd8deadSopenharmony_ci                                                                     shader program object
10665bd8deadSopenharmony_ci    FRAGMENT_SHADER     Z+    GetProgramPipelineivEXT       0        Name of current fragment  2.10.PPO
10675bd8deadSopenharmony_ci                                                                     shader program object
10685bd8deadSopenharmony_ci    VALIDATE_STATUS     B     GetProgramPipelineivEXT       FALSE    Validate status of        2.10.PPO
10695bd8deadSopenharmony_ci                                                                     program pipeline object
10705bd8deadSopenharmony_ci                        S     GetProgramPipelineInfoLogEXT  empty    Info log for program      6.1.8
10715bd8deadSopenharmony_ci                                                                     pipeline object                                                      
10725bd8deadSopenharmony_ci    INFO_LOG_LENGTH     Z+    GetProgramPipelineivEXT       0        Length of info log        6.1.8
10735bd8deadSopenharmony_ci                                                    
10745bd8deadSopenharmony_ciNew Implementation Dependent State
10755bd8deadSopenharmony_ci
10765bd8deadSopenharmony_ci    None
10775bd8deadSopenharmony_ci
10785bd8deadSopenharmony_ciIssues
10795bd8deadSopenharmony_ci
10805bd8deadSopenharmony_ci    See ARB_separate_shader_objects extension specification for issues
10815bd8deadSopenharmony_ci    documented while working on the original desktop OpenGL extension.
10825bd8deadSopenharmony_ci    
10835bd8deadSopenharmony_ciRevision History
10845bd8deadSopenharmony_ci
10855bd8deadSopenharmony_ci    Rev.    Date      Author     Changes
10865bd8deadSopenharmony_ci    ----  ----------  ---------  ---------------------------------------------
10875bd8deadSopenharmony_ci    1     2011-06-17  Benj       Initial revision for ES based on
10885bd8deadSopenharmony_ci                                 ARB_separate_shader_objects extension.
10895bd8deadSopenharmony_ci
10905bd8deadSopenharmony_ci    2     2011-07-22  Benj       Rename APPLE to EXT, specify that PPOs are
10915bd8deadSopenharmony_ci                                 not shareable.
10925bd8deadSopenharmony_ci
10935bd8deadSopenharmony_ci    3     2011-07-26  Benj       Add VALIDATE_STATUS to state tables and
10945bd8deadSopenharmony_ci                                 GetProgramPipelineivEXT description, remove 
10955bd8deadSopenharmony_ci                                 the language erroneously deleting
10965bd8deadSopenharmony_ci                                 CURRENT_PROGRAM.
10975bd8deadSopenharmony_ci
10985bd8deadSopenharmony_ci    4     2013-03-07  Jon Leech  Added note about the unrelated OpenGL 
10995bd8deadSopenharmony_ci                                 extension of the same name.             
11005bd8deadSopenharmony_ci
11015bd8deadSopenharmony_ci    5     2013-03-25  Benj       Add interactions with OpenGL ES 3.0.
11025bd8deadSopenharmony_ci    6     2013-09-20  dkoch      Add interactions with NV_non_square_matrices.
11035bd8deadSopenharmony_ci    7     2013-11-08  marka      Clarify ProgramUniform*ui availability.
1104