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