15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    OES_draw_buffers_indexed
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_OES_draw_buffers_indexed
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Graham Connor, Imagination
165bd8deadSopenharmony_ci    Ben Bowman, Imagination
175bd8deadSopenharmony_ci    Jonathan Putsman, Imagination
185bd8deadSopenharmony_ci    Contributors to EXT_draw_buffers2
195bd8deadSopenharmony_ci    Contributors to ARB_draw_buffers_blend
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciNotice
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Copyright (c) 2014 The Khronos Group Inc. Copyright terms at
245bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciSpecification Update Policy
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
295bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL ES Working Group. For
305bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
315bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
325bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
335bd8deadSopenharmony_ci    described in more detail at
345bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciStatus
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    Approved by the OpenGL ES Working Group
395bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on November 7, 2014
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciVersion
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    Last Modified Date: July 14, 2014
445bd8deadSopenharmony_ci    Revision: 2
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciNumber
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    OpenGL ES Extension #209
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciDependencies
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    OpenGL ES 3.0 or EXT_draw_buffers is required.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.0 specification.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ciOverview
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    This extension builds upon the EXT_draw_buffers extension.
595bd8deadSopenharmony_ci    In EXT_draw_buffers (part of OpenGL ES 3.0), separate values could
605bd8deadSopenharmony_ci    be written to each color buffer, but the blend enable, blend functions,
615bd8deadSopenharmony_ci    blend equations and color write masks are global and apply to all color
625bd8deadSopenharmony_ci    outputs.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    This extension provides the ability to independently
655bd8deadSopenharmony_ci      * enable or disable blending,
665bd8deadSopenharmony_ci      * set the blend equations,
675bd8deadSopenharmony_ci      * set the blend functions, and
685bd8deadSopenharmony_ci      * set the color write masks
695bd8deadSopenharmony_ci    per color output.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    This extension introduces indexed versions of the enable,
725bd8deadSopenharmony_ci    blend equation, blend function, and color mask commands, as
735bd8deadSopenharmony_ci    well as associated indexed queries in order to control and
745bd8deadSopenharmony_ci    query these states independently on a per-color output basis.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ciNew Procedures and Functions
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    void EnableiOES(enum target, uint index);
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    void DisableiOES(enum target, uint index);
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    void BlendEquationiOES(uint buf, enum mode);
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    void BlendEquationSeparateiOES(uint buf, enum modeRGB,
855bd8deadSopenharmony_ci                                   enum modeAlpha);
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    void BlendFunciOES(uint buf, enum src, enum dst);
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    void BlendFuncSeparateiOES(uint buf, enum srcRGB, enum dstRGB,
905bd8deadSopenharmony_ci                               enum srcAlpha, enum dstAlpha);
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    void ColorMaskiOES(uint buf, boolean r, boolean g,
935bd8deadSopenharmony_ci                       boolean b, boolean a);
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    boolean IsEnablediOES(enum target, uint index);
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ciNew Tokens
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    Accepted by the <target> parameter of GetBooleani_v, GetIntegeri_v, and
1005bd8deadSopenharmony_ci    GetInteger64i_v:
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci        BLEND_EQUATION_RGB
1035bd8deadSopenharmony_ci        BLEND_EQUATION_ALPHA
1045bd8deadSopenharmony_ci        BLEND_SRC_RGB
1055bd8deadSopenharmony_ci        BLEND_SRC_ALPHA
1065bd8deadSopenharmony_ci        BLEND_DST_RGB
1075bd8deadSopenharmony_ci        BLEND_DST_ALPHA
1085bd8deadSopenharmony_ci        COLOR_WRITEMASK
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Accepted by the <target> parameter of EnableiOES, DisableiOES, and
1115bd8deadSopenharmony_ci    IsEnablediOES:
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        BLEND
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    Accepted by the <mode> parameter of BlendEquationiOES and by the
1165bd8deadSopenharmony_ci    <modeRGB> and <modeAlpha> parameters of BlendEquationSeparateiOES:
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci        FUNC_ADD
1195bd8deadSopenharmony_ci        FUNC_SUBTRACT
1205bd8deadSopenharmony_ci        FUNC_REVERSE_SUBTRACT
1215bd8deadSopenharmony_ci        MIN
1225bd8deadSopenharmony_ci        MAX
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    Accepted by the <src> and <dst> parameters of BlendFunciOES and
1255bd8deadSopenharmony_ci    by the <srcRGB>, <dstRGB>, <srcAlpha>, and <dstAlpha> parameters
1265bd8deadSopenharmony_ci    of BlendFuncSeparateiOES:
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci        ZERO
1295bd8deadSopenharmony_ci        ONE
1305bd8deadSopenharmony_ci        SRC_COLOR
1315bd8deadSopenharmony_ci        ONE_MINUS_SRC_COLOR
1325bd8deadSopenharmony_ci        DST_COLOR
1335bd8deadSopenharmony_ci        ONE_MINUS_DST_COLOR
1345bd8deadSopenharmony_ci        SRC_ALPHA
1355bd8deadSopenharmony_ci        ONE_MINUS_SRC_ALPHA
1365bd8deadSopenharmony_ci        DST_ALPHA
1375bd8deadSopenharmony_ci        ONE_MINUS_DST_ALPHA
1385bd8deadSopenharmony_ci        CONSTANT_COLOR
1395bd8deadSopenharmony_ci        ONE_MINUS_CONSTANT_COLOR
1405bd8deadSopenharmony_ci        CONSTANT_ALPHA
1415bd8deadSopenharmony_ci        ONE_MINUS_CONSTANT_ALPHA
1425bd8deadSopenharmony_ci        SRC_ALPHA_SATURATE
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    (Note all of the above tokens are already defined in OpenGL ES 3.0.)
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    None.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 3.0 Specification (Rasterization)
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    None.
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 3.0 Specification (Per-Fragment
1555bd8deadSopenharmony_ciOperations and the Framebuffer)
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    Modify the fifth paragraph of section 4.1.7 (Blending), p. 179, to
1585bd8deadSopenharmony_ci    read as follows:
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    "Blending is enabled or disabled for an individual draw buffer with
1615bd8deadSopenharmony_ci    the commands:
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci        void EnableiOES(enum target, uint index);
1645bd8deadSopenharmony_ci        void DisableiOES(enum target, uint index);
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    <target> is the symbolic constant BLEND and <index> is an integer
1675bd8deadSopenharmony_ci    <i> specifying the draw buffer associated with the symbolic constant
1685bd8deadSopenharmony_ci    DRAW_BUFFER<i>. Blending can be enabled or
1695bd8deadSopenharmony_ci    disabled for all draw buffers using Enable or Disable with the
1705bd8deadSopenharmony_ci    symbolic constant BLEND.  If blending is disabled for a particular
1715bd8deadSopenharmony_ci    draw buffer, proceed to the next operation."
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    Modify section "Blend Equation" replacing the first paragraph beginning
1745bd8deadSopenharmony_ci    on p. 179, with the following:
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    "Blending is controlled by the blend equation. This equation can be
1775bd8deadSopenharmony_ci    simultaneously set to the same value for all draw buffers using the
1785bd8deadSopenharmony_ci    commands:
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci       void BlendEquation(enum mode);
1815bd8deadSopenharmony_ci       void BlendEquationSeparate(enum modeRGB, enum modeAlpha);
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    or for an individual draw buffer using the indexed commands:
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci        void BlendEquationiOES(uint buf, enum mode);
1865bd8deadSopenharmony_ci        void BlendEquationSeparateiOES(uint buf
1875bd8deadSopenharmony_ci                                       enum modeRGB,
1885bd8deadSopenharmony_ci                                       enum modeAlpha);
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    BlendEquationSeparate and BlendEquationSeparateiOES argument
1915bd8deadSopenharmony_ci    <modeRGB> determines the RGB blend equation while <modeAlpha>
1925bd8deadSopenharmony_ci    determines the alpha blend equation. BlendEquation and
1935bd8deadSopenharmony_ci    BlendEquationiOES argument <mode> determines both the RGB and alpha
1945bd8deadSopenharmony_ci    blend equations. <mode>, <modeRGB>, and <modeAlpha> must be one of
1955bd8deadSopenharmony_ci    FUNC_ADD, FUNC_SUBTRACT, FUNC_REVERSE_SUBTRACT, MIN, MAX.
1965bd8deadSopenharmony_ci    BlendEquation and BlendEquationSeparate modify the blend equations
1975bd8deadSopenharmony_ci    for all draw buffers. BlendEquationiOES and
1985bd8deadSopenharmony_ci    BlendEquationSeparateiOES modify the blend equations associated with
1995bd8deadSopenharmony_ci    an individual draw buffer. The <buf> argument is an integer <i> that
2005bd8deadSopenharmony_ci    indicates that the blend equations should be modified for
2015bd8deadSopenharmony_ci    DRAW_BUFFER<i>."
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    Modify section "Blend Functions" on p. 181, replacing the last sentence
2045bd8deadSopenharmony_ci    of the first paragraph and the second paragraph with the following:
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    "Blend functions are simultaneously specified
2075bd8deadSopenharmony_ci    for all draw buffers using the commands:
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci        void BlendFunc(enum src, enum dst);
2105bd8deadSopenharmony_ci        void BlendFuncSeparate(enum srcRGB, enum dstRGB,
2115bd8deadSopenharmony_ci                               enum srcAlpha, enum dstAlpha);
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    or for an individual draw buffer using the indexed commands:
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci        void BlendFunciOES(uint buf, enum src, enum dst);
2165bd8deadSopenharmony_ci        void BlendFuncSeparateiOES(uint buf, enum srcRGB,
2175bd8deadSopenharmony_ci                                   enum dstRGB, enum srcAlpha,
2185bd8deadSopenharmony_ci                                   enum dstAlpha);
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    BlendFuncSeparate and BlendFuncSeparateiOES arguments <srcRGB> and
2215bd8deadSopenharmony_ci    <dstRGB> determine the source and destination RGB blend functions,
2225bd8deadSopenharmony_ci    respectively, while <srcAlpha> and <dstAlpha> determine the source
2235bd8deadSopenharmony_ci    and destination alpha blend functions. BlendFunc and BlendFunciOES
2245bd8deadSopenharmony_ci    argument <src> determines both RGB and alpha source functions, while
2255bd8deadSopenharmony_ci    <dst> determines both RGB and alpha destination functions.
2265bd8deadSopenharmony_ci    BlendFuncSeparate and BlendFunc modify the blend functions for all
2275bd8deadSopenharmony_ci    draw buffers. BlendFuncSeparateiOES and BlendFunciOES modify the
2285bd8deadSopenharmony_ci    blend functions associated with an individual draw buffer. The <buf>
2295bd8deadSopenharmony_ci    argument is an integer <i> that indicates that the blend equations
2305bd8deadSopenharmony_ci    should be modified for DRAW_BUFFER<i>."
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    Modify section "Blending State" on p. 183, replacing the first two
2335bd8deadSopenharmony_ci    paragraphs with the following:
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    "The state required for blending, for each draw buffer, is two
2365bd8deadSopenharmony_ci    integers for the RGB and alpha blend equations, four integers
2375bd8deadSopenharmony_ci    indicating the source and destination RGB and alpha blending
2385bd8deadSopenharmony_ci    functions, and a bit indicating whether blending is enabled or
2395bd8deadSopenharmony_ci    disabled. Additionally, four floating-point values to store the RGBA
2405bd8deadSopenharmony_ci    constant blend color are required.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    For all draw buffers, the initial blend equations for RGB and alpha
2435bd8deadSopenharmony_ci    are both FUNC_ADD, and the initial blending functions are ONE for
2445bd8deadSopenharmony_ci    the source RGB and alpha functions, and ZERO for the destination RGB
2455bd8deadSopenharmony_ci    and alpha functions. Initially, blending is disabled for all draw
2465bd8deadSopenharmony_ci    buffers. The initial constant blend color is (R,G,B,A) = (0,0,0,0).
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    The value of the blend enable for draw buffer <i> can be queried by
2495bd8deadSopenharmony_ci    calling IsEnablediOES with <target> BLEND and <index> <i>, and the
2505bd8deadSopenharmony_ci    values of the blend equations and functions can be queried by calling
2515bd8deadSopenharmony_ci    GetIntegeri_v with the corresponding <target> as shown in
2525bd8deadSopenharmony_ci    table 6.11 and <index> <i>.
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci    The value of the blend enable, or the blend equations and functions
2555bd8deadSopenharmony_ci    for draw buffer zero may also be queried by calling IsEnabled, or
2565bd8deadSopenharmony_ci    GetInteger, respectively, with the same symbolic constants but no
2575bd8deadSopenharmony_ci    <index> parameter."
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci    Modify section 4.2.2 (Fine Control of Buffer Updates) replacing the
2605bd8deadSopenharmony_ci    first two paragraphs as follows:
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    "Writing to bits of each of the logical framebuffers after all
2635bd8deadSopenharmony_ci    per-fragment operations have been performed may be "masked". The
2645bd8deadSopenharmony_ci    commands:
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci        void ColorMask(boolean r, boolean g, boolean b, boolean a);
2675bd8deadSopenharmony_ci        void ColorMaskiOES(uint buf, boolean r, boolean g,
2685bd8deadSopenharmony_ci                           boolean b, boolean a);
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    control writes to the active draw buffers.
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    ColorMask and ColorMaskiOES are used to mask
2735bd8deadSopenharmony_ci    the writing of R, G, B and A values to the draw buffer or buffers.
2745bd8deadSopenharmony_ci    ColorMaskiOES sets the mask for a particular draw buffer.
2755bd8deadSopenharmony_ci    The mask for DRAW_BUFFER<i> is modified by passing <i> as the parameter
2765bd8deadSopenharmony_ci    <buf>.  <r>, <g>, <b>, and <a> indicate whether R, G, B, or A
2775bd8deadSopenharmony_ci    values, respectively, are written or not (a value of TRUE means
2785bd8deadSopenharmony_ci    that the corresponding  value is written).  The mask specified by
2795bd8deadSopenharmony_ci    <r>, <g>, <b>, and <a> is applied to the color buffer associated
2805bd8deadSopenharmony_ci    with DRAW_BUFFER<i>.
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci    ColorMask sets the mask for all draw buffers to the same values as
2835bd8deadSopenharmony_ci    specified by <r>, <g>, <b>, and <a>.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    In the initial state, all color values are enabled for writing for all
2865bd8deadSopenharmony_ci    draw buffers.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    The value of the color writemask for draw buffer <i> can be queried
2895bd8deadSopenharmony_ci    by calling GetBooleani_v with <target> COLOR_WRITEMASK and <index>
2905bd8deadSopenharmony_ci    <i>.  The value of the color writemask for draw buffer zero may also be
2915bd8deadSopenharmony_ci    queried by calling GetBooleanv with the symbolic constant COLOR_WRITEMASK."
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 3.0 Specification (Special Functions)
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    None.
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 3.0 Specification (State and
2985bd8deadSopenharmony_ciState Requests)
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ci    Modify section 6.1.1 (Simple Queries) p. 226.
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci    Replace the 3rd paragraph with the following:
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    "Finally,
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci        boolean IsEnabled(enum cap);
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci    can be used to determine if <cap> is currently enabled (as with
3095bd8deadSopenharmony_ci    Enable) or disabled, and
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci        boolean IsEnablediOES(enum target, uint index);
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    can be used to determine if the index state corresponding to
3145bd8deadSopenharmony_ci    <target> and <index> is enabled or disabled.
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL ES 3.0 Specification (Invariance)
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    None.
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ciAdditions to the EGL/AGL/GLX/WGL Specifications
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci    None.
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ciErrors
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by BlendEquationiOES,
3275bd8deadSopenharmony_ci    BlendEquationSeparateiOES, BlendFuncSeparateiOES, and
3285bd8deadSopenharmony_ci    BlendFunciOES if the <buf> parameter is outside the range
3295bd8deadSopenharmony_ci    [0, MAX_DRAW_BUFFERS-1].
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetIntegeri_v
3325bd8deadSopenharmony_ci    if <target> is BLEND_EQUATION_RGB, BLEND_EQUATION_ALPHA, BLEND_SRC_RGB,
3335bd8deadSopenharmony_ci    BLEND_SRC_ALPHA, BLEND_DST_RGB, BLEND_DST_ALPHA, and <index> is outside
3345bd8deadSopenharmony_ci    the range [0, MAX_DRAW_BUFFERS-1].
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by BlendFunciOES
3375bd8deadSopenharmony_ci    if either <src>, or <dst> is not an accepted value.
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by BlendFuncSeparateiOES
3405bd8deadSopenharmony_ci    if either <srcRGB>, <dstRGB>, <srcAlpha>, or <dstAlpha> is not
3415bd8deadSopenharmony_ci    an accepted value.
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if the <mode> parameter of
3445bd8deadSopenharmony_ci    BlendEquationiOES is not one of FUNC_ADD, FUNC_SUBTRACT,
3455bd8deadSopenharmony_ci    FUNC_REVERSE_SUBTRACT, MAX, or MIN.
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if either the <modeRGB> or
3485bd8deadSopenharmony_ci    <modeAlpha> parameter of BlendEquationSeparateiOES is not one of
3495bd8deadSopenharmony_ci    FUNC_ADD, FUNC_SUBTRACT, FUNC_REVERSE_SUBTRACT, MAX, or MIN.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by EnableiOES and
3525bd8deadSopenharmony_ci    DisableiOES if the <target> parameter is not BLEND.
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by EnableiOES and
3555bd8deadSopenharmony_ci    DisableiOES if the <target> parameter is BLEND and the <index>
3565bd8deadSopenharmony_ci    parameter is outside the range [0, MAX_DRAW_BUFFERS-1].
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by IsEnablediOES if the
3595bd8deadSopenharmony_ci    <target> parameter is not BLEND.
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by IsEnablediOES if
3625bd8deadSopenharmony_ci    the <target> parameter is BLEND and the <index> parameter is
3635bd8deadSopenharmony_ci    outside the range [0, MAX_DRAW_BUFFERS-1].
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by ColorMaskiOES
3665bd8deadSopenharmony_ci    if the <buf> parameter is outside the range[0, MAX_DRAW_BUFFERS-1].
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetBooleani_v if the <target>
3695bd8deadSopenharmony_ci    parameter is COLOR_WRITEMASK and the <index> parameter is outside the
3705bd8deadSopenharmony_ci    range [0, MAX_DRAW_BUFFERS-1].
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ciNew State
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci     Modify Table 6.11 (Pixel Operations) p. 254, modifying the entries for
3755bd8deadSopenharmony_ci     BLEND enable, the blend functions and blend equations, adding indexed
3765bd8deadSopenharmony_ci     versions:
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci                                                 Initial
3795bd8deadSopenharmony_ci    Get Value            Type      Get Command   Value    Description                           Section
3805bd8deadSopenharmony_ci    -------------------- --------- ------------- -------- ------------------------------------  -------
3815bd8deadSopenharmony_ci    BLEND                B         IsEnablediOES False    Blending enabled for draw buffer <i>  4.1.7
3825bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3835bd8deadSopenharmony_ci    BLEND_SRC_RGB        4* x Z_19 GetIntegeri_v ONE      Blending source RGB                   4.1.7
3845bd8deadSopenharmony_ci                                                          function for draw buffer <i>
3855bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3865bd8deadSopenharmony_ci    BLEND_SRC_ALPHA      4* x Z_19 GetIntegeri_v ONE      Blending source A                     4.1.7
3875bd8deadSopenharmony_ci                                                          function for draw buffer <i>
3885bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3895bd8deadSopenharmony_ci    BLEND_DST_RGB        4* x Z_19 GetIntegeri_v ZERO     Blending destination RGB              4.1.7
3905bd8deadSopenharmony_ci                                                          function for draw buffer <i>
3915bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3925bd8deadSopenharmony_ci    BLEND_DST_ALPHA      4* x Z_19 GetIntegeri_v ZERO     Blending destination A                4.1.7
3935bd8deadSopenharmony_ci                                                          function for draw buffer <i>
3945bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3955bd8deadSopenharmony_ci    BLEND_EQUATION_RGB   4* x Z_5  GetIntegeri_v FUNC_ADD RGB blending equation                 4.1.7
3965bd8deadSopenharmony_ci                                                          for draw buffer <i>
3975bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
3985bd8deadSopenharmony_ci    BLEND_EQUATION_ALPHA 4* x Z_5  GetIntegeri_v FUNC_ADD Alpha blending equation               4.1.7
3995bd8deadSopenharmony_ci                                                          for draw buffer <i>
4005bd8deadSopenharmony_ci                                                          where <i> is specified as <index>
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    Modify Table 6.12 (Framebuffer Control) p. 255, modifying the entry for
4035bd8deadSopenharmony_ci    COLOR_WRITEMASK:
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    Get Value       Type     Get Command   Value  Description                        Section
4065bd8deadSopenharmony_ci    --------------- -------- ------------- ------ ---------------------------------- -------
4075bd8deadSopenharmony_ci    COLOR_WRITEMASK 4* x 4xB GetBooleani_v 4xTrue Color write enables (R, G, B, A)   4.2.2
4085bd8deadSopenharmony_ci                                                  for draw buffer <i>
4095bd8deadSopenharmony_ci                                                  where <i> is specified as <index>
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ciIssues
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci    Note: these issues apply specifically to the definition of
4145bd8deadSopenharmony_ci    OES_draw_buffers_indexed, which is based on the OpenGL EXT_draw_buffers2
4155bd8deadSopenharmony_ci    and ARB_draw_buffers_blend extensions as updated in OpenGL 4.x.
4165bd8deadSopenharmony_ci    Resolved issues from EXT_draw_buffers2 and ARB_draw_buffers_blend have
4175bd8deadSopenharmony_ci    been removed but remain largely applicable to this extension. These
4185bd8deadSopenharmony_ci    extensions can be found in the OpenGL Registry.
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    (1) What functionality was removed from EXT_draw_buffers2 and
4215bd8deadSopenharmony_ci    ARB_draw_buffers_blend?
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ci    - removed mention of multiple buffers being associated with DRAW_BUFFER<i>
4245bd8deadSopenharmony_ci    - removed mention of logical operation on color values
4255bd8deadSopenharmony_ci    - removed mention of the IndexMask command
4265bd8deadSopenharmony_ci    - removed errors related to glBegin/End
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    (2) What functionality was changed or added relative to EXT_draw_buffers2
4295bd8deadSopenharmony_ci    and ARB_draw_buffers_blend?
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    - use EnableiOES/DisableiOES instead of Enable/DisableIndexedEXT
4325bd8deadSopenharmony_ci    - use ColorMaskiOES instead of ColorMaskIndexedEXT
4335bd8deadSopenharmony_ci    - use IsEnablediOES instead of IsEnabledIndexedEXT
4345bd8deadSopenharmony_ci    - GetIntegeri_v is already in ES 3.0 and is re-used instead of adding
4355bd8deadSopenharmony_ci      GetIntegerIndexedvEXT.
4365bd8deadSopenharmony_ci    - GetBooleani_v is already in ES 3.1 and is re-used instead of adding
4375bd8deadSopenharmony_ci      GetBooleanIndexedvEXT
4385bd8deadSopenharmony_ci    - change the errors to be consistent and match GL 4.4.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    (3) Issue removed. Not applicable to this extension.
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    (4) Why doesn't this extension include GetBooleani_vOES?
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    RESOLVED: GetBooleani_v was added in OpenGL ES 3.1 per Bug 11326 and thus
4455bd8deadSopenharmony_ci    no longer needs to be added by this extension.  This extension does
4465bd8deadSopenharmony_ci    however extend the commands accepted by this core function.
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    (5) What is the correct error for all the commands which take a <buf>
4495bd8deadSopenharmony_ci    or <index> parameter which should be in the range [0, MAX_DRAW_BUFFERS-1]?
4505bd8deadSopenharmony_ci
4515bd8deadSopenharmony_ci    RESOLVED: INVALID_VALUE is the correct error.
4525bd8deadSopenharmony_ci    EXT_draw_buffers2 specified INVALID_OPERATION for the EnableIndexedEXT,
4535bd8deadSopenharmony_ci    DisableIndexedEXT, IsEnabledIndexedEXT, and GetBooleanIndexedvEXT commands.
4545bd8deadSopenharmony_ci    ARB_draw_buffers_blend specified INVALID_ENUM for the
4555bd8deadSopenharmony_ci    Blend{Equation Func}[Separate]iARB commands.
4565bd8deadSopenharmony_ci    OpenGL 4.4 specifies INVALID_VALUE for the core versions of all these
4575bd8deadSopenharmony_ci    commands. This was clarified by Bug 7705, but never propagated back to
4585bd8deadSopenharmony_ci    the ARB_draw_buffers_blend extension.  Since we are basing the
4595bd8deadSopenharmony_ci    functionality on the core versions of these commands we will use the
4605bd8deadSopenharmony_ci    GL 4.x error values.
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci    (6) What is the correct error for the Blend{Equation Func}[Separate]iOES
4635bd8deadSopenharmony_ci    commands if mode/modeRGB/modeAlpha/srcRGB/srcAlpha/dstRGB/dstAlpha is
4645bd8deadSopenharmony_ci    not a legal value?
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci    RESOLVED. INVALID_ENUM. Some versions of the GL 4.4 spec said it should be
4675bd8deadSopenharmony_ci    INVALID_VALUE, but it seems that the more correct error value should
4685bd8deadSopenharmony_ci    INVALID_ENUM since all of these values are specified as 'enum' in the
4695bd8deadSopenharmony_ci    function signatures. This was clarified in Bug 11354.
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ciRevision History
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci    Rev.    Date      Author    Changes
4755bd8deadSopenharmony_ci    ----  ----------  --------  -----------------------------------------
4765bd8deadSopenharmony_ci     2    07/14/2014  dkoch     Remove stray tokens from error (bug 12358)
4775bd8deadSopenharmony_ci     1    06/18/2014  dkoch     Initial OES version based on EXT.
4785bd8deadSopenharmony_ci                                No functional changes.
479