15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    AMD_draw_buffers_blend
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_AMD_draw_buffers_blend
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Mark Young
125bd8deadSopenharmony_ci    Graham Sellers
135bd8deadSopenharmony_ci    Timothy Lamb
145bd8deadSopenharmony_ci    Pierre Boudier
155bd8deadSopenharmony_ci    Nick Haemel
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciContact
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Mark Young, AMD (mark.young 'at' amd.com)
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciStatus
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    In progress
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciVersion
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    Last Modified Date:         July 10, 2009
285bd8deadSopenharmony_ci    Author Revision:            3
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciNumber
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    366
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciDependencies
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    The extension is written against the OpenGL 2.0 Specification.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    OpenGL 2.0 is required.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    EXT_draw_buffers2 is required.
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciOverview
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    This extension builds upon the ARB_draw_buffers and EXT_draw_buffers2
455bd8deadSopenharmony_ci    extensions. In ARB_draw_buffers (part of OpenGL 2.0), separate values
465bd8deadSopenharmony_ci    could be written to each color buffer.  This was further enhanced by
475bd8deadSopenharmony_ci    EXT_draw_buffers2 by adding in the ability to enable blending and to set
485bd8deadSopenharmony_ci    color write masks independently per color output.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    This extension provides the ability to set individual blend equations and
515bd8deadSopenharmony_ci    blend functions for each color output.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciNew Procedures and Functions
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci   void BlendFuncIndexedAMD(uint buf, enum src, enum dst);
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci   void BlendFuncSeparateIndexedAMD(uint buf, enum srcRGB, enum dstRGB,
585bd8deadSopenharmony_ci                                    enum srcAlpha, enum dstAlpha);
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci   void BlendEquationIndexedAMD(uint buf, enum mode);
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci   void BlendEquationSeparateIndexedAMD(uint buf, enum modeRGB,
635bd8deadSopenharmony_ci                                        enum modeAlpha);
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ciNew Tokens
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    None.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    None.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    None.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment
785bd8deadSopenharmony_ciOperations and the Frame Buffer)
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    Modify the first two paragraphs of section 4.1.8 (Blending - Blending
815bd8deadSopenharmony_ci    Equation), p206, to read as follows:
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci        "Blending is controlled by the blend equation.  This equation can be
845bd8deadSopenharmony_ci        simultaneously set to the same value for all draw buffers using the
855bd8deadSopenharmony_ci        commands:
865bd8deadSopenharmony_ci    
875bd8deadSopenharmony_ci           void BlendEquation(enum mode);
885bd8deadSopenharmony_ci    
895bd8deadSopenharmony_ci           void BlendEquationSeparate(enum modeRGB, enum modeAlpha);
905bd8deadSopenharmony_ci    
915bd8deadSopenharmony_ci        or for an individual draw buffer using the indexed versions of the
925bd8deadSopenharmony_ci        same commands:
935bd8deadSopenharmony_ci    
945bd8deadSopenharmony_ci            void BlendEquationIndexedAMD(uint buf, enum mode);
955bd8deadSopenharmony_ci    
965bd8deadSopenharmony_ci            void BlendEquationSeparateIndexedAMD(uint buf
975bd8deadSopenharmony_ci                                                 enum modeRGB,
985bd8deadSopenharmony_ci                                                 enum modeAlpha);
995bd8deadSopenharmony_ci    
1005bd8deadSopenharmony_ci        BlendEquationSeparate and BlendEquationSeparateIndexedAMD separate
1015bd8deadSopenharmony_ci        out the blend equations into an RGB argument and an Alpha argument.
1025bd8deadSopenharmony_ci        <modeRGB> determine the RGB blend function while <modeAlpha>
1035bd8deadSopenharmony_ci        determines the alpha equation.  BlendEquation and
1045bd8deadSopenharmony_ci        BlendEquationIndexedAMD control both the RGB and Alpha blend
1055bd8deadSopenharmony_ci        equations with a single argument <mode>.  <modeRGB> and <modeAlpha>
1065bd8deadSopenharmony_ci        must each be one of FUNC_ADD, FUNC_SUBTRACT, FUNC_REVERSE_SUBTRACT,
1075bd8deadSopenharmony_ci        MIN_MAX, or LOGIC_OP.  BlendEquationIndexedAMD and
1085bd8deadSopenharmony_ci        BlendEquationSeparateIndexedAMD argument <buf> sets the blend
1095bd8deadSopenharmony_ci        equations for an individual draw buffer.  The blend equations for
1105bd8deadSopenharmony_ci        DRAW_BUFFERi are modified by passing i as the parameter <buf>."
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    Modify the first two paragraphs of section 4.1.8 (Blending - Blending
1145bd8deadSopenharmony_ci    Functions), p207, to read as follows:
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci        "The weighting factors used by the blend equation are determined by
1175bd8deadSopenharmony_ci        the blend functions.  Blend functions are simultaneously specified for
1185bd8deadSopenharmony_ci        all draw buffers using the commands:
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci        void BlendFunc(enum src, enum dst);
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci        void BlendFuncSeparate(enum srcRGB, enum dstRGB,
1235bd8deadSopenharmony_ci                               enum srcAlpha, enum dstAlpha);
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci        or for an individual draw buffer using the indexed versions of the
1265bd8deadSopenharmony_ci        same commands:
1275bd8deadSopenharmony_ci    
1285bd8deadSopenharmony_ci            void BlendFuncIndexedAMD(uint buf, enum src, enum dst);
1295bd8deadSopenharmony_ci    
1305bd8deadSopenharmony_ci            void BlendFuncSeparateIndexedAMD(uint buf, enum srcRGB,
1315bd8deadSopenharmony_ci                                             enum dstRGB, enum srcAlpha,
1325bd8deadSopenharmony_ci                                             enum dstAlpha);
1335bd8deadSopenharmony_ci    
1345bd8deadSopenharmony_ci        BlendFuncSeparate and BlendFuncSeparateIndexedAMD arguments <srcRGB>
1355bd8deadSopenharmony_ci        and <dstRGB> determine the source and destination RGB blend functions,
1365bd8deadSopenharmony_ci        respectively, while <srcAlpha> and <dstAlpha> determine the source and
1375bd8deadSopenharmony_ci        destination alpha blend functions.  BlendFunc and BlendFuncIndexedAMD
1385bd8deadSopenharmony_ci        arguments <src> determines both RGB and alpha source functions, while
1395bd8deadSopenharmony_ci        <dst> determines both RGB and alpha destination functions.
1405bd8deadSopenharmony_ci        BlendFuncSeparateIndexedAMD and BlendFuncIndexedAMD argument <buf>
1415bd8deadSopenharmony_ci        sets the blend functions for an indivual draw buffer.  The blend
1425bd8deadSopenharmony_ci        functions for DRAW_BUFFERi are modified by passing i as the parameter
1435bd8deadSopenharmony_ci        <buf>."
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    Modify the first paragraph of section 4.1.8 (Blending - Blending
1475bd8deadSopenharmony_ci    State), p209, to read as follows:
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci        "For each of n draw buffers, the state required for blending is two
1505bd8deadSopenharmony_ci        integers for the RGB and alpha blend equations, four integers
1515bd8deadSopenharmony_ci        indicating the source and destination RGB and alpha blending functions,
1525bd8deadSopenharmony_ci        four floating-point values to store the RGBA constant blend color, and
1535bd8deadSopenharmony_ci        a bit indicating whether blending is enabled or disabled.  For all draw
1545bd8deadSopenharmony_ci        buffers, the initial blend equations for RGB and alpha are both
1555bd8deadSopenharmony_ci        FUNC_ADD.  The initial blending functions for all draw buffers are ONE
1565bd8deadSopenharmony_ci        for the source RGB and alpha functions, and ZERO for the destination
1575bd8deadSopenharmony_ci        RGB and alpha functions.  For all draw buffers initial constant blend
1585bd8deadSopenharmony_ci        color is (R, G, B, A) = (0, 0, 0, 0).  Initially, blending is disabled
1595bd8deadSopenharmony_ci        for all draw buffers."
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    None.
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and
1665bd8deadSopenharmony_ciState Requests)
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    None.
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 2.0 Specification (Invariance)
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    None.
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    None.
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ciErrors
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if the <buf> parameter of
1815bd8deadSopenharmony_ci    BlendFuncIndexedAMD, BlendFuncSeparateIndexedAMD, BlendEquationIndexedAMD,
1825bd8deadSopenharmony_ci    or BlendEquatioSeparateIndexedAMD is outside the range
1835bd8deadSopenharmony_ci    [0, MAX_DRAW_BUFFERS-1].
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by BlendFuncIndexedAMD
1865bd8deadSopenharmony_ci    if either <src>, or <dst> is not an accepted value.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by BlendFuncSeparateIndexedAMD
1895bd8deadSopenharmony_ci    if either <srcRGB>, <dstRGB>, <srcAlpha>, or <dstAlpha> is not
1905bd8deadSopenharmony_ci    an accepted value.
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if the <mode> parameter of
1935bd8deadSopenharmony_ci    BlendEquationIndexedAMD is not one of FUNC_ADD, FUNC_SUBTRACT,
1945bd8deadSopenharmony_ci    FUNC_REVERSE_SUBTRACT, MAX, or MIN.
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if either the <modeRGB> or <modeAlpha>
1975bd8deadSopenharmony_ci    parameter of BlendEquationSeparateIndexedAMD is not one of
1985bd8deadSopenharmony_ci    FUNC_ADD, FUNC_SUBTRACT, FUNC_REVERSE_SUBTRACT, MAX, or MIN.
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if any of these new entry-points
2015bd8deadSopenharmony_ci    are executed between the execution of glBegin and the corresponding
2025bd8deadSopenharmony_ci    execution of glEnd.
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ciNew State
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    Modify (table 6.20, p281), modifying the entries for BLEND_SRC_RGB,
2075bd8deadSopenharmony_ci    BLEND_SRC_ALPHA, BLEND_DST_RGB, BLEND_DST_ALPHA, BLEND_EQUATION_RGB,
2085bd8deadSopenharmony_ci    and BLEND_EQUATION_ALPHA and adding new indexed versions as well.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    Get Target               Type Get Command           Initial Value  Description                                     Section       Attribute
2125bd8deadSopenharmony_ci    ----------               ---- --------------------- -------------- ----------------------------------------------- ------- -------------------
2135bd8deadSopenharmony_ci    BLEND_SRC_RGB            Z15  GetIntegerv           ONE            Blending source RGB function for draw buffer 0  4.1.8   color-buffer
2145bd8deadSopenharmony_ci      (v1.3:BLEND_SRC)
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci    BLEND_SRC_RGB            Z15  GetIntegerIndexedvEXT ONE            Blending source RGB function for draw buffer i  4.1.8   color-buffer
2175bd8deadSopenharmony_ci      (v1.3:BLEND_SRC)                                                 where i is specified as <buf>
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    BLEND_SRC_ALPHA          Z15  GetIntegerv           ONE            Blending source A function for draw buffer 0    4.1.8   color-buffer
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    BLEND_SRC_ALPHA          Z15  GetIntegerIndexedvEXT ONE            Blending source A function for draw buffer i    4.1.8   color-buffer
2225bd8deadSopenharmony_ci                                                                        where i is specified as <buf>
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    BLEND_DST_RGB            Z14  GetIntegerv           ZERO           Blending dest. RGB function for draw buffer 0   4.1.8   color-buffer
2255bd8deadSopenharmony_ci      (v1.3:BLEND DST)
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci    BLEND_DST_RGB            Z14  GetIntegerIndexedvEXT ZERO           Blending dest. RGB function for draw buffer i   4.1.8   color-buffer
2285bd8deadSopenharmony_ci      (v1.3:BLEND DST)                                                  where i is specified as <buf>
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    BLEND_DST_ALPHA          Z14  GetIntegerv           ZERO           Blending dest. A function for draw buffer 0     4.1.8   color-buffer
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    BLEND_DST_ALPHA          Z14  GetIntegerIndexedvEXT ZERO           Blending dest. A function for draw buffer i     4.1.8   color-buffer
2335bd8deadSopenharmony_ci                                                                        where i is specified as <buf>
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    BLEND_EQUATION_RGB       Z5   GetIntegerv           FUNC_ADD       RGB blending equation for draw buffer 0         4.1.8   color-buffer
2365bd8deadSopenharmony_ci      (v1.5: BLEND EQUATION)
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    BLEND_EQUATION_RGB       Z5   GetIntegerIndexedvEXT FUNC_ADD       RGB blending equation for draw buffer i         4.1.8   color-buffer
2395bd8deadSopenharmony_ci      (v1.5: BLEND EQUATION)                                            where i is specified as <buf>
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    BLEND_EQUATION_ALPHA     Z5   GetIntegerv           FUNC_ADD       Alpha blending equation for draw buffer 0       4.1.8   color-buffer
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    BLEND_EQUATION_ALPHA     Z5   GetIntegerIndexedvEXT FUNC_ADD       Alpha blending equation for draw buffer i       4.1.8   color-buffer
2445bd8deadSopenharmony_ci                                                                        where i is specified as <buf>
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ciIssues
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    1.  What should we call this?
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci        PROPOSED: Suggestions currently are
2515bd8deadSopenharmony_ci             AMD_draw_buffers_blend
2525bd8deadSopenharmony_ci             AMD_drawbuffers_blend
2535bd8deadSopenharmony_ci             AMD_mrt_blend
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    2.  Should this be an AMDX extension or just AMD?
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci        PROPOSED: We propose AMD since the functionality currently exists in
2595bd8deadSopenharmony_ci        DX 10.1 and is used by developers in that API.
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    3.  What effect does using the non-indexed versions of the blend function
2635bd8deadSopenharmony_ci        or equation entry-points have upon the new indexed per draw buffer
2645bd8deadSopenharmony_ci        versions?
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci        RESOLVED: Similar to the way EXT_draw_buffers2 handles the indexed
2675bd8deadSopenharmony_ci        and non-indexed ColorMask interaction in issue 3.  The non-indexed
2685bd8deadSopenharmony_ci        versions of the functions will set all buffers to the passed in
2695bd8deadSopenharmony_ci        parameters.
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci        For example, BlendFunc will set all color buffer blend functions to
2725bd8deadSopenharmony_ci        the values passed in.
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    4.  Should the new functions be ---Indexed (as in EXT_draw_buffers2) or
2755bd8deadSopenharmony_ci        ---i (as in OpenGL 3.0 core)?
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci        RESOLVED: For consistency with EXT_draw_buffers2, leave them as
2785bd8deadSopenharmony_ci        ---Indexed. If this functionality is promoted to core in a later
2795bd8deadSopenharmony_ci        version of OpenGL, they can be changed to ---i.
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ciRevision History
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    #3, July 10, 2009: Jon Leech
2845bd8deadSopenharmony_ci	Assign extension number, minor formatting cleanup for registry.
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    #2, March 26, 2009: myoung
2875bd8deadSopenharmony_ci        Tightened up language. Resolved some issues.
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci    #1, March 25, 2009: myoung
2905bd8deadSopenharmony_ci        Internal spec development.
291