15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ATI_draw_buffers
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ATI_draw_buffers
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Benj Lipchak
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContact
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Rob Mace, ATI Research (rob.mace 'at' amd.com)
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciStatus
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Complete.
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciVersion
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Last Modified Date: November 4, 2006
245bd8deadSopenharmony_ci    Revision: 9
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNumber
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    277
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciDependencies
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    The extension is written against the OpenGL 1.3 Specification.
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    OpenGL 1.3 is required.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    ARB_fragment_program affects the definition of this extension.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciOverview
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    This extension extends ARB_fragment_program to allow multiple output 
425bd8deadSopenharmony_ci    colors, and provides a mechanism for directing those outputs to 
435bd8deadSopenharmony_ci    multiple color buffers.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciIssues
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    (1) How many GL_DRAW_BUFFER#_ATI enums should be reserved?  
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci      RESOLVED: We only need 4 currently, but for future expandability 
515bd8deadSopenharmony_ci      it would be nice to keep the enums in sequence.  We'll specify
525bd8deadSopenharmony_ci      16 for now, which will be more than enough for a long time.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciNew Procedures and Functions
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    void DrawBuffersATI(sizei n, const enum *bufs);
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ciNew Tokens
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    Accepted by the <pname> parameters of GetIntegerv, GetFloatv,
635bd8deadSopenharmony_ci    and GetDoublev:
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci        MAX_DRAW_BUFFERS_ATI                    0x8824
665bd8deadSopenharmony_ci        DRAW_BUFFER0_ATI                        0x8825
675bd8deadSopenharmony_ci        DRAW_BUFFER1_ATI                        0x8826
685bd8deadSopenharmony_ci        DRAW_BUFFER2_ATI                        0x8827
695bd8deadSopenharmony_ci        DRAW_BUFFER3_ATI                        0x8828
705bd8deadSopenharmony_ci        DRAW_BUFFER4_ATI                        0x8829
715bd8deadSopenharmony_ci        DRAW_BUFFER5_ATI                        0x882A
725bd8deadSopenharmony_ci        DRAW_BUFFER6_ATI                        0x882B
735bd8deadSopenharmony_ci        DRAW_BUFFER7_ATI                        0x882C
745bd8deadSopenharmony_ci        DRAW_BUFFER8_ATI                        0x882D
755bd8deadSopenharmony_ci        DRAW_BUFFER9_ATI                        0x882E
765bd8deadSopenharmony_ci        DRAW_BUFFER10_ATI                       0x882F
775bd8deadSopenharmony_ci        DRAW_BUFFER11_ATI                       0x8830
785bd8deadSopenharmony_ci        DRAW_BUFFER12_ATI                       0x8831
795bd8deadSopenharmony_ci        DRAW_BUFFER13_ATI                       0x8832
805bd8deadSopenharmony_ci        DRAW_BUFFER14_ATI                       0x8833
815bd8deadSopenharmony_ci        DRAW_BUFFER15_ATI                       0x8834
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.3 Specification (OpenGL
855bd8deadSopenharmony_ciOperation)
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    None
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.3 Specification (Rasterization)
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    Modify Section 3.11.2, Fragment Program Grammar and Semantic 
935bd8deadSopenharmony_ci    Restrictions
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    (replace <resultBinding> grammar rule with these rules)
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    <resultBinding>        ::= "result" "." "color" <optOutputColorNum>
985bd8deadSopenharmony_ci                             | "result" "." "depth"
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    <optOutputColorNum>    ::= ""
1015bd8deadSopenharmony_ci                             | "[" <outputColorNum> "]"
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    <outputColorNum>       ::= <integer> from 0 to MAX_DRAW_BUFFERS_ATI-1
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    Modify Section 3.11.3.4, Fragment Program Results
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    (modify Table X.3)
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci        Binding                        Components  Description
1115bd8deadSopenharmony_ci        -----------------------------  ----------  ----------------------------
1125bd8deadSopenharmony_ci        result.color[n]                (r,g,b,a)   color n 
1135bd8deadSopenharmony_ci        result.depth                   (*,*,*,d)   depth coordinate
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci        Table X.3:  Fragment Result Variable Bindings.  Components labeled
1165bd8deadSopenharmony_ci        "*" are unused.  "[n]" is optional -- color <n> is used if 
1175bd8deadSopenharmony_ci        specified; color 0 is used otherwise.
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    (modify third paragraph)  If a result variable binding matches 
1205bd8deadSopenharmony_ci    "result.color[n]", updates to the "x", "y", "z", and "w" components 
1215bd8deadSopenharmony_ci    of the result variable modify the "r", "g", "b", and "a" components, 
1225bd8deadSopenharmony_ci    respectively, of the fragment's corresponding output color.  If 
1235bd8deadSopenharmony_ci    "result.color[n]" is not both bound by the fragment program and 
1245bd8deadSopenharmony_ci    written by some instruction of the program, the output color <n> of 
1255bd8deadSopenharmony_ci    the fragment program is undefined.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    Add a new Section 3.11.4.5.3
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    3.11.4.5.3  Draw Buffers Program Option
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci    If a fragment program specifies the "ATI_draw_buffers" option,
1335bd8deadSopenharmony_ci    it will generate multiple output colors, and the result binding
1345bd8deadSopenharmony_ci    "result.color[n]" is allowed, as described in section 3.11.3.4,
1355bd8deadSopenharmony_ci    and with modified grammar rules as set forth in section 3.11.2.
1365bd8deadSopenharmony_ci    If this option is not specified, a fragment program that attempts
1375bd8deadSopenharmony_ci    to bind "result.color[n]" will fail to load, and only "result.color"
1385bd8deadSopenharmony_ci    will be allowed.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.3 Specification (Per-Fragment
1425bd8deadSopenharmony_ciOperations and the Frame Buffer)
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    Modify Section 4.2.1, Selecting a Buffer for Writing (p. 168)
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    (modify the title and first paragraph, p. 168)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    4.2.1 Selecting Color Buffers for Writing
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci    The first such operation is controlling the color buffers into
1515bd8deadSopenharmony_ci    which each of the output colors are written.  This is accomplished
1525bd8deadSopenharmony_ci    with either DrawBuffer or DrawBuffersATI.  DrawBuffer defines the
1535bd8deadSopenharmony_ci    set of color buffers to which output color 0 is written.
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    (insert paragraph between first and second paragraph, p. 168)  
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    DrawBuffer will set the draw buffer for output colors other than 0 
1585bd8deadSopenharmony_ci    to NONE.  DrawBuffersATI defines the draw buffers to which all 
1595bd8deadSopenharmony_ci    output colors are written.
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci      void DrawBuffersATI(sizei n, const enum *bufs);
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    <n> specifies the number of buffers in <bufs>.  <bufs> is a pointer
1645bd8deadSopenharmony_ci    to an array of symbolic constants specifying the buffer to which 
1655bd8deadSopenharmony_ci    each output color is written.  The constants may be NONE, 
1665bd8deadSopenharmony_ci    FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, and AUX0 through 
1675bd8deadSopenharmony_ci    AUXn, where n + 1 is the number of available auxiliary buffers.  The 
1685bd8deadSopenharmony_ci    draw buffers being defined correspond in order to the respective 
1695bd8deadSopenharmony_ci    output colors.  The draw buffer for output colors beyond <n> is set 
1705bd8deadSopenharmony_ci    to NONE.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    If the "ATI_draw_buffers" fragment program option, is not being used
1735bd8deadSopenharmony_ci    then DrawBuffersATI specifies a set of draw buffers into which output
1745bd8deadSopenharmony_ci    color 0 is written.
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    The maximum number of draw buffers is implementation dependent and 
1775bd8deadSopenharmony_ci    must be at least 1.  The number of draw buffers supported can
1785bd8deadSopenharmony_ci    be queried with the state MAX_DRAW_BUFFERS_ATI.
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    The constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK that
1815bd8deadSopenharmony_ci    refer to multiple buffers are not valid for use in DrawBuffersATI
1825bd8deadSopenharmony_ci    and will result in the error INVALID_OPERATION.
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    If DrawBuffersATI is supplied with a constant (other than NONE)
1855bd8deadSopenharmony_ci    that does not indicate any of the color buffers allocated to
1865bd8deadSopenharmony_ci    the GL context, the error INVALID_OPERATION will be generated.  If 
1875bd8deadSopenharmony_ci    <n> is greater than MAX_DRAW_BUFFERS_ATI, the error 
1885bd8deadSopenharmony_ci    INVALID_OPERATION will be generated.
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    (replace last paragraph, p. 169)
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    The state required to handle color 
1935bd8deadSopenharmony_ci    buffer selection is an integer for each supported output color.  In 
1945bd8deadSopenharmony_ci    the initial state, draw buffer for output color 0 is FRONT if there 
1955bd8deadSopenharmony_ci    are no back buffers; otherwise it is BACK.  The initial state of 
1965bd8deadSopenharmony_ci    draw buffers for output colors other then 0 is NONE.
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.3 Specification (Special 
2005bd8deadSopenharmony_ciFunctions)
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    None
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.3 Specification (State and
2065bd8deadSopenharmony_ciState Requests)
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    None
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ciDependencies on ARB_fragment_program
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    If ARB_fragment_program is not supported then all changes to
2145bd8deadSopenharmony_ci    section 3.11 are removed.
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ciInteractions with possible future extensions
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    If there is some other future extension that defines multiple
2205bd8deadSopenharmony_ci    color outputs then this extension and glDrawBuffersATI could be
2215bd8deadSopenharmony_ci    used to define the destinations for those outputs.  This extension
2225bd8deadSopenharmony_ci    need not be used only with ARB_fragment_program.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ciErrors
2265bd8deadSopenharmony_ci  
2275bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by DrawBuffersATI if a
2285bd8deadSopenharmony_ci    color buffer not currently allocated to the GL context is specified.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by DrawBuffersATI if <n>
2315bd8deadSopenharmony_ci    is greater than the state MAX_DRAW_BUFFERS_ATI.
2325bd8deadSopenharmony_ci    
2335bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by DrawBuffersATI if value in
2345bd8deadSopenharmony_ci    <bufs> does not correspond to one of the allowed buffers.
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ciNew State
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    (table 6.19, p227) add the following entry:
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    Get Value                        Type    Get Command    Initial Value Description           Section       Attribute
2425bd8deadSopenharmony_ci    -------------------------------  ------  -------------  ------------- --------------------  ------------  ------------
2435bd8deadSopenharmony_ci    DRAW_BUFFERi_ATI                 Z10*    GetIntegerv    see 4.2.1     Draw buffer selected  4.2.1         color-buffer
2445bd8deadSopenharmony_ci                                                                          for output color i
2455bd8deadSopenharmony_ci    
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ciNew Implementation Dependent State
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    Get Value                        Type  Get Command     Minimum Value    Description             Sec.     Attribute
2505bd8deadSopenharmony_ci    ---------                        ----  -----------     -------------    -------------------     -----    ---------
2515bd8deadSopenharmony_ci    MAX_DRAW_BUFFERS_ATI             Z+    GetIntegerv     1                Maximum number of       4.2.1    -
2525bd8deadSopenharmony_ci                                                                            active draw buffers
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ciRevision History
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci   Date: 11/4/2006
2585bd8deadSopenharmony_ci   Revision: 9
2595bd8deadSopenharmony_ci      - Updated contact info after ATI/AMD merger.
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci   Date: 12/30/2002
2625bd8deadSopenharmony_ci   Revision: 8
2635bd8deadSopenharmony_ci      - Clarified that DrawBuffersATI will set the set of draw buffers to
2645bd8deadSopenharmony_ci        write color output 0 to when the "ATI_draw_buffer" fragments
2655bd8deadSopenharmony_ci        program option is not in use.
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci   Date: 9/27/2002
2685bd8deadSopenharmony_ci   Revision: 7
2695bd8deadSopenharmony_ci      - Fixed confusion between meaning of color buffer and draw buffer
2705bd8deadSopenharmony_ci        in last revision.
2715bd8deadSopenharmony_ci      - Fixed mistake in when an error is generated based on the <n>
2725bd8deadSopenharmony_ci        argument of DrawBuffersATI.
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci   Date: 9/26/2002
2755bd8deadSopenharmony_ci   Revision: 6
2765bd8deadSopenharmony_ci      - Cleaned up and put in sync with latest ARB_fragment_program
2775bd8deadSopenharmony_ci        revision (#22).  Some meaningless changes made just in the name
2785bd8deadSopenharmony_ci        of consistency.
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci   Date: 9/11/2002
2815bd8deadSopenharmony_ci   Revision: 5
2825bd8deadSopenharmony_ci      - Added section 3.11.4.5.3.
2835bd8deadSopenharmony_ci      - Added enum numbers to New Tokens.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci   Date: 9/9/2002
2865bd8deadSopenharmony_ci   Revision: 4
2875bd8deadSopenharmony_ci      - Changed error from MAX_OUTPUT_COLORS to MAX_DRAW_BUFFERS_ATI.
2885bd8deadSopenharmony_ci      - Changed 3.10 section numbers to 3.11 to match change to
2895bd8deadSopenharmony_ci        ARB_fragment_program spec.
2905bd8deadSopenharmony_ci      - Changed ARB_fragment_program from required to affects, and
2915bd8deadSopenharmony_ci        added section on interactions with it and future extensions
2925bd8deadSopenharmony_ci        that define multiple color outputs.
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci   Date: 9/6/2002
2955bd8deadSopenharmony_ci   Revision: 3
2965bd8deadSopenharmony_ci      - Changed error to INVALID OPERATION.
2975bd8deadSopenharmony_ci      - Cleaned up typos.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci   Date: 8/19/2002
3005bd8deadSopenharmony_ci   Revision: 2
3015bd8deadSopenharmony_ci      - Added a paragraph that specifically points out that the 
3025bd8deadSopenharmony_ci        constants that refer to multiple buffers are not allowed with
3035bd8deadSopenharmony_ci        DrawBuffersATI.
3045bd8deadSopenharmony_ci      - Changed bufs to <bufs> in a couple of places.
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci   Date: 8/16/2002
3075bd8deadSopenharmony_ci   Revision: 1
3085bd8deadSopenharmony_ci      - First draft for circulation.
309