15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_provoking_vertex
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_provoking_vertex
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Cynthia Allison, NVIDIA
125bd8deadSopenharmony_ci    Gregory Roth, NVIDIA
135bd8deadSopenharmony_ci    Daniel Koch, TransGaming
145bd8deadSopenharmony_ci    Gavriel State, TransGaming
155bd8deadSopenharmony_ci    Jason Green, TransGaming
165bd8deadSopenharmony_ci    Ian Romanick, Intel
175bd8deadSopenharmony_ci    Marcus Steyer, NVIDIA
185bd8deadSopenharmony_ci    Pat Brown, NVIDIA
195bd8deadSopenharmony_ci    Stefan Dosinger, CodeWeavers
205bd8deadSopenharmony_ci    Henri Verbeet, CodeWeavers
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciContact
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Mark Kilgard, NVIDIA (mjk 'at' nvidia.com)
255bd8deadSopenharmony_ci    Daniel Koch, TransGaming (daniel 'at' transgaming.com)
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciNotice
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    Copyright (c) 2009-2013 The Khronos Group Inc. Copyright terms at
305bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciSpecification Update Policy
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
355bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
365bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
375bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
385bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
395bd8deadSopenharmony_ci    described in more detail at
405bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciStatus
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    Complete. Approved by the ARB on July 3, 2009.
455bd8deadSopenharmony_ci    Implemented by NVIDIA, March 2009
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ciVersion
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    Last Modified Date:  August 2, 2009
505bd8deadSopenharmony_ci    Version:             3
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ciNumber
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    ARB Extension #64
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ciDependencies
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    This extension is written against the OpenGL 2.1 Specification but
595bd8deadSopenharmony_ci    can apply to any prior specification.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    ARB_geometry_shader4, EXT_geometry_shader4, NV_geometry_shader4,
625bd8deadSopenharmony_ci    and NV_gpu_program4 interact with this extension
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    EXT_transform_feedback, NV_transform_feedback, and the transform
655bd8deadSopenharmony_ci    feedback functionality made core by OpenGL 3.0 are clarified by
665bd8deadSopenharmony_ci    this extension.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciOverview
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    This extension provides an alternative provoking vertex convention
715bd8deadSopenharmony_ci    for rendering lines, triangles, and (optionally depending on the
725bd8deadSopenharmony_ci    implementation) quads.
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    The provoking vertex of a primitive is the vertex that determines the
755bd8deadSopenharmony_ci    constant primary and secondary colors when flat shading is enabled.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    In OpenGL, the provoking vertex for triangle, quad, line, and
785bd8deadSopenharmony_ci    (trivially) point primitives is the last vertex used to assemble
795bd8deadSopenharmony_ci    the primitive.  The polygon primitive is an exception in OpenGL where
805bd8deadSopenharmony_ci    the first vertex of a polygon primitive determines the color of the
815bd8deadSopenharmony_ci    polygon, even if actually broken into triangles and/or quads.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    See section 2.14.7 (Flatshading) of the OpenGL 2.1 specification,
845bd8deadSopenharmony_ci    particularly Table 2.12 for more details.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    Alternatively the provoking vertex could be the first vertex of
875bd8deadSopenharmony_ci    the primitive.  Other APIs with flat-shading functionality such
885bd8deadSopenharmony_ci    as Reality Lab and Direct3D have adopted the "first vertex of the
895bd8deadSopenharmony_ci    primitive" convention to determine the provoking vertex.  However,
905bd8deadSopenharmony_ci    these APIs lack quads so do not have a defined provoking vertex
915bd8deadSopenharmony_ci    convention for quads.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    The motivation for this extension is to allow applications developed
945bd8deadSopenharmony_ci    for APIs with a "first vertex of the primitive" provoking vertex to
955bd8deadSopenharmony_ci    be easily converted to OpenGL.
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ciNew Procedures and Functions
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    void ProvokingVertex(enum mode);
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ciNew Tokens
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    Accepted by the <mode> parameter of ProvokingVertex:
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci        FIRST_VERTEX_CONVENTION                   0x8E4D
1065bd8deadSopenharmony_ci        LAST_VERTEX_CONVENTION                    0x8E4E
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
1095bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci        PROVOKING_VERTEX                          0x8E4F
1125bd8deadSopenharmony_ci        QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION  0x8E4C
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.1 Specification (OpenGL Operation)
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci -- Section 2.14.7 "Flatshading" (page 69)
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    Replace the entire section with:
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci    "For fixed-function vertex processing, flatshading a primitive means
1215bd8deadSopenharmony_ci    to assign all vertices of the primitive the same primary and
1225bd8deadSopenharmony_ci    secondary colors (in RGBA mode) or the same color index (in color
1235bd8deadSopenharmony_ci    index mode). If a vertex shader is active, flatshading a varying
1245bd8deadSopenharmony_ci    output means to assign all vertices of the primitive the same value
1255bd8deadSopenharmony_ci    for that output.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    The color and/or varying output values assigned are those of the
1285bd8deadSopenharmony_ci    provoking vertex of the primitive. The provoking vertex is
1295bd8deadSopenharmony_ci    controlled with the command
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci       void ProvokingVertex(enum provokeMode);
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    provokeMode must be either FIRST_VERTEX_CONVENTION or
1345bd8deadSopenharmony_ci    LAST_VERTEX_CONVENTION, and controls selection of the vertex whose
1355bd8deadSopenharmony_ci    values are assigned to the flatshaded colors and varying outputs, as
1365bd8deadSopenharmony_ci    shown in Table 2.12.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    The provoking vertex behavior of quad primitives is implementation
1395bd8deadSopenharmony_ci    dependent, and may be determined by calling GetBooleanv with the
1405bd8deadSopenharmony_ci    symbolic constant QUADS_FOLLOW_PROVOKING_VERTEX. A return value of
1415bd8deadSopenharmony_ci    TRUE indicates that the provoking vertex mode is respected for quad
1425bd8deadSopenharmony_ci    primitives, while a return value of FALSE indicates that the
1435bd8deadSopenharmony_ci    implementation always behaves as though the provoking vertex mode
1445bd8deadSopenharmony_ci    were LAST_VERTEX_CONVENTION.
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    Flatshading of colors in fixed-function vertex processing, and of
1475bd8deadSopenharmony_ci    the built-in varying variables gl_FrontColor, gl_BackColor,
1485bd8deadSopenharmony_ci    gl_FrontSecondaryColor and gl_BackSecondaryColor when a vertex
1495bd8deadSopenharmony_ci    shader is active, is controlled with the command
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci       void ShadeModel(enum mode);
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    <mode> must be SMOOTH or FLAT. If <mode> is SMOOTH, vertex colors
1545bd8deadSopenharmony_ci    are treated individually. If <mode> is FLAT, flatshading is enabled
1555bd8deadSopenharmony_ci    and colors are taken from the provoking vertex of the primitive. The
1565bd8deadSopenharmony_ci    colors selected are those derived from current values, generated by
1575bd8deadSopenharmony_ci    lighting, or generated by vertex shading, if lighting is disabled,
1585bd8deadSopenharmony_ci    enabled, or a vertex shader is in use, respectively.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    If a vertex or geometry shader is active, user-defined varying
1615bd8deadSopenharmony_ci    outputs may be flatshaded by using the <flat> qualifer when
1625bd8deadSopenharmony_ci    declaring the ouput, as described in section 4.3.6 of the OpenGL
1635bd8deadSopenharmony_ci    Shading Language Specification (version 1.40.06).
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    The state required for flatshading is one bit for the shade mode,
1665bd8deadSopenharmony_ci    one bit for the provoking vertex mode, and one
1675bd8deadSopenharmony_ci    implementation-dependent bit for the provoking vertex behavior of
1685bd8deadSopenharmony_ci    quad primitives. The initial value of the shade mode is SMOOTH and
1695bd8deadSopenharmony_ci    the initial value of the provoking vertex mode is
1705bd8deadSopenharmony_ci    LAST_VERTEX_CONVENTION.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci                                     First vertex  Last vertex
1735bd8deadSopenharmony_ci        Primitive type of polygon i  convention    convention
1745bd8deadSopenharmony_ci        ===========================  ============  ==================================================
1755bd8deadSopenharmony_ci        point                             i        i                                               <- same
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci        independent line                  2i-1     2i
1785bd8deadSopenharmony_ci        line loop                         i        i+1, if i<n
1795bd8deadSopenharmony_ci                                                   1,   if i==n
1805bd8deadSopenharmony_ci        line strip                        i        i+1
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci        independent triangle              3i-2     3i
1835bd8deadSopenharmony_ci        triangle strip                    i        i+2
1845bd8deadSopenharmony_ci        triangle fan                      i+1      i+2
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci        independent quad                  4i-3     4i,   if QUADS_FOLLOW_PROVOKING_VERTEX = true
1875bd8deadSopenharmony_ci                                          4i       4i,   if QUADS_FOLLOW_PROVOKING_VERTEX = false  <- same
1885bd8deadSopenharmony_ci        quad strip                        2i-1     2i+2, if QUADS_FOLLOW_PROVOKING_VERTEX = true
1895bd8deadSopenharmony_ci                                          2i+2     2i+2, if QUADS_FOLLOW_PROVOKING_VERTEX = false  <- same
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci        single polygon (i=1)              1        1                                               <- same
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci        line adjacency                    4i-2     4i-1
1945bd8deadSopenharmony_ci        line strip adjacency              i+1      i+2
1955bd8deadSopenharmony_ci        triangle adjacency                6i-5     6i-1
1965bd8deadSopenharmony_ci        triangle strip adjacency          2i-1     2i+3
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci    Table 2.12: Provoking vertex selection. The vertex colors and/or
1995bd8deadSopenharmony_ci    varying values used for flatshading the <i>th primitive generated by
2005bd8deadSopenharmony_ci    the drawing commands with the indicated primitive type are derived
2015bd8deadSopenharmony_ci    from the corresponding values of the vertex whose index is shown in
2025bd8deadSopenharmony_ci    the table. Vertices are numbered 1 through n, where n is the number
2035bd8deadSopenharmony_ci    of vertices drawn."
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.1 Specification (Rasterization)
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    None
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.1 Specification (Per-Fragment
2105bd8deadSopenharmony_ciOperations and the Frame Buffer)
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci    None
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.1 Specification (Special
2155bd8deadSopenharmony_ciFunctions)
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    None
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.1 Specification (State and
2205bd8deadSopenharmony_ciState Requests)
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    None
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    None
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ciAdditions to the OpenGL Shading Language
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    None
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ciDependencies on ARB_geometry_shader4, EXT_geometry_shader4,
2335bd8deadSopenharmony_ciNV_geometry_shader4, NV_gpu_program4, and/or the geometry shader
2345bd8deadSopenharmony_cifunctionality integrated into the core by OpenGL 3.2:
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    If none of ARB_geometry_shader4, EXT_geometry_shader4,
2375bd8deadSopenharmony_ci    NV_geometry_shader4, NV_gpu_program4, or OpenGL 3.2 (or later) are
2385bd8deadSopenharmony_ci    supported:
2395bd8deadSopenharmony_ci       * ignore the rows of table 2.12 for line adjacency, line strip
2405bd8deadSopenharmony_ci         adjacency, triangle adjacency, and triangle strip adjacency.
2415bd8deadSopenharmony_ci       * ignore any references to geometry shaders.
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ciDependencies on EXT_gpu_shader4 and/or the flat shading functionality
2445bd8deadSopenharmony_ciintegrated into the core by OpenGL 3.0:
2455bd8deadSopenharmony_ci
2465bd8deadSopenharmony_ci    If neither EXT_gpu_shader4 or OpenGL 3.0 (or later) are supported,
2475bd8deadSopenharmony_ci    ignore the references to the <flat> qualifier in the shading
2485bd8deadSopenharmony_ci    language.
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ciDependencies on EXT_transform_feedback, NV_transform_feedback, and/or
2515bd8deadSopenharmony_cithe transform feedback functionality integrated into the core by OpenGL
2525bd8deadSopenharmony_ci3.0:
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci    Clarify the statement describing when transform feedback occurs
2555bd8deadSopenharmony_ci    (in section 2.18 of the OpenGL 3.1 specification) to read:
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    "The vertices are fed back after vertex color clamping, but before
2585bd8deadSopenharmony_ci    flatshading and clipping."
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    (The "flatshading and" phrase is newly clarifying.)
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ciDependencies on ARB_compatibility and OpenGL 3.1 (or later):
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci    If using OpenGL 3.1 (or later) and ARB_compatibility is not
2655bd8deadSopenharmony_ci    supported ignore all references to the following:
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci       * fixed function vertex processing,
2685bd8deadSopenharmony_ci       * primary and secondary vertex colors and related built-in
2695bd8deadSopenharmony_ci         varyings,
2705bd8deadSopenharmony_ci       * color-index mode,
2715bd8deadSopenharmony_ci       * shade mode, ShadeModel and the associated state,
2725bd8deadSopenharmony_ci       * quad primitives, the QUADS_FOLLOW_PROVOKING_VERTEX query, and
2735bd8deadSopenharmony_ci         the associated state, and
2745bd8deadSopenharmony_ci       * the rows in table 2.12 for independent quad, quad strip and
2755bd8deadSopenharmony_ci         single polygon.
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ciDependencies on OpenGL 3.1:
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci    When OpenGL 3.1 is supported make the following changes:
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci   Modify the last sentence of Section 3.5.1 "Basic Line Segment
2825bd8deadSopenharmony_ci   Rasterization" to read:
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci   "When the flat keyword is specified, no interpolation is performed,
2855bd8deadSopenharmony_ci   and varying outputs are taken from the corresponding generic
2865bd8deadSopenharmony_ci   attribute value of the provoking vertex corresponding to that
2875bd8deadSopenharmony_ci   primitive (see section 2.14.7)."
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci   Modify the sentence in Section 3.6.1 "Basic Polygon Rasterization"
2905bd8deadSopenharmony_ci   describing the <flat> keyword semantics to read:
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci   "When the flat keyword is specified, no interpolation is performed,
2935bd8deadSopenharmony_ci   and varying outputs are taken from the corresponding generic
2945bd8deadSopenharmony_ci   attribute value of the provoking vertex corresponding to that
2955bd8deadSopenharmony_ci   primitive (see section 2.14.7)."
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci   Modify the paragraph in Section 3.6.5 "Polygon Multisample
2985bd8deadSopenharmony_ci   Rasterization" describing the <noperspective> and <flat> qualifiers
2995bd8deadSopenharmony_ci   semantices to read:
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci   "When using a vertex shader, the <noperspective> and <flat>
3025bd8deadSopenharmony_ci   qualifiers affect how varying shader outputs are interpolated in the
3035bd8deadSopenharmony_ci   same fashion as described for basic polygon rasterization in section
3045bd8deadSopenharmony_ci   3.6.1"
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ciGLX Protocol
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci    A new GL rendering command is added. The following command is sent
3095bd8deadSopenharmony_ci    to the server as part of a glXRender request:
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci        ProvokingVertex
3125bd8deadSopenharmony_ci            2           8          rendering command length
3135bd8deadSopenharmony_ci            2           4227       rendering command opcode
3145bd8deadSopenharmony_ci            4           ENUM       provokeMode
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ciErrors
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    INVALID_ENUM is generated when ProvokingVertex is called with a
3195bd8deadSopenharmony_ci    <provokeMode> that is not either FIRST_VERTEX_CONVENTION or
3205bd8deadSopenharmony_ci    LAST_VERTEX_CONVENTION.
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ciNew State
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci(table 6.11, page 276) add the following entry:
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ciGet Value         Type  Get Command  Initial Value           Description       Sec     Attribute
3275bd8deadSopenharmony_ci----------------  ----  -----------  ----------------------  ----------------  ------  ---------
3285bd8deadSopenharmony_ciPROVOKING_VERTEX  Z2    GetIntegerv  LAST_VERTEX_CONVENTION  Provoking vertex  2.14.7  lighting
3295bd8deadSopenharmony_ci                                                                convention
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ciNew Implementation Dependent State
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci(table 6.36, page 301) add the following entry:
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ciGet Value                      Type  Get Command  Initial Value  Description        Sec     Attribute
3365bd8deadSopenharmony_ci-----------------------------  ----  -----------  -------------  -----------------  ------  ---------
3375bd8deadSopenharmony_ciQUADS_FOLLOW_PROVOKING_VERTEX  B     GetBooleanv  -              True if quad       2.14.7  -
3385bd8deadSopenharmony_ci                                                                 primitives follow
3395bd8deadSopenharmony_ci                                                                 provoking vertex
3405bd8deadSopenharmony_ci                                                                 convention
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ciNVIDIA Implementation Details
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci    GeForce 8 (G8x, G9x, GT1xx) and up GPUs report true for
3455bd8deadSopenharmony_ci    QUADS_FOLLOW_PROVOKING_VERTEX.
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    GeForce 6 and 7 (NV4x, G7x) GPUs report false for
3485bd8deadSopenharmony_ci    QUADS_FOLLOW_PROVOKING_VERTEX.
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ciIssues
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    1.  What should this extension be called?
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci        RESOLVED:  ARB_provoking_vertex
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci        The phrase "provoking vertex" is not used in the core OpenGL
3575bd8deadSopenharmony_ci        specification but it is the accepted jargon for the
3585bd8deadSopenharmony_ci        functionality in question. This is the ARB-ratified version of
3595bd8deadSopenharmony_ci        the EXT_provoking_vertext extension.
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    2.  How should quads be handled?
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci        RESOLVED:  Ideally, quadrilateral primitives (GL_QUADS and
3645bd8deadSopenharmony_ci        GL_QUAD_STRIP) would follow the provoking vertex mode.
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci        Other existing APIs with different flatshading conventions do
3675bd8deadSopenharmony_ci        not support quads.
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci        Rather than force support for both the first and last convention
3705bd8deadSopenharmony_ci        for quads (which no other API supports), instead this extension
3715bd8deadSopenharmony_ci        provides implementations the flexibility to advertise whether
3725bd8deadSopenharmony_ci        or not quads respect the provoking vertex or not.
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci        This resolution ensures more hardware vendors can support
3755bd8deadSopenharmony_ci        this extension.  Hardware vendors which support both OpenGL and
3765bd8deadSopenharmony_ci        Direct3D's provoking vertex conventions must have support for
3775bd8deadSopenharmony_ci        "first vertex" for triangles and lines because Direct3D demands
3785bd8deadSopenharmony_ci        these conventions.  Direct3D does not demand a convention for
3795bd8deadSopenharmony_ci        quads.  However every vendor supporting OpenGL can support the
3805bd8deadSopenharmony_ci        "last vertex" mode for quads.  Leaving the quad behavior up
3815bd8deadSopenharmony_ci        to the OpenGL implementation means hardware can simply always
3825bd8deadSopenharmony_ci        switch to the OpenGL quad behavior when emitting quads.
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci        See issue #12 for more details about how the
3855bd8deadSopenharmony_ci        implementation-dependent handling of quads is advertised.
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci    3.  How should the specification language be written for this
3885bd8deadSopenharmony_ci        extension?
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci        RESOLVED:  Update table 2.12 for all supported primitives.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci        The current language describes how points and lines are handled
3935bd8deadSopenharmony_ci        in prose but the behavior for triangles, quads, and polygons is
3945bd8deadSopenharmony_ci        specified in table 2.12.
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci        Put all the Begin/End batch types in a single table with two
3975bd8deadSopenharmony_ci        columns specifying the "first vertex convention" and "last vertex
3985bd8deadSopenharmony_ci        convention" provoking vertex modes respectively.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci        A unified table is less ambiguous than a combination of a table
4015bd8deadSopenharmony_ci        and prose.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    4.  What token names for the provoking vertex conventions should
4045bd8deadSopenharmony_ci        be used?
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci        RESOLVED:  GL_FIRST_VERTEX_CONVENTION and
4075bd8deadSopenharmony_ci        GL_LAST_VERTEX_CONVENTION (the initial state, consistent
4085bd8deadSopenharmony_ci        with OpenGL's unextended operation).
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ci        The word "convention" is used because (see issue #2), the "first
4115bd8deadSopenharmony_ci        vertex" or "last vertex" rules are not iron-clad as they may or
4125bd8deadSopenharmony_ci        may do not apply to quads.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci        The provoking vertex behavior for polygons and triangle fans
4155bd8deadSopenharmony_ci        also isn't strictly first or last vertex:  Polygons always use
4165bd8deadSopenharmony_ci        the first vertex (no matter the provoking vertex convention).
4175bd8deadSopenharmony_ci        Triangle fans don't really use the first vertex (the spoke vertex)
4185bd8deadSopenharmony_ci        when using the "first vertex" provoking vertex rule; see issue #7.
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    5.  IRIS GL had a provoking vertex convention for polygons where the
4215bd8deadSopenharmony_ci        last vertex of a polygon primitive determined the flat shaded
4225bd8deadSopenharmony_ci        color of the polygon.  Should we support this convention?
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci        RESOLVED:  No.
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci        Interesting IRIS GL applications relying on this convention
4275bd8deadSopenharmony_ci        are assuredly non-existent at this point.  This convention
4285bd8deadSopenharmony_ci        also requires waiting until all the vertices for a polygon
4295bd8deadSopenharmony_ci        (which OpenGL does not bound) are specified before the polygon
4305bd8deadSopenharmony_ci        can begin being rasterized.  The IRIS GL convention was dubious
4315bd8deadSopenharmony_ci        for this reason and OpenGL's designers were correct to abandon
4325bd8deadSopenharmony_ci        IRIS GL's polygon provoking vertex convention.
4335bd8deadSopenharmony_ci
4345bd8deadSopenharmony_ci    6.  How should line loops behave?
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci        RESOLVED:  Line loops in GL_FIRST_VERTEX_CONVENTION mode
4375bd8deadSopenharmony_ci        should behave as though it were a line strip with the first
4385bd8deadSopenharmony_ci        vertex repeated at the end.  In other words, the first vertex
4395bd8deadSopenharmony_ci        of the line loop provokes the color for the line primitive that
4405bd8deadSopenharmony_ci        closes the line loop.
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci        Direct3D does not support line loops.
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    7.  How are triangle fans handled?
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci        RESOLVED:  The first vertex of a triangle fan is the spoke vertex.
4475bd8deadSopenharmony_ci        Triangle fans in GL_FIRST_VERTEX_CONVENTION mode should use
4485bd8deadSopenharmony_ci        the first non-spoke vertex of the primitive as the provoking
4495bd8deadSopenharmony_ci        vertex.  In other words, the spoke vertex is never the provoking
4505bd8deadSopenharmony_ci        vertex (in either convention).
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci        The rationale for this is to match DirectX 9's triangle
4535bd8deadSopenharmony_ci        fan behavior.  The rationale for the DirectX 9 behavior is
4545bd8deadSopenharmony_ci        (presumably) that if the spoke vertex was considered the "first
4555bd8deadSopenharmony_ci        vertex" of every primitive in a triangle fan, every flat shaded
4565bd8deadSopenharmony_ci        primitive in a triangle fan would necessarily have the spoke
4575bd8deadSopenharmony_ci        vertex's color, which isn't very interesting.
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci        (DirectX 10 does not support triangle fans.)
4605bd8deadSopenharmony_ci
4615bd8deadSopenharmony_ci    8.  How does the provoking vertex convention affect primitives
4625bd8deadSopenharmony_ci        generated by a geometry shader?
4635bd8deadSopenharmony_ci
4645bd8deadSopenharmony_ci        RESOLVED:  The provoking vertex convention affects primitives
4655bd8deadSopenharmony_ci        whether they are generated by geometry shaders or conventional
4665bd8deadSopenharmony_ci        (non-geometry shader) primitive assembly.
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci        Geometry shaders only generate point, line strips, and triangle
4695bd8deadSopenharmony_ci        strips (not line loops, triangle fans, polygons, or quads).
4705bd8deadSopenharmony_ci        (So the GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION is
4715bd8deadSopenharmony_ci        irrelevant when a geometry program or shader is active.)
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci        This makes the supporting the first and last vertex conventions
4745bd8deadSopenharmony_ci        for primitives generated by geometry shaders "simple" because in
4755bd8deadSopenharmony_ci        the points, line strip, and triangle strip cases, the convention
4765bd8deadSopenharmony_ci        really is to use either first or last vertex to define the
4775bd8deadSopenharmony_ci        provoking vertex (no caveats).
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci        There's no special specification language to support the fact that
4805bd8deadSopenharmony_ci        the provoking vertex convention applies to primitives generated
4815bd8deadSopenharmony_ci        by geometry shaders because flat shading behavior is described
4825bd8deadSopenharmony_ci        in Chapter 3's rasterization discussion which is all subsequent
4835bd8deadSopenharmony_ci        to the geometry shader processing inserted into Chapter 2.
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci        DirectX 10 geometry shaders can output flat attributes according
4865bd8deadSopenharmony_ci        to Direct3D's "first vertex provokes" convention for line and
4875bd8deadSopenharmony_ci        triangle output primitives from a geometry shader.  So matching
4885bd8deadSopenharmony_ci        the DirectX 10 geometry shader behavior for flat shading requires
4895bd8deadSopenharmony_ci        setting the provoking vertex to GL_FIRST_VERTEX_CONVENTION.
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci        This said, the OpenGL default convention of "last vertex" for the
4925bd8deadSopenharmony_ci        provoking vertex tends to be more useful for geometry shaders.
4935bd8deadSopenharmony_ci        By deferring the computation of the flat shaded color to the
4945bd8deadSopenharmony_ci        last vertex of every primitive, that tends to give the geometry
4955bd8deadSopenharmony_ci        shader compiler the maximum allowance for scheduling computation
4965bd8deadSopenharmony_ci        and texturing operations required to compute the flat shaded
4975bd8deadSopenharmony_ci        color as long as possible (that is, until the last vertex of
4985bd8deadSopenharmony_ci        the primitive).
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci    9.  Should there be an OPTION or #pragma for geometry shader assembly
5015bd8deadSopenharmony_ci        and GLSL respectively to request the specific provoking vertex
5025bd8deadSopenharmony_ci        convention for the shader?
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci        RESOLVED:  No.
5055bd8deadSopenharmony_ci
5065bd8deadSopenharmony_ci        The provoking vertex is context state that doesn't belong within
5075bd8deadSopenharmony_ci        a shader as a pragma anymore than the stencil state belongs
5085bd8deadSopenharmony_ci        within the shader.  Overriding context state based on a pragma
5095bd8deadSopenharmony_ci        in a shader introduces unfortunate validation interactions that
5105bd8deadSopenharmony_ci        will slow down shader binds.
5115bd8deadSopenharmony_ci
5125bd8deadSopenharmony_ci        Geometry shaders written for DirectX 10 and using flat attributes
5135bd8deadSopenharmony_ci        expect the "first vertex" provoking vertex convention but the
5145bd8deadSopenharmony_ci        application is better off specifying the proper provoking vertex
5155bd8deadSopenharmony_ci        convention for shaders just as is done with other context state.
5165bd8deadSopenharmony_ci
5175bd8deadSopenharmony_ci        TransGaming supports this resolution to not support a pragma.
5185bd8deadSopenharmony_ci
5195bd8deadSopenharmony_ci    10. How do geometry shader input primitives interact with this
5205bd8deadSopenharmony_ci        extension?
5215bd8deadSopenharmony_ci
5225bd8deadSopenharmony_ci        RESOLVED:  Table 2.12 includes the new primitives types
5235bd8deadSopenharmony_ci        introduced by geometry shaders (GL_LINES_ADJACENCY_ARB,
5245bd8deadSopenharmony_ci        GL_LINE_STRIP_ADJACENCY_ARB, GL_TRIANGLES_ADJACENCY_ARB, and
5255bd8deadSopenharmony_ci        GL_TRIANGLE_STRIP_ADJACENCY_ARB).  However the entries for these
5265bd8deadSopenharmony_ci        primitive types are only relevant when these new primitive types
5275bd8deadSopenharmony_ci        are used with NO geometry shader enabled.
5285bd8deadSopenharmony_ci
5295bd8deadSopenharmony_ci        When a geometry shader is enabled, the only primitive output types
5305bd8deadSopenharmony_ci        are points, line strips, and triangle strips.
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci    11. To what attribute set should the provoking vertex belong?
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci        RESOLVED:  Lighting (GL_LIGHTING_BIT).
5355bd8deadSopenharmony_ci
5365bd8deadSopenharmony_ci        This is because the provoking vertex bit is described in the
5375bd8deadSopenharmony_ci        same context as the shade model (GL_SHADE_MODEL) setting, and
5385bd8deadSopenharmony_ci        the shade model state is part of the lighting attribute set.
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci    12. How should the allowance for handling quadrilateral primitives
5415bd8deadSopenharmony_ci        be advertised?
5425bd8deadSopenharmony_ci
5435bd8deadSopenharmony_ci        RESOLVED:  Because this extension is intended to facilitate
5445bd8deadSopenharmony_ci        supporting Direct3D content that depends on the Direct3D's
5455bd8deadSopenharmony_ci        provoking vertex convention yet Direct3D does not support quad
5465bd8deadSopenharmony_ci        primitives (as OpenGL provides with GL_QUAD_STRIP and GL_QUADS),
5475bd8deadSopenharmony_ci        the particular provoking vertex behavior of quads is not crucial
5485bd8deadSopenharmony_ci        to this extension's intended application.
5495bd8deadSopenharmony_ci
5505bd8deadSopenharmony_ci        In the interest of making this extension's functionality for
5515bd8deadSopenharmony_ci        triangle and line primitives broadly available (the primitives
5525bd8deadSopenharmony_ci        Direct3D does support with a first vertex provoking vertex
5535bd8deadSopenharmony_ci        convention), this extension does not mandate a single uniform
5545bd8deadSopenharmony_ci        behavior for quad primitives.  Mandating a particular behavior
5555bd8deadSopenharmony_ci        for quad primitives would, for some implementations, encumber the
5565bd8deadSopenharmony_ci        performance of this extension in the non-quad case or make this
5575bd8deadSopenharmony_ci        implementation of this extension needlessly complex to implement.
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci        Instead the GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
5605bd8deadSopenharmony_ci        implementation-dependent boolean indicates whether or not quads
5615bd8deadSopenharmony_ci        (generated by GL_QUADS or GL_QUAD_STRIP) should abide by the
5625bd8deadSopenharmony_ci        provoking vertex convention or not.
5635bd8deadSopenharmony_ci
5645bd8deadSopenharmony_ci        Whether or not the GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
5655bd8deadSopenharmony_ci        state is true or false, the provoking vertex behavior of quads
5665bd8deadSopenharmony_ci        is well-defined in either case.
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci        The recommended, though implementation-dependent, value for
5695bd8deadSopenharmony_ci        GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION is true because
5705bd8deadSopenharmony_ci        this means quads, will like lines and triangles, follow the
5715bd8deadSopenharmony_ci        GL_PROVOKING_VERTEX state as indicated.
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci    13. How does the provoking vertex state interact with primitive
5745bd8deadSopenharmony_ci        restart?
5755bd8deadSopenharmony_ci
5765bd8deadSopenharmony_ci        RESOLVED:  Orthogonally so no specific specification language
5775bd8deadSopenharmony_ci        describing the interaction is required.
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ci        Specifically a primitive restart acts as a glEnd/glBegin
5805bd8deadSopenharmony_ci        sequence so it restarts the primitive numbering to 1 for the
5815bd8deadSopenharmony_ci        vertex immediately following the restart index.
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci    14. Should the provoking vertex behavior apply to both the primary
5845bd8deadSopenharmony_ci        and secondary color?
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci        RESOLVED:  Yes, the provoking vertex decides both the primary and
5875bd8deadSopenharmony_ci        secondary color of a flat-shaded primitive.  That's consistent
5885bd8deadSopenharmony_ci        with Direct3D's provoking vertex convention as well as OpenGL's
5895bd8deadSopenharmony_ci        current behavior.
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ci    15. Should the provoking vertex behavior be specified with a
5925bd8deadSopenharmony_ci        glEnable/glDisable token instead of glProvokingVertex?
5935bd8deadSopenharmony_ci
5945bd8deadSopenharmony_ci        RESOLVED:  The provoking vertex API is closely related
5955bd8deadSopenharmony_ci        to glShadeModel which uses an enumerated mode rather than
5965bd8deadSopenharmony_ci        glEnable/glDisable to specify flat or smooth shading so the API
5975bd8deadSopenharmony_ci        mimics the glShadeModel approach.
5985bd8deadSopenharmony_ci
5995bd8deadSopenharmony_ci        This results in a fairly readable API usage that is more easily
6005bd8deadSopenharmony_ci        groaked by unfamiliar programmers:
6015bd8deadSopenharmony_ci
6025bd8deadSopenharmony_ci            glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci        instead of:
6055bd8deadSopenharmony_ci
6065bd8deadSopenharmony_ci             glEnable(GL_FIRST_VERTEX_CONVENTION);
6075bd8deadSopenharmony_ci
6085bd8deadSopenharmony_ci        It is also not clear that the provoking vertex convention is
6095bd8deadSopenharmony_ci        really a single enable.  The convention behaves differently
6105bd8deadSopenharmony_ci        depending on the primitive type.  For example, GL_POLYGON always
6115bd8deadSopenharmony_ci        uses the first vertex as the provoking vertex regardless of the
6125bd8deadSopenharmony_ci        provoking vertex state.
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci    16. Does the OpenGL Shading Language (GLSL) 1.30 "flat" varying
6155bd8deadSopenharmony_ci        qualifier respect the provoking vertex state?
6165bd8deadSopenharmony_ci
6175bd8deadSopenharmony_ci        RESOLVED:  Yes.
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci        The GLSL 1.30 specification says "This variable [qualified as
6205bd8deadSopenharmony_ci        flat] will come from a single provoking vertex, as described by
6215bd8deadSopenharmony_ci        the OpenGL Graphics System Specification."  This extension amends
6225bd8deadSopenharmony_ci        how the provoking vertex is described so no GLSL specification
6235bd8deadSopenharmony_ci        update is required.  This does imply that user-declared varyings
6245bd8deadSopenharmony_ci        in a GLSL shader declared with "flat" will have the provoking
6255bd8deadSopenharmony_ci        vertex convention applied to determine their value.
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci    17. How does the provoking vertex apply to Direct3D 10?
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci        RESOLVED:  Direct3D 10 has deprecated the D3DSHADEMODE state for
6305bd8deadSopenharmony_ci        controlling flat or smooth (Gouraud) shading.  However there is
6315bd8deadSopenharmony_ci        still the concept of a provoking vertex (called the "leading
6325bd8deadSopenharmony_ci        vertex" by Direct3D 10) which still corresponds to this
6335bd8deadSopenharmony_ci        extension's "first vertex" convention.
6345bd8deadSopenharmony_ci
6355bd8deadSopenharmony_ci        Use of the leading (provoking) vertex for constant (flat)
6365bd8deadSopenharmony_ci        interpolation is indicated by Direct3D 10's "nointerpolation"
6375bd8deadSopenharmony_ci        variable storage class (sometimes called an interpolation
6385bd8deadSopenharmony_ci        modifier).
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci    18. Does the NV_gpu_program4 "FLAT" attribute modifier respect the
6415bd8deadSopenharmony_ci        provoking vertex state?
6425bd8deadSopenharmony_ci
6435bd8deadSopenharmony_ci        RESOLVED:  Yes.  NVIDIA's NV_gpu_program4 extension, describing
6445bd8deadSopenharmony_ci        an OpenGL assembly for Shader Model 4.0, allows a FLAT modifier
6455bd8deadSopenharmony_ci        to be specified for fragment program inputs.  The NV_gpu_program4
6465bd8deadSopenharmony_ci        specification says "If an attribute is flat-shaded, it will be
6475bd8deadSopenharmony_ci        taken from the output attribute of the provoking vertex of the
6485bd8deadSopenharmony_ci        primitive using the same data type." This extension amends
6495bd8deadSopenharmony_ci        how the provoking vertex is described so no NV_gpu_program4
6505bd8deadSopenharmony_ci        specification update is required.
6515bd8deadSopenharmony_ci
6525bd8deadSopenharmony_ci    19. How does this extension interact with transform feedback?
6535bd8deadSopenharmony_ci
6545bd8deadSopenharmony_ci        RESOLVED:  Attribute components written out by transform feedback
6555bd8deadSopenharmony_ci        are NOT affected by the flatshading or provoking vertex state.
6565bd8deadSopenharmony_ci
6575bd8deadSopenharmony_ci        While this specification is written against OpenGL 2.1, transform
6585bd8deadSopenharmony_ci        feedback was made core functionality with OpenGL 3.0 and then
6595bd8deadSopenharmony_ci        the order of the transform feedback was moved in the OpenGL
6605bd8deadSopenharmony_ci        3.1 specification.  Therefore the subsequent discussion uses
6615bd8deadSopenharmony_ci        the more recent 3.1 sectioning.
6625bd8deadSopenharmony_ci
6635bd8deadSopenharmony_ci        Specifically the OpenGL 3.1 specification (section 2.18: Transform
6645bd8deadSopenharmony_ci        Feedback) says "The vertices are fed back after vertex color
6655bd8deadSopenharmony_ci        clamping, but before clipping."
6665bd8deadSopenharmony_ci
6675bd8deadSopenharmony_ci        This statement is unclear because flatshading (section 2.13.7:
6685bd8deadSopenharmony_ci        Flatshading) happens inbetween vertex color clamping (section
6695bd8deadSopenharmony_ci        2.13.6: Clamping or Masking) and primitive clipping (section 2.20:
6705bd8deadSopenharmony_ci        Primitive Clipping).
6715bd8deadSopenharmony_ci
6725bd8deadSopenharmony_ci        Base on this issue the sentence is clarified to read: "The
6735bd8deadSopenharmony_ci        vertices are fed back after vertex color clamping, but before
6745bd8deadSopenharmony_ci        [flatshading and] clipping."
6755bd8deadSopenharmony_ci
6765bd8deadSopenharmony_ci        For reference, the original EXT_transform_feedback extension has
6775bd8deadSopenharmony_ci        this same language ("The vertices are fed back after vertex color
6785bd8deadSopenharmony_ci        clamping, but before clipping.") but follows that sentence with:
6795bd8deadSopenharmony_ci        "If a geometry shader is active, the vertices recorded are those
6805bd8deadSopenharmony_ci        emitted from the geometry shader."  Technically geometry shading
6815bd8deadSopenharmony_ci        takes place prior to even vertex color clamping.
6825bd8deadSopenharmony_ci
6835bd8deadSopenharmony_ci        Clearly flat shading needs to happen prior to clipping so that
6845bd8deadSopenharmony_ci        clipped vertices can share the flat shaded attributes of the
6855bd8deadSopenharmony_ci        primitive prior to any potential clipping.
6865bd8deadSopenharmony_ci
6875bd8deadSopenharmony_ci        This resolution is consistent with DirectX 10's behavior.
6885bd8deadSopenharmony_ci        Technically, DirectX 10 says that vertices output through
6895bd8deadSopenharmony_ci        transform feedback (which DirectX 10 calls "stream output")
6905bd8deadSopenharmony_ci        only have to be defined for constant attributes of the primitive's
6915bd8deadSopenharmony_ci        leading vertex (constant attributes are those that OpenGL would
6925bd8deadSopenharmony_ci        call flatshaded).  Other constant attributes for non-leading
6935bd8deadSopenharmony_ci        vertices may be undefined.  Leaving such constant attributes
6945bd8deadSopenharmony_ci        undefined is undesirable, particularly given how OpenGL operates.
6955bd8deadSopenharmony_ci        It is well-defined and more useful to simply output the value
6965bd8deadSopenharmony_ci        of the vertex's attribute prior to any flatshading.  This is
6975bd8deadSopenharmony_ci        particularly desirable for OpenGL because with this extension
6985bd8deadSopenharmony_ci        (and even prior to supporting this extension), the provoking
6995bd8deadSopenharmony_ci        vertex is not always the leading vertex.
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci        To clarify further, while this resolution is consistent with
7025bd8deadSopenharmony_ci        DirectX 10, an OpenGL implementation that supports transform
7035bd8deadSopenharmony_ci        feedback has no undefined behavior specified.  The simplest way
7045bd8deadSopenharmony_ci        to describe what happens is that attribute components written
7055bd8deadSopenharmony_ci        out by transform feedback are the attribute component values
7065bd8deadSopenharmony_ci        of vertices AFTER (optional) geometry shading and vertex color
7075bd8deadSopenharmony_ci        clamping but PRIOR to flatshading and primitive clipping.
7085bd8deadSopenharmony_ci
7095bd8deadSopenharmony_ci    20. Why don't the new tokens and entry points in this extension have
7105bd8deadSopenharmony_ci        "ARB" suffixes like other ARB extensions?
7115bd8deadSopenharmony_ci
7125bd8deadSopenharmony_ci        RESOLVED: Unlike most ARB extensions, this is a strict subset of
7135bd8deadSopenharmony_ci        functionality already approved in OpenGL 3.2. This extension
7145bd8deadSopenharmony_ci        exists only to support that functionality on older hardware that
7155bd8deadSopenharmony_ci        cannot implement a full OpenGL 3.x driver. Since there are no
7165bd8deadSopenharmony_ci        possible behavior changes between the ARB extension and core
7175bd8deadSopenharmony_ci        features, source code compatibility is improved by not using
7185bd8deadSopenharmony_ci        suffixes on the extension.
7195bd8deadSopenharmony_ci
7205bd8deadSopenharmony_ciRevision History
7215bd8deadSopenharmony_ci
7225bd8deadSopenharmony_ci    Rev.    Date    Author     Changes
7235bd8deadSopenharmony_ci    ----  -------- ---------  ---------------------------------------------
7245bd8deadSopenharmony_ci      1   5/19/09  dgkoch     copy & rename from EXT_provoking_vertex v12
7255bd8deadSopenharmony_ci      2   6/26/09  dgkoch     resync with GL 3.2. reorder edits so they
7265bd8deadSopenharmony_ci                              fit better with ARB_compatibility. update
7275bd8deadSopenharmony_ci                              dependencies with GL 3.1, 3.2 and
7285bd8deadSopenharmony_ci                              ARB_compatibility.
7295bd8deadSopenharmony_ci      3   8/02/09  Jon Leech  Reformat to 80 columns and assign ARB
7305bd8deadSopenharmony_ci                              extension number.
731