15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_transform_feedback3
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_transform_feedback3
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci    
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Barthold Lichtenbelt, NVIDIA
165bd8deadSopenharmony_ci    Bill Licea-Kane, AMD
175bd8deadSopenharmony_ci    Bruce Merry, ARM
185bd8deadSopenharmony_ci    Graham Sellers, AMD
195bd8deadSopenharmony_ci    Greg Roth, NVIDIA
205bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
215bd8deadSopenharmony_ci    Nick Haemel, AMD
225bd8deadSopenharmony_ci    Pierre Boudier, AMD
235bd8deadSopenharmony_ci    Piers Daniell, NVIDIA
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciNotice
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    Copyright (c) 2010-2013 The Khronos Group Inc. Copyright terms at
285bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciSpecification Update Policy
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
335bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
345bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
355bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
365bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
375bd8deadSopenharmony_ci    described in more detail at
385bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciStatus
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    Complete. Approved by the ARB at the 2010/01/22 F2F meeting.
435bd8deadSopenharmony_ci    Approved by the Khronos Board of Promoters on March 10, 2010.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ciVersion
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    Last Modified Date:         03/23/2010
485bd8deadSopenharmony_ci    Revision:                   12
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciNumber
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    ARB Extension #94
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciDependencies
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    EXT_transform_feedback, NV_transform_feedback, or OpenGL 3.0 is required.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    OpenGL 2.0 is required.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension interacts with EXT_transform_feedback,
615bd8deadSopenharmony_ci    NV_transform_feedback, and NV_transform_feedback2.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    This extension interacts with ARB_gpu_shader5 and NV_gpu_program5.
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    This extension is written against the OpenGL 3.2 specification (Core 
665bd8deadSopenharmony_ci    Profile).
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    This extension builds up and is written against various language in the
695bd8deadSopenharmony_ci    EXT_transform_feedback and NV_transform_feedback specifications.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciOverview
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    This extension further extends the transform feedback capabilities
745bd8deadSopenharmony_ci    provided by the EXT_transform_feedback, NV_transform_feedback, and
755bd8deadSopenharmony_ci    NV_transform_feedback2 extensions.  Those extensions provided a new
765bd8deadSopenharmony_ci    transform feedback mode, where selected vertex attributes can be recorded
775bd8deadSopenharmony_ci    to a buffer object for each primitive processed by the GL.
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    This extension provides increased flexibility in how vertex attributes can
805bd8deadSopenharmony_ci    be written to buffer objects.  Previous extensions allowed applications to
815bd8deadSopenharmony_ci    record a set of attributes interleaved into a single buffer object
825bd8deadSopenharmony_ci    (interleaved mode) or to record into multiple objects, but with only a
835bd8deadSopenharmony_ci    single attribute per buffer (separate mode).  This extension extends
845bd8deadSopenharmony_ci    interleaved mode to write into multiple buffers, with multiple attributes
855bd8deadSopenharmony_ci    per buffer.  This capability is supported for all three styles of
865bd8deadSopenharmony_ci    transform feedback:
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci      - "EXT"-style GLSL transform feedback (EXT_transform_feedback), where a
895bd8deadSopenharmony_ci         list of varyings is provided prior to linking a program object and is
905bd8deadSopenharmony_ci         used whenever that program object is used.
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci      - "NV"-style GLSL transform feedback (NV_transform_feedback), where
935bd8deadSopenharmony_ci        "locations" of active varyings are queried after linking and are then
945bd8deadSopenharmony_ci        passed to a function that sets the active transform feedback varyings
955bd8deadSopenharmony_ci        for the program object.  Unlike the "EXT"-style mode, the set of
965bd8deadSopenharmony_ci        varyings to capture can be changed without relinking.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci      - Transform feedback for fixed-function or assembly vertex/geometry
995bd8deadSopenharmony_ci        shaders (NV_transform_feedback), where applications specify a set of
1005bd8deadSopenharmony_ci        canonical attribute enums/numbers to capture.
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    Additionally, this extension adds new support for multiple separate
1035bd8deadSopenharmony_ci    vertex streams.  New geometry shader functionality provided by the
1045bd8deadSopenharmony_ci    ARB_gpu_shader5 and NV_gpu_program5 extensions allows geometry shaders
1055bd8deadSopenharmony_ci    to direct each vertex arbitrarily at a specified vertex stream.  For
1065bd8deadSopenharmony_ci    example, a geometry program might write each "regular" vertex it emits
1075bd8deadSopenharmony_ci    to one vertex stream while writing some per-primitive data it computes
1085bd8deadSopenharmony_ci    to a second vertex stream.  This extension allows applications to
1095bd8deadSopenharmony_ci    choose a vertex stream for each buffer object it writes to, and allows
1105bd8deadSopenharmony_ci    the vertices written to each vertex stream to be recorded in separate
1115bd8deadSopenharmony_ci    buffer objects.  Only one stream may be selected for rasterization,
1125bd8deadSopenharmony_ci    and in the initial implementation, the geometry shader output topology
1135bd8deadSopenharmony_ci    must be POINTS if multiple streams are used.  When geometry shaders
1145bd8deadSopenharmony_ci    are not used, or when an old geometry shader not writing multiple
1155bd8deadSopenharmony_ci    streams is used, all vertices produced by the GL are directed at the
1165bd8deadSopenharmony_ci    stream numbered zero.  The set of transform feedback-related query
1175bd8deadSopenharmony_ci    targets is extended to accommodate multiple vertex streams, so it is
1185bd8deadSopenharmony_ci    possible to count the number of processed and recorded primitives for
1195bd8deadSopenharmony_ci    each stream separately.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ciIP Status
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    No known IP claims.
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ciNew Procedures and Functions
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    void DrawTransformFeedbackStream(enum mode, uint id, uint stream);
1285bd8deadSopenharmony_ci    void BeginQueryIndexed(enum target, uint index, uint id);
1295bd8deadSopenharmony_ci    void EndQueryIndexed(enum target, uint index);
1305bd8deadSopenharmony_ci    void GetQueryIndexediv(enum target, uint index, enum pname, int *params);
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ciNew Tokens
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
1355bd8deadSopenharmony_ci    and GetFloatv:
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci      MAX_TRANSFORM_FEEDBACK_BUFFERS                    0x8E70
1385bd8deadSopenharmony_ci      MAX_VERTEX_STREAMS                                0x8E71
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 3.2 Specification (OpenGL Operation)
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ci    (Modify the error behavior of transform feedback buffer binding APIs to
1435bd8deadSopenharmony_ci     treat the new constant MAX_TRANSFORM_FEEDBACK_BUFFERS as the number of 
1445bd8deadSopenharmony_ci     binding points.)
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    Buffer objects are made to be targets of transform feedback by calling one
1475bd8deadSopenharmony_ci    of the commands
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci      void BindBufferRange(enum target, uint index, uint buffer,
1505bd8deadSopenharmony_ci                              intptr offset, sizeiptr size);
1515bd8deadSopenharmony_ci      void BindBufferBase(enum target, uint index, uint buffer);
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    ...  The error INVALID_VALUE is generated if <index> is greater than or
1545bd8deadSopenharmony_ci    equal to the value of MAX_TRANSFORM_FEEDBACK_BUFFERS.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    ...
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    Transform feedback can operate using one of two buffer modes.  In
1595bd8deadSopenharmony_ci    interleaved mode, the values of one or more varying variables written by a
1605bd8deadSopenharmony_ci    vertex or geometry shader are written, interleaved, into the buffer
1615bd8deadSopenharmony_ci    objects bound to one or more transform feedback binding points.  The list
1625bd8deadSopenharmony_ci    of varyings provided for capture in interleaved mode may include special
1635bd8deadSopenharmony_ci    separator values, which can be used to direct subsequent varyings to the
1645bd8deadSopenharmony_ci    next binding point.  Each non-separator varying is written to the binding
1655bd8deadSopenharmony_ci    point numbered <n>, where <n> is the number of separator values preceding
1665bd8deadSopenharmony_ci    it in the list.  If more than one varying variable is written to a buffer
1675bd8deadSopenharmony_ci    object, they will be recorded in the order specified by
1685bd8deadSopenharmony_ci    TransformFeedbackVaryings (section 2.11.6).  In separate mode, the first
1695bd8deadSopenharmony_ci    varying variable specified by TransformFeedbackVaryings is written to
1705bd8deadSopenharmony_ci    the first transform feedback binding point; subsequent varying variables
1715bd8deadSopenharmony_ci    are written to the subsequent transform feedback binding points.
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    When using a geometry shader or program that writes vertices to multiple
1745bd8deadSopenharmony_ci    vertex streams, each vertex emitted may trigger a new primitive in the
1755bd8deadSopenharmony_ci    vertex stream to which it was emitted.  If transform feedback is active,
1765bd8deadSopenharmony_ci    the varyings of the primitive are written to a transform feedback binding
1775bd8deadSopenharmony_ci    point if and only if the varyings directed at that binding point belong to
1785bd8deadSopenharmony_ci    the vertex stream in question.  All varyings assigned to a given binding
1795bd8deadSopenharmony_ci    point are required to come from a single vertex stream.
1805bd8deadSopenharmony_ci    
1815bd8deadSopenharmony_ci    ...
1825bd8deadSopenharmony_ci    
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    (Modify Section 2.14, Asynchronous Queries)
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    After the description of BeginQuery, p.91:
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    Query targets also support multiple indexed queries. A query object may be
1895bd8deadSopenharmony_ci    created and made active on an indexed query target by calling:
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci        void BeginQueryIndexed(enum target, uint index, uint id);
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    <target> indicates the type of query to be performed as in BeginQuery.
1945bd8deadSopenharmony_ci    <index> is the index of the query and must be between 0 and a <target>-
1955bd8deadSopenharmony_ci    specific maximum. If <index> is outside of this range, BeginQueryIndexed will
1965bd8deadSopenharmony_ci    generate the INVALID_VALUE error. The number of indexed queries supported by
1975bd8deadSopenharmony_ci    specific targets is one, unless indicated otherwise in following sections.
1985bd8deadSopenharmony_ci    Calling BeginQuery is equivalent to calling BeginQueryIndexed with <index>
1995bd8deadSopenharmony_ci    set to zero.
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    After the description of EndQuery, p.91:
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    The command
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci        void EndQueryIndexed(enum target, uint index);
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    may be used to mark the end of the query currently active at index <index>
2085bd8deadSopenharmony_ci    of <target>, and must be between zero and the <target>-specific maximum.
2095bd8deadSopenharmony_ci    If <index> is outside of this range, EndQuery will generated the INVALID_VALUE
2105bd8deadSopenharmony_ci    error. Calling EndQuery is equivalent to calling EndQueryIndexed with
2115bd8deadSopenharmony_ci    <index> set to zero.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    (Modify Section 2.17, Primitive Queries.  The only substantial change is
2145bd8deadSopenharmony_ci    to modify language to reflect that we have primitive counters for each
2155bd8deadSopenharmony_ci    vertex stream.)
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    Primitive queries use query objects to track the number of primitives in
2185bd8deadSopenharmony_ci    each vertex stream that are generated by the GL and the number of
2195bd8deadSopenharmony_ci    primitives in each vertex stream that are written to buffer objects in
2205bd8deadSopenharmony_ci    transform feedback mode.
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    When BeginQueryIndexed is called with a <target> of PRIMITIVES_GENERATED,
2235bd8deadSopenharmony_ci    the primitives generated count maintained by the GL for the vertex stream
2245bd8deadSopenharmony_ci    <index> is set to zero. There is a separate query counter for each stream.
2255bd8deadSopenharmony_ci    The number of vertex streams is given by the value of the implementation-
2265bd8deadSopenharmony_ci    dependent constant MAX_VERTEX_STREAMS. If <index> is not an integer in the
2275bd8deadSopenharmony_ci    range zero to the value of MAX_VERTEX_STREAMS minus one, the error
2285bd8deadSopenharmony_ci    INVALID_VALUE is generated. When a generated primitive query for a vertex
2295bd8deadSopenharmony_ci    stream is active, the primitives-generated count is incremented every time
2305bd8deadSopenharmony_ci    a primitive emitted to that stream reaches the Discarding Rasterization
2315bd8deadSopenharmony_ci    stage (see Section 3.x) right before rasterization. This counter is
2325bd8deadSopenharmony_ci    incremented whether or not transform feedback is active. This counter counts
2335bd8deadSopenharmony_ci    the number of primitives emitted by a geometry shader, if active, possibly
2345bd8deadSopenharmony_ci    further tessellated into separate primitives during the transform feedback
2355bd8deadSopenharmony_ci    stage, if active.
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci    When BeginQueryIndexed is called with a <target> of
2385bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, the transform feedback primitives
2395bd8deadSopenharmony_ci    written count maintained by the GL for vertex stream <index> is set to zero.
2405bd8deadSopenharmony_ci    There is a separate query and counter for each vertex stream. If <index> is
2415bd8deadSopenharmony_ci    not an integer in the range zero to the value of MAX_VERTEX_STREAMS minus
2425bd8deadSopenharmony_ci    one, the error INVALID_VALUE is generated. When a transform feedback
2435bd8deadSopenharmony_ci    primitives written query for a vertex stream is active, the counter for that
2445bd8deadSopenharmony_ci    vertex stream is incremented every time the vertices of a primitive written
2455bd8deadSopenharmony_ci    to that stream are recorded into one or more buffer objects. If transform
2465bd8deadSopenharmony_ci    feedback is not active or if a primitive to be recorded does not fit in a
2475bd8deadSopenharmony_ci    buffer object, the counter is not incremented.
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    These two types of queries can be used together to determine if all
2505bd8deadSopenharmony_ci    primitives in a given vertex stream have been written to the bound
2515bd8deadSopenharmony_ci    feedback buffers; if both queries are run simultaneously and the query
2525bd8deadSopenharmony_ci    results are equal, all primitives have been written to the buffer(s).  If
2535bd8deadSopenharmony_ci    the number of primitives written is less than the number of primitives
2545bd8deadSopenharmony_ci    generated, one or more buffers overflowed.
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    (Modify Section 2.11.6 "Varying Variables", p. 71.)
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci    Each program object can specify a set of one or more vertex or geometry
2605bd8deadSopenharmony_ci    shader output variables to be recorded in transform feedback mode (see
2615bd8deadSopenharmony_ci    section 2.16). When a geometry shader is active (see section 2.12),
2625bd8deadSopenharmony_ci    transform feedback records the values of the selected geometry shader
2635bd8deadSopenharmony_ci    output variables from the emitted vertices. Otherwise, the values of the
2645bd8deadSopenharmony_ci    selected vertex shader output variables are recorded. The values to record
2655bd8deadSopenharmony_ci    are specified with the command
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci      void TransformFeedbackVaryings(uint program, sizei count,
2685bd8deadSopenharmony_ci                                     const char **varyings, 
2695bd8deadSopenharmony_ci                                     enum bufferMode)
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    <program> specifies the program object. <count> specifies the number of
2725bd8deadSopenharmony_ci    varying variables used for transform feedback. <varyings> is an array of
2735bd8deadSopenharmony_ci    <count> zero-terminated strings specifying the names of the varying
2745bd8deadSopenharmony_ci    variables to use for transform feedback. Varying variables are written out
2755bd8deadSopenharmony_ci    in the order they appear in the array varyings. <bufferMode> is either
2765bd8deadSopenharmony_ci    INTERLEAVED_ATTRIBS or SEPARATE_ATTRIBS, and identifies the mode used to
2775bd8deadSopenharmony_ci    capture the varying variables when transform feedback is active. The error
2785bd8deadSopenharmony_ci    INVALID_VALUE is generated if program is not the name of a program object,
2795bd8deadSopenharmony_ci    or if <bufferMode> is SEPARATE_ATTRIBS and <count> is greater than the
2805bd8deadSopenharmony_ci    value of the implementation-dependent limit
2815bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    If a string in <varyings> is "gl_NextBuffer", it does not identify a
2845bd8deadSopenharmony_ci    varying variable, but instead serves as a buffer separator value to 
2855bd8deadSopenharmony_ci    direct subsequent varyings at the next transform feedback binding point. 
2865bd8deadSopenharmony_ci    If a string in <varyings> is "gl_SkipComponents1", "gl_SkipComponents2",
2875bd8deadSopenharmony_ci    "gl_SkipComponents3", or "gl_SkipComponents4", it also does not identify a
2885bd8deadSopenharmony_ci    specific varying variable.  Instead, such values are treated as requesting
2895bd8deadSopenharmony_ci    that the GL skip the next one to four components of varying data.
2905bd8deadSopenharmony_ci    Skipping components this way is equivalent to specifying a one- to four-
2915bd8deadSopenharmony_ci    component varying with undefined values, except that the corresponding
2925bd8deadSopenharmony_ci    memory in the buffer object is not modified.  Such array entries are
2935bd8deadSopenharmony_ci    counted as being written to the buffer object for the purposes of
2945bd8deadSopenharmony_ci    determining whether the requested attributes exceed per-buffer component
2955bd8deadSopenharmony_ci    count limits.  Each component skipped is considered to occupy a single
2965bd8deadSopenharmony_ci    float.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if any pointer in <varyings>
2995bd8deadSopenharmony_ci    identifies the special names "gl_NextBuffer", "gl_SkipComponents1",
3005bd8deadSopenharmony_ci    "gl_SkipComponents2", "gl_SkipComponents3", or "gl_SkipComponents4" and
3015bd8deadSopenharmony_ci    <bufferMode> is not INTERLEAVED_ATTRIBS, or if the number of
3025bd8deadSopenharmony_ci    "gl_NextBuffer" pointers in <varyings> is greater than or equal to the
3035bd8deadSopenharmony_ci    limit MAX_TRANSFORM_FEEDBACK_BUFFERS.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    The state set by TransformFeedbackVaryings has no effect on the execution
3065bd8deadSopenharmony_ci    of the program until <program> is subsequently linked. When LinkProgram is
3075bd8deadSopenharmony_ci    called, the program is linked so that the values of the specified varying
3085bd8deadSopenharmony_ci    variables for the vertices of each primitive generated by the GL are
3095bd8deadSopenharmony_ci    written to a single buffer object (if the buffer mode is
3105bd8deadSopenharmony_ci    INTERLEAVED_ATTRIBS) or multiple buffer objects (if the buffer mode is
3115bd8deadSopenharmony_ci    SEPARATE_ATTRIBS). A program will fail to link if:
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci      * the <count> specified by TransformFeedbackVaryings is non-zero, but
3145bd8deadSopenharmony_ci        the program object has no vertex or geometry shader;
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ci      * any variable name specified in the <varyings> array is not one of
3175bd8deadSopenharmony_ci        "gl_NextBuffer", "gl_SkipComponents1", "gl_SkipComponents2",
3185bd8deadSopenharmony_ci        "gl_SkipComponents3", or "gl_SkipComponents4", and is not declared as
3195bd8deadSopenharmony_ci        an output in the geometry shader (if present) or the vertex shader (if
3205bd8deadSopenharmony_ci        no geometry shader is present);
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci      * any two entries in the <varyings> array specify the same varying
3235bd8deadSopenharmony_ci        variable;
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci      * the total number of components to capture in any varying variable in
3265bd8deadSopenharmony_ci        <varyings> is greater than the constant
3275bd8deadSopenharmony_ci        MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and the buffer mode is
3285bd8deadSopenharmony_ci        SEPARATE_ATTRIBS;
3295bd8deadSopenharmony_ci
3305bd8deadSopenharmony_ci      * the total number of components to capture is greater than the constant
3315bd8deadSopenharmony_ci        MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and the buffer
3325bd8deadSopenharmony_ci        mode is INTERLEAVED_ATTRIBS; or
3335bd8deadSopenharmony_ci
3345bd8deadSopenharmony_ci      * the set of varyings to capture to any single binding point includes
3355bd8deadSopenharmony_ci        varyings from more than one vertex stream.
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci    (Add a new paragraph describing the interaction of separators and
3385bd8deadSopenharmony_ci    GetTransformFeedbackVarying after the GetTransformFeedBackVarying
3395bd8deadSopenharmony_ci    description.)
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci    Special varying names (e.g., "gl_NextBuffer", "gl_SkipComponents1") passed
3425bd8deadSopenharmony_ci    to TransformFeedbackVaryings in the <varyings> array are counted as
3435bd8deadSopenharmony_ci    varyings to be recorded for the purposes of determining the value of
3445bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_VARYINGS and for determining the variable selected
3455bd8deadSopenharmony_ci    by <index> in GetTransformFeedbackVarying.  If <index> identifies
3465bd8deadSopenharmony_ci    "gl_NextBuffer", the values zero and NONE will be written to <size> and 
3475bd8deadSopenharmony_ci    <type>, respectively.  If <index> is of the form "gl_SkipComponents<n>", 
3485bd8deadSopenharmony_ci    the value NONE, will be written to <type> and the number of components <n>
3495bd8deadSopenharmony_ci    will be written to <size>.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    (Modify Section 2.Y.3, Transform Feedback Draw Operations, added by the
3525bd8deadSopenharmony_ci     NV_transform_feedback2 extension, to add a new DrawTransformFeedback API
3535bd8deadSopenharmony_ci     to select the vertex count from an arbitrary vertex stream.)
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    ...  The number of vertices captured from each vertex stream during
3565bd8deadSopenharmony_ci    transform feedback are stored in the corresponding transform feedback
3575bd8deadSopenharmony_ci    object and may be used in conjunction with the commands
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci        void DrawTransformFeedback(enum mode, uint id);
3605bd8deadSopenharmony_ci        void DrawTransformFeedbackStream(enum mode, uint id, uint stream);
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci    to replay the captured vertices.  DrawTransformFeedbackStream is
3635bd8deadSopenharmony_ci    equivalent to calling DrawArrays with <mode> set to <mode>, <first> set to
3645bd8deadSopenharmony_ci    zero, and <count> set to the number of vertices captured from the vertex
3655bd8deadSopenharmony_ci    stream numbered <stream> the last time transform feedback was active on 
3665bd8deadSopenharmony_ci    the transform feedback object named by <id>.  The error INVALID_VALUE
3675bd8deadSopenharmony_ci    is generated if <stream> is greater than or equal to the value of
3685bd8deadSopenharmony_ci    MAX_VERTEX_STREAMS.  DrawTransformFeedback is equivalent to calling 
3695bd8deadSopenharmony_ci    DrawTransformFeedbackStream with a <stream> of zero.  The error
3705bd8deadSopenharmony_ci    INVALID_VALUE is generated if <id> is not the name of a transform feedback
3715bd8deadSopenharmony_ci    object.  The error INVALID_OPERATION is generated if
3725bd8deadSopenharmony_ci    EndTransformFeedback has never been called while the object named by
3735bd8deadSopenharmony_ci    <id> was bound.  No error is generated if the transform feedback object
3745bd8deadSopenharmony_ci    named by <id> is active; the vertex count used for the rendering operation
3755bd8deadSopenharmony_ci    is set by the previous EndTransformFeedback command.  Note that the
3765bd8deadSopenharmony_ci    vertex count is from the number of vertices recorded to the selected
3775bd8deadSopenharmony_ci    vertex stream during the transform feedback operation.  If no varyings
3785bd8deadSopenharmony_ci    belonging to the selected vertex stream are recorded, the corresponding
3795bd8deadSopenharmony_ci    vertex count will be zero even if complete primitives were emitted to the
3805bd8deadSopenharmony_ci    selected stream.
3815bd8deadSopenharmony_ci    
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 3.2 Specification (Rasterization)
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ci    (Modify Section 3.1, Discarding Primitives Before Rasterization.
3865bd8deadSopenharmony_ci    State that only vertices sent to stream zero are processed further.)
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci    (insert at the beginning of the section, prior to language explaining
3895bd8deadSopenharmony_ci    RASTERIZER_DISCARD) 
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci    Primitives sent to the vertex stream zero are processed further;
3925bd8deadSopenharmony_ci    primitives emitted to any other stream are discarded.  When geometry
3935bd8deadSopenharmony_ci    shaders are disabled, all vertices are considered to be emitted to stream
3945bd8deadSopenharmony_ci    zero.
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 3.2 Specification (Per-Fragment
3975bd8deadSopenharmony_ciOperations and the Frame Buffer)
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci    None.
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 3.2 (Compatibility Profile)
4035bd8deadSopenharmony_ciSpecification (Special Functions)
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    Modify Section 5.2, Selection, p. 351
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ci    (modify the fourth paragraph, p. 234) In selection mode, if a point, line,
4085bd8deadSopenharmony_ci    or polygon that would otherwise be sent to the rasterizer intersects with
4095bd8deadSopenharmony_ci    the clip volume (section 2.12) then this primitive causes a selection hit.
4105bd8deadSopenharmony_ci    Coordinates produced by a RasterPos command that intersect the clip volume
4115bd8deadSopenharmony_ci    also cause a selection hit, as do the coordinates from a WindowPos
4125bd8deadSopenharmony_ci    command.  In case of polygons, no hit...
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 3.2 Specification (State and
4165bd8deadSopenharmony_ciState Requests)
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    (Modify section 6.1.6, Asynchronous Queries)
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    Replace the description of GetQueryiv, p.256:
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci    Information about an indexed query target may be queried with the commands
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci        void GetQueryIndexediv(enum target, uint index, enum pname, int *params);
4255bd8deadSopenharmony_ci        void GetQueryiv(enum taret, enum pname, int *params);
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci    where <target> identifies the query target and must be SAMPLES_PASSED for
4285bd8deadSopenharmony_ci    occlusion queries and PRIMITIVES_GENERATED or
4295bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN for primitive queries. <index> is the
4305bd8deadSopenharmony_ci    index of the query target must be between zero and a <target>-specific
4315bd8deadSopenharmony_ci    maximum. If <index> is outside of this range, GetQueryIndexediv will generate
4325bd8deadSopenharmony_ci    the INVALID_VALUE error. Calling GetQueryiv is equivalent to calling
4335bd8deadSopenharmony_ci    GetQueryIndexediv with <index> set to zero.
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci    If <pname> is CURRENT_QUERY, the name of the currently active query for
4365bd8deadSopenharmony_ci    index <index> of <target>, or zero if no query is active for that index
4375bd8deadSopenharmony_ci    of <target>, will be placed in <params>.
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    If <pname> is QUERY_COUNTER_BITS, <index> is ignored and the implementation-
4405bd8deadSopenharmony_ci    dependent number of bits used to hold the query result for target will be
4415bd8deadSopenharmony_ci    placed in params. The number of query counter bits may be zero, in which
4425bd8deadSopenharmony_ci    case the counter contains no useful information.
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    (Retain remainder of original language from description of GetQueryiv.)
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci    (Minor change to the Section 6.1.8 language to change error behavior
4475bd8deadSopenharmony_ci     of transform feedback query APIs to treat the new constant
4485bd8deadSopenharmony_ci     MAX_TRANSFORM_FEEDBACK_BUFFERS as the number of binding points.)
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci    To query which buffer objects are bound to the array of transform feedback
4515bd8deadSopenharmony_ci    binding points and will be used when transform feedback is active, call
4525bd8deadSopenharmony_ci    GetIntegeri_v() with <param> set to TRANSFORM_FEEDBACK_BUFFER_BINDING.
4535bd8deadSopenharmony_ci    <index> must be in the range zero to the value of
4545bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS - 1. The name of the buffer object bound 
4555bd8deadSopenharmony_ci    to <index> is returned in <values>. If no buffer object is bound for 
4565bd8deadSopenharmony_ci    <index>, zero is returned in <values>. The error INVALID_VALUE is
4575bd8deadSopenharmony_ci    generated if <index> is greater than or equal to the value of
4585bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS.
4595bd8deadSopenharmony_ci    
4605bd8deadSopenharmony_ci    To query the starting offset or size of the range of each buffer object
4615bd8deadSopenharmony_ci    binding used for transform feedback, call GetInteger64i_v() with param
4625bd8deadSopenharmony_ci    set to TRANSFORM_FEEDBACK_BUFFER_START or TRANSFORM_FEEDBACK_BUFFER_SIZE
4635bd8deadSopenharmony_ci    respectively. <index> must be in the range 0 to the value of
4645bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS - 1. If the parameter (starting offset or
4655bd8deadSopenharmony_ci    size) was not specified when the buffer object was bound, zero is 
4665bd8deadSopenharmony_ci    returned. If no buffer object is bound to index, -1 is returned. The
4675bd8deadSopenharmony_ci    error INVALID_VALUE is generated if <index> is greater than or equal to
4685bd8deadSopenharmony_ci    the limit MAX_TRANSFORM_FEEDBACK_BUFFERS.
4695bd8deadSopenharmony_ci
4705bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 3.2 Specification (Invariance)
4715bd8deadSopenharmony_ci
4725bd8deadSopenharmony_ci    None.
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
4755bd8deadSopenharmony_ci
4765bd8deadSopenharmony_ci    None.
4775bd8deadSopenharmony_ci
4785bd8deadSopenharmony_ciGLX Protocol
4795bd8deadSopenharmony_ci
4805bd8deadSopenharmony_ci    TBD
4815bd8deadSopenharmony_ci
4825bd8deadSopenharmony_ciDependencies on NV_gpu_program5 and ARB_gpu_shader5
4835bd8deadSopenharmony_ci
4845bd8deadSopenharmony_ci    If support for multiple vertex streams is not provided (by
4855bd8deadSopenharmony_ci    NV_gpu_program5, ARB_gpu_shader5, or a similar extension), the spec
4865bd8deadSopenharmony_ci    language does not need to change.  However, the value of the limit
4875bd8deadSopenharmony_ci    MAX_VERTEX_STREAMS will be 1.  In this case, the new query object
4885bd8deadSopenharmony_ci    targets, language referring to multiple vertex streams, and the
4895bd8deadSopenharmony_ci    TransformFeedbackStreamAttribsNV function (described immediately below in
4905bd8deadSopenharmony_ci    the "NV_transform_feedback" dependencies section) would be unnecessary but
4915bd8deadSopenharmony_ci    not otherwise harmful.
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci    We expect that some extension providing multiple vertex streams will be
4945bd8deadSopenharmony_ci    supported on all implementations of this extension.
4955bd8deadSopenharmony_ci    
4965bd8deadSopenharmony_ci
4975bd8deadSopenharmony_ciDependencies on NV_transform_feedback and NV_transform_feedback2
4985bd8deadSopenharmony_ci
4995bd8deadSopenharmony_ci    If NV_transform_feedback or NV_transform_feedback2 is supported the
5005bd8deadSopenharmony_ci    following additional edits are required:
5015bd8deadSopenharmony_ci    
5025bd8deadSopenharmony_ci    New Procedures and Functions
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci        void TransformFeedbackStreamAttribsNV(sizei count,
5055bd8deadSopenharmony_ci                                              const int * attribs, 
5065bd8deadSopenharmony_ci                                              sizei nbuffers, 
5075bd8deadSopenharmony_ci                                              const int *bufstreams,
5085bd8deadSopenharmony_ci                                              enum bufferMode);
5095bd8deadSopenharmony_ci
5105bd8deadSopenharmony_ci    New Tokens
5115bd8deadSopenharmony_ci    
5125bd8deadSopenharmony_ci        Accepted in the <locations> array of TransformFeedbackVaryingsNV
5135bd8deadSopenharmony_ci        when <bufferMode> is INTERLEAVED_ATTRIBS:
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci          NEXT_BUFFER_NV                                    -2
5165bd8deadSopenharmony_ci          SKIP_COMPONENTS4_NV                               -3
5175bd8deadSopenharmony_ci          SKIP_COMPONENTS3_NV                               -4
5185bd8deadSopenharmony_ci          SKIP_COMPONENTS2_NV                               -5
5195bd8deadSopenharmony_ci          SKIP_COMPONENTS1_NV                               -6
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci    (Modify NV_transform_feedback section that adds to Section 2.Y, Transform
5225bd8deadSopenharmony_ci    Feedback.)
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ci    (Modify the error behavior of transform feedback buffer binding APIs to
5255bd8deadSopenharmony_ci     treat the new constant MAX_TRANSFORM_FEEDBACK_BUFFERS as the number of 
5265bd8deadSopenharmony_ci     binding points.)
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci    Buffer objects are made to be targets of transform feedback by calling one
5295bd8deadSopenharmony_ci    of
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci      void BindBufferRange(enum target, uint index, uint buffer,
5325bd8deadSopenharmony_ci                           intptr offset, sizeiptr size)
5335bd8deadSopenharmony_ci      void BindBufferOffsetNV(enum target, uint index, uint buffer,
5345bd8deadSopenharmony_ci                              intptr offset)
5355bd8deadSopenharmony_ci      void BindBufferBase(enum target, uint index, uint buffer)
5365bd8deadSopenharmony_ci
5375bd8deadSopenharmony_ci    ...  The error INVALID_VALUE is generated if <index> is greater than or
5385bd8deadSopenharmony_ci    equal to the value of MAX_TRANSFORM_FEEDBACK_BUFFERS.
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci    ...
5415bd8deadSopenharmony_ci
5425bd8deadSopenharmony_ci    (Modify the section that describes TransformFeedbackAttribsNV for
5435bd8deadSopenharmony_ci    fixed-function vertex processing.)
5445bd8deadSopenharmony_ci                              
5455bd8deadSopenharmony_ci    When no vertex or geometry shader is active, transform feedback may be
5465bd8deadSopenharmony_ci    used to record vertex attribute values written by fixed-function vertex
5475bd8deadSopenharmony_ci    processing or by an assembly vertex or geometry program.  Both buffer
5485bd8deadSopenharmony_ci    modes described above are supported.  The set of attributes recorded, and
5495bd8deadSopenharmony_ci    their order, is specified by TransformFeedbackAttribsNV (section 2.Y).
5505bd8deadSopenharmony_ci    
5515bd8deadSopenharmony_ci    (modify language from NV_transform_feedback describing
5525bd8deadSopenharmony_ci    TransformFeedbackAttribsNV, used to capture outputs from fixed-function
5535bd8deadSopenharmony_ci    and assembly programs)
5545bd8deadSopenharmony_ci
5555bd8deadSopenharmony_ci    The set of vertex attributes to capture when no vertex or geometry shader
5565bd8deadSopenharmony_ci    is active is specified by the command
5575bd8deadSopenharmony_ci
5585bd8deadSopenharmony_ci      void TransformFeedbackAttribsNV(sizei count, const int *attribs,
5595bd8deadSopenharmony_ci                                      enum bufferMode)
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ci    <bufferMode> is one of INTERLEAVED_ATTRIBS or SEPARATE_ATTRIBS,
5625bd8deadSopenharmony_ci    and identifies the mode used to capture the attributes when transform
5635bd8deadSopenharmony_ci    feedback is active.  <attribs> is an array of 3*<count> values specifying
5645bd8deadSopenharmony_ci    the set of vertex attribute vectors to record.  For the <i>th attribute,
5655bd8deadSopenharmony_ci    array element 3*<i>+0 specifies the type of attribute to capture, as
5665bd8deadSopenharmony_ci    described in table X.1, or one of the special values described below.  The
5675bd8deadSopenharmony_ci    error INVALID_ENUM is generated if this value is not found in table X.1.
5685bd8deadSopenharmony_ci    Array element 3*<i>+1 specifies the number of components to record from
5695bd8deadSopenharmony_ci    the specified attribute.  The error INVALID_VALUE is generated if this
5705bd8deadSopenharmony_ci    value is not supported for the specified attribute type, as indicated in
5715bd8deadSopenharmony_ci    Table X.1.  Array element 3*<i>+2 identifies the attribute number used for
5725bd8deadSopenharmony_ci    attribute types with more than one attribute vector (e.g., texture
5735bd8deadSopenharmony_ci    coordinates, generic attributes).  For attribute types with only a single
5745bd8deadSopenharmony_ci    attribute, this element is ignored.  Otherwise, it identifies the specific
5755bd8deadSopenharmony_ci    attribute number.  The error INVALID_VALUE is generated if this element is
5765bd8deadSopenharmony_ci    greater than or equal to the number of attributes available for the
5775bd8deadSopenharmony_ci    specified type.
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ci    Attribute type entries in <attribs> with the value NEXT_BUFFER_NV do not
5805bd8deadSopenharmony_ci    identify a vertex attribute, but instead serve as buffer separator values
5815bd8deadSopenharmony_ci    to direct subsequent attributes at the next transform feedback binding
5825bd8deadSopenharmony_ci    point.  Attribute type entries in <attribs> with the value
5835bd8deadSopenharmony_ci    SKIP_COMPONENTS1_NV, SKIP_COMPONENTS2_NV, SKIP_COMPONENTS3_NV, or
5845bd8deadSopenharmony_ci    SKIP_COMPONENTS4_NV also do not identify a specific vertex attribute type.
5855bd8deadSopenharmony_ci    These values are treated as requesting that the GL skip the next one to
5865bd8deadSopenharmony_ci    four components of attribute data.  Skipping components this way is
5875bd8deadSopenharmony_ci    equivalent to writing one to four components of undefined vertex attribute
5885bd8deadSopenharmony_ci    data, except that the corresponding memory in the buffer object is not
5895bd8deadSopenharmony_ci    modified.  Such array entries are counted as being written to the buffer
5905bd8deadSopenharmony_ci    object for the purposes of determining whether the requested attributes
5915bd8deadSopenharmony_ci    exceed per-buffer component count limits.  When an attribute type is
5925bd8deadSopenharmony_ci    NEXT_BUFFER_NV or of the form SKIP_COMPONENTS<n>_NV, the next two values
5935bd8deadSopenharmony_ci    in <attribs>, specifying component count and attribute number, are
5945bd8deadSopenharmony_ci    ignored.
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if any such value is
5975bd8deadSopenharmony_ci    NEXT_BUFFER_NV, SKIP_COMPONENTS1_NV, SKIP_COMPONENTS2_NV,
5985bd8deadSopenharmony_ci    SKIP_COMPONENTS3_NV, or SKIP_COMPONENTS4_NV, and <bufferMode> is not
5995bd8deadSopenharmony_ci    INTERLEAVED_ATTRIBS.
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci                                permitted            GPU_program4
6025bd8deadSopenharmony_ci      attrib                    sizes     index?     result name
6035bd8deadSopenharmony_ci      ---------------------     --------  --------   --------------
6045bd8deadSopenharmony_ci      POSITION                  1,2,3,4     no       position
6055bd8deadSopenharmony_ci      PRIMARY_COLOR             1,2,3,4     no       color.front.primary
6065bd8deadSopenharmony_ci      SECONDARY_COLOR_NV        1,2,3,4     no       color.front.secondary
6075bd8deadSopenharmony_ci      BACK_PRIMARY_COLOR_NV     1,2,3,4     no       color.back.primary
6085bd8deadSopenharmony_ci      BACK_SECONDARY_COLOR_NV   1,2,3,4     no       color.back.secondary
6095bd8deadSopenharmony_ci      FOG_COORDINATE            1           no       fogcoord
6105bd8deadSopenharmony_ci      POINT_SIZE                1           no       pointsize
6115bd8deadSopenharmony_ci      TEXTURE_COORD_NV          1,2,3,4     yes      texcoord[index]
6125bd8deadSopenharmony_ci      CLIP_DISTANCE_NV          1           yes      clip[index]
6135bd8deadSopenharmony_ci      VERTEX_ID_NV              1           no       vertexid
6145bd8deadSopenharmony_ci      PRIMITIVE_ID_NV           1           no       primid
6155bd8deadSopenharmony_ci      GENERIC_ATTRIB_NV         1,2,3,4     yes      attrib[index]
6165bd8deadSopenharmony_ci      LAYER_NV                  1           no       layer
6175bd8deadSopenharmony_ci      NEXT_BUFFER_NV            0           no       ----
6185bd8deadSopenharmony_ci      SKIP_COMPONENTS1_NV       1           no       ----
6195bd8deadSopenharmony_ci      SKIP_COMPONENTS2_NV       2           no       ----
6205bd8deadSopenharmony_ci      SKIP_COMPONENTS3_NV       3           no       ----
6215bd8deadSopenharmony_ci      SKIP_COMPONENTS4_NV       4           no       ----
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci      Table X.1:  Transform Feedback Attribute Specifiers.  The "attrib"
6245bd8deadSopenharmony_ci      column specifies the attribute types available to record.  The
6255bd8deadSopenharmony_ci      "permitted sizes" column indicate the legal component count values for
6265bd8deadSopenharmony_ci      the attribute type.  The "index" column indicates if the attribute type
6275bd8deadSopenharmony_ci      has more than one attribute vector and requires an attribute number.
6285bd8deadSopenharmony_ci      The "GPU_program4 result name" column shows the suffix of the result
6295bd8deadSopenharmony_ci      variable binding recorded for each attribute type.
6305bd8deadSopenharmony_ci
6315bd8deadSopenharmony_ci    The attributes captured by TransformFeedbackAttribsNV always come from
6325bd8deadSopenharmony_ci    primitives emitted to vertex stream zero.  However, the command
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ci      void TransformFeedbackStreamAttribsNV(sizei count, const int * attribs, 
6355bd8deadSopenharmony_ci                                            sizei nbuffers, 
6365bd8deadSopenharmony_ci                                            const int *bufstreams, 
6375bd8deadSopenharmony_ci                                            enum bufferMode);
6385bd8deadSopenharmony_ci
6395bd8deadSopenharmony_ci    can capture vertex attributes from arbitrary vertex streams.  <count>,
6405bd8deadSopenharmony_ci    <attribs>, and <bufferMode> operate as above.  <bufstreams> is an array of
6415bd8deadSopenharmony_ci    <nbuffers> vertex stream numbers used for each transform feedback binding
6425bd8deadSopenharmony_ci    point.  When a new primitive is emitted to a given vertex stream, vertex
6435bd8deadSopenharmony_ci    attributes are recorded only to those binding points whose corresponding
6445bd8deadSopenharmony_ci    <bufstreams> value equals the vertex stream number.  The error
6455bd8deadSopenharmony_ci    INVALID_VALUE is generated if any value in <bufstreams> is greater than or
6465bd8deadSopenharmony_ci    equal to the value of MAX_VERTEX_STREAMS.  The error INVALID_OPERATION is 
6475bd8deadSopenharmony_ci    generated if the number of binding points specified by <attribs> is not
6485bd8deadSopenharmony_ci    equal to <nbuffers>.  If <bufferMode> is INTERLEAVED_ATTRIBS, the
6495bd8deadSopenharmony_ci    number of binding points used is one plus the number of NEXT_BUFFER_NV
6505bd8deadSopenharmony_ci    values in <attribs>.  If <bufferMode> is SEPARATE_ATTRIBS, number of
6515bd8deadSopenharmony_ci    binding points used is given by <count>.
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci    The number of attributes or attribute components that may be recorded in
6545bd8deadSopenharmony_ci    transform feedback mode is limited.  The error INVALID_OPERATION is
6555bd8deadSopenharmony_ci    generated by TransformFeedbackAttribsNV or
6565bd8deadSopenharmony_ci    TransformFeedbackStreamAttribsNV if
6575bd8deadSopenharmony_ci
6585bd8deadSopenharmony_ci      * <bufferMode> is SEPARATE_ATTRIBS, and <count> is greater than the
6595bd8deadSopenharmony_ci        limit MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV;
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the total number of
6625bd8deadSopenharmony_ci        vertex components to record to any single binding point is greater
6635bd8deadSopenharmony_ci        than the limit MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV; or
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the number of binding
6665bd8deadSopenharmony_ci        points used (one plus the number of NEXT_BUFFER_NV values in
6675bd8deadSopenharmony_ci        <attribs>) is greater than the limit
6685bd8deadSopenharmony_ci        MAX_TRANSFORM_FEEDBACK_BUFFERS.
6695bd8deadSopenharmony_ci
6705bd8deadSopenharmony_ci    The set of attributes to record, set by TransformFeedbackAttribsNV or
6715bd8deadSopenharmony_ci    TransformFeedbackStreamAttribsNV, has no effect if a vertex or geometry
6725bd8deadSopenharmony_ci    shader is active.
6735bd8deadSopenharmony_ci
6745bd8deadSopenharmony_ci    The value for any attribute specified to be recorded to a buffer object
6755bd8deadSopenharmony_ci    but not actually written by a vertex or geometry program is undefined.
6765bd8deadSopenharmony_ci    The value of PRIMITIVE_ID_NV or LAYER_NV for a vertex is defined if and
6775bd8deadSopenharmony_ci    only if a geometry program is active and that program writes to the result
6785bd8deadSopenharmony_ci    variable "result.primid".  The value of VERTEX_ID_NV is only defined if
6795bd8deadSopenharmony_ci    and only if a vertex program is active, no geometry program is active, and
6805bd8deadSopenharmony_ci    the vertex program writes to the output attribute "result.id".
6815bd8deadSopenharmony_ci
6825bd8deadSopenharmony_ci
6835bd8deadSopenharmony_ci    (Fold in corresponding language from NV_transform_feedback providing
6845bd8deadSopenharmony_ci     additional mechanisms for specifying the set of varyings or attributes to
6855bd8deadSopenharmony_ci     capture in transform feedback.  The only new functionality provided
6865bd8deadSopenharmony_ci     by this extension is the ability to provide separator values to write to
6875bd8deadSopenharmony_ci     multiple buffers in interleaved mode.)
6885bd8deadSopenharmony_ci
6895bd8deadSopenharmony_ci    Additionally, it is also possible to change the set of varying variables
6905bd8deadSopenharmony_ci    to record in transform feedback mode immediately without relinking the
6915bd8deadSopenharmony_ci    program object.  The command
6925bd8deadSopenharmony_ci
6935bd8deadSopenharmony_ci      void TransformFeedbackVaryingsNV(uint program, sizei count,
6945bd8deadSopenharmony_ci                                       const int *locations, 
6955bd8deadSopenharmony_ci                                       enum bufferMode)
6965bd8deadSopenharmony_ci
6975bd8deadSopenharmony_ci    sets the transform feedback state for <program> and specifies the set of
6985bd8deadSopenharmony_ci    varying variables to record when transform feedback is active.
6995bd8deadSopenharmony_ci    <bufferMode> is either INTERLEAVED_ATTRIBS or SEPARATE_ATTRIBS and
7005bd8deadSopenharmony_ci    identifies the mode used to capture the varying variables when transform
7015bd8deadSopenharmony_ci    feedback is active.  The array <locations> contains <count> integers, each
7025bd8deadSopenharmony_ci    of which must be either a location of an active varying variable in
7035bd8deadSopenharmony_ci    <program> as queried with GetActiveVaryingNV() or one of the special
7045bd8deadSopenharmony_ci    values described below.
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    If an entry in <locations> has the value NEXT_BUFFER_NV, it does not
7075bd8deadSopenharmony_ci    identify a varying variable.  Instead, it serves as a buffer separator
7085bd8deadSopenharmony_ci    value to direct subsequent varyings at the next transform feedback binding
7095bd8deadSopenharmony_ci    point.  If any entry is SKIP_COMPONENTS1_NV, SKIP_COMPONENTS2_NV,
7105bd8deadSopenharmony_ci    SKIP_COMPONENTS3_NV, or SKIP_COMPONENTS4_NV, it also does not identify a
7115bd8deadSopenharmony_ci    specific varying variable.  Instead, such values are treated as requesting
7125bd8deadSopenharmony_ci    that the GL skip the next one to four components of varying data.
7135bd8deadSopenharmony_ci    Skipping components this way is equivalent to specifying a one- to four-
7145bd8deadSopenharmony_ci    component varying with undefined values, except that the corresponding
7155bd8deadSopenharmony_ci    memory in the buffer object is not modified.  Such array entries are
7165bd8deadSopenharmony_ci    counted as being written to the buffer object for the purposes of
7175bd8deadSopenharmony_ci    determining whether the requested attributes exceed per-buffer component
7185bd8deadSopenharmony_ci    count limits.
7195bd8deadSopenharmony_ci
7205bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if <program> is not the name of a
7215bd8deadSopenharmony_ci    program object or if <bufferMode> is SEPARATE_ATTRIBS and <count> is
7225bd8deadSopenharmony_ci    greater than the limit MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.  The
7235bd8deadSopenharmony_ci    error INVALID_OPERATION is generated:
7245bd8deadSopenharmony_ci
7255bd8deadSopenharmony_ci      * if <program> has not been linked successfully;
7265bd8deadSopenharmony_ci
7275bd8deadSopenharmony_ci      * if <program> is being used by any active transform feedback object;
7285bd8deadSopenharmony_ci
7295bd8deadSopenharmony_ci      * if any value in <locations> is neither NEXT_BUFFER_NV nor the location
7305bd8deadSopenharmony_ci        of an active varying variable in <program>;
7315bd8deadSopenharmony_ci
7325bd8deadSopenharmony_ci      * if any value in <locations> (other than NEXT_BUFFER_NV) appears more
7335bd8deadSopenharmony_ci        than once in the array;
7345bd8deadSopenharmony_ci
7355bd8deadSopenharmony_ci      * if any value in <locations> is NEXT_BUFFER_NV, SKIP_COMPONENTS1_NV,
7365bd8deadSopenharmony_ci        SKIP_COMPONENTS2_NV, SKIP_COMPONENTS3_NV, or SKIP_COMPONENTS4_NV, and
7375bd8deadSopenharmony_ci        <bufferMode> is not INTERLEAVED_ATTRIBS;
7385bd8deadSopenharmony_ci
7395bd8deadSopenharmony_ci      * if the number of NEXT_BUFFER_NV values in <locations> is greater
7405bd8deadSopenharmony_ci        than or equal to the value of MAX_TRANSFORM_FEEDBACK_BUFFERS;
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci      * <bufferMode> is SEPARATE_ATTRIBS and the total number of
7435bd8deadSopenharmony_ci        components to capture in any varying variable in <locations> is
7445bd8deadSopenharmony_ci        greater than the limit MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS;
7455bd8deadSopenharmony_ci
7465bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the total number of
7475bd8deadSopenharmony_ci        vertex components to capture to any single binding point is greater
7485bd8deadSopenharmony_ci        than the limit MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; or
7495bd8deadSopenharmony_ci
7505bd8deadSopenharmony_ci      * the set of varyings to capture to any single binding point includes
7515bd8deadSopenharmony_ci        varyings from more than one vertex stream.
7525bd8deadSopenharmony_ci
7535bd8deadSopenharmony_ci    The transform feedback state set by TransformFeedbackVaryingsNV
7545bd8deadSopenharmony_ci    immediately replaces any transform feedback varying state of <program>,
7555bd8deadSopenharmony_ci    whether the old state was set when <program> was last linked (using the
7565bd8deadSopenharmony_ci    varying names provided by TransformFeedbackVaryings), or via a
7575bd8deadSopenharmony_ci    post-link call to TransformFeedbackVaryingsNV.
7585bd8deadSopenharmony_ci    
7595bd8deadSopenharmony_ci    (Additions to Chapter 6 of the OpenGL 3.2 Specification (State and State
7605bd8deadSopenharmony_ci     Requests))
7615bd8deadSopenharmony_ci    
7625bd8deadSopenharmony_ci    (Clean up/replace the language added by NV_transform_feedback, which added
7635bd8deadSopenharmony_ci     a new Section 6.1.14 "Transform Feedback" and renamed 6.1.14 to 6.1.15.
7645bd8deadSopenharmony_ci     The only functional change here is to explicitly separator attributes
7655bd8deadSopenharmony_ci     provided for interleaved mode.)
7665bd8deadSopenharmony_ci
7675bd8deadSopenharmony_ci    The set of vertex attributes to be recorded to a buffer object when
7685bd8deadSopenharmony_ci    neither a vertex nor geometry shader is active may be queried.  The buffer
7695bd8deadSopenharmony_ci    mode and number of attributes specified is obtained by calling GetIntegerv
7705bd8deadSopenharmony_ci    with <param> set to TRANSFORM_FEEDBACK_BUFFER_MODE_NV and
7715bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_ATTRIBS_NV, respectively.  Information on each
7725bd8deadSopenharmony_ci    individual attribute to record may be obtained by calling
7735bd8deadSopenharmony_ci    GetIntegerIndexedvEXT() with <param> set to TRANSFORM_FEEDBACK_RECORD_NV
7745bd8deadSopenharmony_ci    and <index> specifying the position of the attribute in the array given to
7755bd8deadSopenharmony_ci    TransformFeedbackAttribsNV.  Three integers will be returned, containing
7765bd8deadSopenharmony_ci    the three values passed to TransformFeedbackAttribsNV for the specified
7775bd8deadSopenharmony_ci    attribute.  The error INVALID_VALUE is generated if <index> is greater
7785bd8deadSopenharmony_ci    than or equal to the value of TRANSFORM_FEEDBACK_ATTRIBS_NV.  Any
7795bd8deadSopenharmony_ci    separators (NEXT_BUFFER_NV) passed to TransformFeedbackAttribsNV are
7805bd8deadSopenharmony_ci    counted as attributes for the purposes of these queries, and will be
7815bd8deadSopenharmony_ci    returned by TRANSFORM_FEEDBACK_RECORD_NV queries.
7825bd8deadSopenharmony_ci    
7835bd8deadSopenharmony_ci    (add to OpenGL 3.2 Section 6.1.10, Shader and Program Queries, p. 259)
7845bd8deadSopenharmony_ci
7855bd8deadSopenharmony_ci    (Clean up/replace the language added to this section by
7865bd8deadSopenharmony_ci    NV_transform_feedback, and add language describing how separators are
7875bd8deadSopenharmony_ci    handled.)
7885bd8deadSopenharmony_ci
7895bd8deadSopenharmony_ci    If <pname> is TRANSFORM_FEEDBACK_BUFFER_MODE, the buffer mode used when 
7905bd8deadSopenharmony_ci    transform feedback is active is returned.  If <pname> is
7915bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_VARYINGS, the number of varying variables to capture
7925bd8deadSopenharmony_ci    in transform feedback mode for the program is returned.  Any separators
7935bd8deadSopenharmony_ci    (NEXT_BUFFER_NV) provided to TransformFeedbackVaryingsNV count.  If
7945bd8deadSopenharmony_ci    <pname> is TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH, the length of the
7955bd8deadSopenharmony_ci    longest varying name specified to be used for transform feedback,
7965bd8deadSopenharmony_ci    including a null terminator character, is returned.  If no varyings are
7975bd8deadSopenharmony_ci    used for transform feedback, zero is returned.
7985bd8deadSopenharmony_ci
7995bd8deadSopenharmony_ci    The command
8005bd8deadSopenharmony_ci
8015bd8deadSopenharmony_ci      void GetTransformFeedbackVaryingNV(uint program, uint index,
8025bd8deadSopenharmony_ci                                         int *location)
8035bd8deadSopenharmony_ci
8045bd8deadSopenharmony_ci    returns the location of a varying variable to stream to a buffer object in
8055bd8deadSopenharmony_ci    <location>.  The array element numbered <index> in the array <locations>
8065bd8deadSopenharmony_ci    passed to TransformFeedbackVaryingsNV, is returned.  The error
8075bd8deadSopenharmony_ci    INVALID_VALUE is generated if <index> is greater than or equal to the
8085bd8deadSopenharmony_ci    value of TRANSFORM_FEEDBACK_VARYINGS_NV.  If <index> refers to a
8095bd8deadSopenharmony_ci    separator, the value NEXT_BUFFER_NV is returned.  The error
8105bd8deadSopenharmony_ci    INVALID_OPERATION is generated if <program> is not the name of a program
8115bd8deadSopenharmony_ci    object or if <program> has not been linked successfully.
8125bd8deadSopenharmony_ci
8135bd8deadSopenharmony_ci    Modify section 5.4, Display Lists, p. 237
8145bd8deadSopenharmony_ci
8155bd8deadSopenharmony_ci    On p. 358, add the following to the list of vertex buffer object commands
8165bd8deadSopenharmony_ci    not compiled into a display list: TransformFeedbackStreamAttribsNV.
8175bd8deadSopenharmony_ci
8185bd8deadSopenharmony_ci
8195bd8deadSopenharmony_ciErrors
8205bd8deadSopenharmony_ci
8215bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by BindBufferRange,
8225bd8deadSopenharmony_ci    BindBufferOffsetEXT, or BindBufferBase if <target> is
8235bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_BUFFER and <index> is greater than or equal to the
8245bd8deadSopenharmony_ci    value of MAX_TRANSFORM_FEEDBACK_BUFFERS.
8255bd8deadSopenharmony_ci
8265bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by BeginQueryIndexed, EndQueryIndexed
8275bd8deadSopenharmony_ci    or GetQueryIndexediv if <target> is TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
8285bd8deadSopenharmony_ci    or PRIMITIVES_GENERATED and <index> is greater or equal to MAX_VERTEX_STREAMS.
8295bd8deadSopenharmony_ci
8305bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by EndQueryIndexed if the active
8315bd8deadSopenharmony_ci    query object name at index <index> of target <target> is zero.
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by TransformFeedbackAttribsNV or
8345bd8deadSopenharmony_ci    TransformFeedbackStreamAttribsNV if the component count or attribute
8355bd8deadSopenharmony_ci    numbers specified in the <attribs> array are not consistent with the
8365bd8deadSopenharmony_ci    corresponding attribute type.
8375bd8deadSopenharmony_ci
8385bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by TransformFeedbackStreamAttribsNV
8395bd8deadSopenharmony_ci    if any value in <bufstreams> is greater than or equal to the value of
8405bd8deadSopenharmony_ci    MAX_VERTEX_STREAMS.
8415bd8deadSopenharmony_ci
8425bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by TransformFeedbackStream-
8435bd8deadSopenharmony_ci    AttribsNV if the number of binding points specified by <attribs> is not
8445bd8deadSopenharmony_ci    equal to <nbuffers>.
8455bd8deadSopenharmony_ci
8465bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by TransformFeedbackAttribsNV or
8475bd8deadSopenharmony_ci    TransformFeedbackStreamAttribsNV if
8485bd8deadSopenharmony_ci
8495bd8deadSopenharmony_ci      * <bufferMode> is SEPARATE_ATTRIBS, and <count> is greater than the
8505bd8deadSopenharmony_ci        limit MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV;
8515bd8deadSopenharmony_ci
8525bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the total number of
8535bd8deadSopenharmony_ci        vertex components to record to any single binding point is greater
8545bd8deadSopenharmony_ci        than the limit MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV;
8555bd8deadSopenharmony_ci
8565bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the number of binding
8575bd8deadSopenharmony_ci        points used (one plus the number of NEXT_BUFFER_NV values in
8585bd8deadSopenharmony_ci        <attribs>) is greater than the limit
8595bd8deadSopenharmony_ci        MAX_TRANSFORM_FEEDBACK_BUFFERS; or
8605bd8deadSopenharmony_ci
8615bd8deadSopenharmony_ci      * any attribute type value in <attribs> is NEXT_BUFFER_NV,
8625bd8deadSopenharmony_ci        SKIP_COMPONENTS1_NV, SKIP_COMPONENTS2_NV, SKIP_COMPONENTS3_NV, or
8635bd8deadSopenharmony_ci        SKIP_COMPONENTS4_NV, and <bufferMode> is not INTERLEAVED_ATTRIBS.
8645bd8deadSopenharmony_ci
8655bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by DrawTransformFeedbackStream
8665bd8deadSopenharmony_ci    if <stream> is greater than or equal to the value of 
8675bd8deadSopenharmony_ci    MAX_VERTEX_STREAMS.
8685bd8deadSopenharmony_ci
8695bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by TransformFeedbackVaryings if
8705bd8deadSopenharmony_ci    <program> is not the name of a program object, or if <bufferMode> is
8715bd8deadSopenharmony_ci    SEPARATE_ATTRIBS and <count> is greater than the limit
8725bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.
8735bd8deadSopenharmony_ci
8745bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by TransformFeedbackVaryings
8755bd8deadSopenharmony_ci    if any pointer in <varyings> identifies the special names "gl_NextBuffer",
8765bd8deadSopenharmony_ci    "gl_SkipComponents1", "gl_SkipComponents2", "gl_SkipComponents3", or
8775bd8deadSopenharmony_ci    "gl_SkipComponents4" and <bufferMode> is not INTERLEAVED_ATTRIBS_NV, or if
8785bd8deadSopenharmony_ci    the number of "gl_NextBuffer" pointers in <varyings> is greater than or
8795bd8deadSopenharmony_ci    equal to the value of MAX_TRANSFORM_FEEDBACK_BUFFERS.
8805bd8deadSopenharmony_ci
8815bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by TransformFeedbackVaryingsNV if
8825bd8deadSopenharmony_ci    <program> is not the name of a program object, or if <bufferMode> is
8835bd8deadSopenharmony_ci    SEPARATE_ATTRIBS and <count> is greater than the limit
8845bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS.
8855bd8deadSopenharmony_ci
8865bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by TransformFeedbackVaryingsNV:
8875bd8deadSopenharmony_ci
8885bd8deadSopenharmony_ci      * if <program> has not been linked successfully;
8895bd8deadSopenharmony_ci
8905bd8deadSopenharmony_ci      * if <program> is being used by any active transform feedback object;
8915bd8deadSopenharmony_ci
8925bd8deadSopenharmony_ci      * if any value in <locations> is neither NEXT_BUFFER_NV nor the location
8935bd8deadSopenharmony_ci        of an active varying variable in <program>;
8945bd8deadSopenharmony_ci
8955bd8deadSopenharmony_ci      * if any value in <locations> (other than NEXT_BUFFER_NV) appears more
8965bd8deadSopenharmony_ci        than once in the array;
8975bd8deadSopenharmony_ci
8985bd8deadSopenharmony_ci      * if any value in <locations> is NEXT_BUFFER_NV, SKIP_COMPONENTS1_NV,
8995bd8deadSopenharmony_ci        SKIP_COMPONENTS2_NV, SKIP_COMPONENTS3_NV, or SKIP_COMPONENTS4_NV, and
9005bd8deadSopenharmony_ci        <bufferMode> is not INTERLEAVED_ATTRIBS;
9015bd8deadSopenharmony_ci
9025bd8deadSopenharmony_ci      * if the number of NEXT_BUFFER_NV values in <locations> is greater
9035bd8deadSopenharmony_ci        than or equal to the value of MAX_TRANSFORM_FEEDBACK_BUFFERS;
9045bd8deadSopenharmony_ci
9055bd8deadSopenharmony_ci      * <bufferMode> is SEPARATE_ATTRIBS and the total number of
9065bd8deadSopenharmony_ci        components to capture in any varying variable in <locations> is
9075bd8deadSopenharmony_ci        greater than the limit MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS;
9085bd8deadSopenharmony_ci
9095bd8deadSopenharmony_ci      * <bufferMode> is INTERLEAVED_ATTRIBS, and the total number of
9105bd8deadSopenharmony_ci        vertex components to capture to any single binding point is greater
9115bd8deadSopenharmony_ci        than the limit MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; or
9125bd8deadSopenharmony_ci
9135bd8deadSopenharmony_ci      * the set of varyings to capture to any single binding point includes
9145bd8deadSopenharmony_ci        varyings from more than one vertex stream.
9155bd8deadSopenharmony_ci
9165bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetIntegerIndexedvEXT if <param>
9175bd8deadSopenharmony_ci    is TRANSFORM_FEEDBACK_RECORD_NV and <index> is greater than or equal to
9185bd8deadSopenharmony_ci    the value of TRANSFORM_FEEDBACK_ATTRIBS_NV.
9195bd8deadSopenharmony_ci
9205bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetIntegerIndexedvEXT() if <param>
9215bd8deadSopenharmony_ci    is TRANSFORM_FEEDBACK_BUFFER_BINDING,
9225bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_BUFFER_START, or TRANSFORM_FEEDBACK_BUFFER_SIZE and 
9235bd8deadSopenharmony_ci    <index> is greater than or equal to the value of
9245bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_BUFFERS.
9255bd8deadSopenharmony_ci
9265bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetTransformFeedbackVaryingNV if
9275bd8deadSopenharmony_ci    <index> is greater than or equal to the value of
9285bd8deadSopenharmony_ci    TRANSFORM_FEEDBACK_VARYINGS_NV.
9295bd8deadSopenharmony_ci
9305bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated by GetTransformFeedbackVaryingNV
9315bd8deadSopenharmony_ci    if <program> is not the name of a program object, or if <program> has not
9325bd8deadSopenharmony_ci    been linked successfully.
9335bd8deadSopenharmony_ci
9345bd8deadSopenharmony_ci    The error INVALID_ENUM is generated by BeginQuery if the <target> is
9355bd8deadSopenharmony_ci    PRIMITIVES_GENERATED<i>_NV or TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN<i>_NV
9365bd8deadSopenharmony_ci    and <i> is greater than or equal to the value of MAX_VERTEX_STREAMS.
9375bd8deadSopenharmony_ci
9385bd8deadSopenharmony_ciNew State
9395bd8deadSopenharmony_ci
9405bd8deadSopenharmony_ci   (Modify Table 6.37, p 298, adding a variable number of new transform
9415bd8deadSopenharmony_ci   feedback query object binding points.)
9425bd8deadSopenharmony_ci
9435bd8deadSopenharmony_ci    Get Value         Type  Get Command       Init. Value  Description                Sec    Attribute
9445bd8deadSopenharmony_ci    ----------------  ----  ----------------  -----------  -------------------------  -----  ---------
9455bd8deadSopenharmony_ci    CURRENT_QUERY     nxZ+  GetQueryiv        0            Active query object name   2.X        -
9465bd8deadSopenharmony_ci                                                           (occlusion, timer, per-
9475bd8deadSopenharmony_ci                                                           stream xform feedback)
9485bd8deadSopenharmony_ci
9495bd8deadSopenharmony_ciNew Implementation Dependent State
9505bd8deadSopenharmony_ci
9515bd8deadSopenharmony_ci   (Add to the new table, Table 6.X. Transform Feedback State, previously
9525bd8deadSopenharmony_ci   added by EXT_transform_feedback.)
9535bd8deadSopenharmony_ci
9545bd8deadSopenharmony_ci                                                  Minimum
9555bd8deadSopenharmony_ci    Get Value                  Type  Get Command   Value   Description                   Sec.  Attrib 
9565bd8deadSopenharmony_ci    ---------                  ----  -----------  -------  ---------------------------   ----  ------
9575bd8deadSopenharmony_ci    MAX_TRANSFORM_FEEDBACK_     Z+   GetIntegerv     4     Max number of buffer objs     2.Y     -
9585bd8deadSopenharmony_ci      BUFFERS                                              to write with xform feedback
9595bd8deadSopenharmony_ci    MAX_VERTEX_STREAMS          Z+   GetIntegerv     1     Maximum number of vertex      2.Y     -
9605bd8deadSopenharmony_ci                                                           streams supported
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ciIssues
9635bd8deadSopenharmony_ci
9645bd8deadSopenharmony_ci    (1) How should we provide the ability to record varyings/attributes to
9655bd8deadSopenharmony_ci        multiple buffers with multiple varyings/attributes per buffer?
9665bd8deadSopenharmony_ci
9675bd8deadSopenharmony_ci      RESOLVED:  The version supported in the spec extends the interleaved
9685bd8deadSopenharmony_ci      mode provided by existing APIs to allow writing to multiple buffers.
9695bd8deadSopenharmony_ci      Special separator values are provided to allow the caller to direct
9705bd8deadSopenharmony_ci      subsequent varyings/attributes at the next buffer.  For example, the
9715bd8deadSopenharmony_ci      following code would capture the values of "batman" and "robin"
9725bd8deadSopenharmony_ci      interleaved to the first buffer binding point, and "riddler", "joker",
9735bd8deadSopenharmony_ci      and "manbearpig" interleaved to the second.  This example specifies
9745bd8deadSopenharmony_ci      attributes in the style used by EXT_transform_feedback (array of
9755bd8deadSopenharmony_ci      variable names set prior to linking).
9765bd8deadSopenharmony_ci
9775bd8deadSopenharmony_ci        char *names[] = { "batman", "robin", "gl_NextBuffer",
9785bd8deadSopenharmony_ci                          "riddler", "joker", "manbearpig" };
9795bd8deadSopenharmony_ci        glTransformFeedbackVaryings(program, 6, names,
9805bd8deadSopenharmony_ci                                    GL_INTERLEAVED_ATTRIBS);
9815bd8deadSopenharmony_ci
9825bd8deadSopenharmony_ci      The same example using the NV_transform_feedback-style API would
9835bd8deadSopenharmony_ci      produce:
9845bd8deadSopenharmony_ci
9855bd8deadSopenharmony_ci        int locations[6] = {
9865bd8deadSopenharmony_ci          glGetVaryingLocation(program, "batman"),
9875bd8deadSopenharmony_ci          glGetVaryingLocation(program, "robin"),
9885bd8deadSopenharmony_ci          NEXT_BUFFER_NV,
9895bd8deadSopenharmony_ci          glGetVaryingLocation(program, "riddler"),
9905bd8deadSopenharmony_ci          glGetVaryingLocation(program, "joker"),
9915bd8deadSopenharmony_ci          glGetVaryingLocation(program, "manbearpig")
9925bd8deadSopenharmony_ci        };
9935bd8deadSopenharmony_ci        glTransformFeedbackVaryingsNV(program, 6, locations, 
9945bd8deadSopenharmony_ci                                      GL_INTERLEAVED_ATTRIBS);
9955bd8deadSopenharmony_ci
9965bd8deadSopenharmony_ci      A similar example using assembly shaders might work like:
9975bd8deadSopenharmony_ci
9985bd8deadSopenharmony_ci        int attribs[] = {
9995bd8deadSopenharmony_ci          GL_TEXTURE_COORD_NV, 3, 0,   // vec3 batman @ result.texcoord[0]
10005bd8deadSopenharmony_ci          GL_TEXTURE_COORD_NV, 3, 1,   // vec3 robin @ result.texcoord[1]
10015bd8deadSopenharmony_ci          NEXT_BUFFER_NV, 0, 0,
10025bd8deadSopenharmony_ci          GL_GENERIC_ATTRIB_NV, 4, 0,  // vec4 riddler @ result.attrib[0]
10035bd8deadSopenharmony_ci          GL_GENERIC_ATTRIB_NV, 2, 0,  // vec2 joker @ result.attrib[1]
10045bd8deadSopenharmony_ci          GL_GENERIC_ATTRIB_NV, 1, 0,  // float manbearpig @ result.attrib[2]
10055bd8deadSopenharmony_ci        };
10065bd8deadSopenharmony_ci        glTransformFeedbackAttribsNV(6, attribs, GL_INTERLEAVED_ATTRIBS);
10075bd8deadSopenharmony_ci
10085bd8deadSopenharmony_ci      Another approach considered was to create a separate "mixed" mode enum,
10095bd8deadSopenharmony_ci      but to use separators and existing APIs.  That approach was close enough
10105bd8deadSopenharmony_ci      to the existing interleaved mode that we decided to use that instead.
10115bd8deadSopenharmony_ci
10125bd8deadSopenharmony_ci      One alternate approach would avoid separators by providing a new "mixed
10135bd8deadSopenharmony_ci      mode" API entry point taking an array of pointers, where each points to
10145bd8deadSopenharmony_ci      an array of varying/attribute descriptors.
10155bd8deadSopenharmony_ci
10165bd8deadSopenharmony_ci        char *heroes[] = { "batman", "robin" };
10175bd8deadSopenharmony_ci        char *villains[] = { "riddler", "joker", "manbearpig" };
10185bd8deadSopenharmony_ci        char **varyingLists[] = { heroes, villains };
10195bd8deadSopenharmony_ci        int varyingListLengths[] = { 2, 3 };
10205bd8deadSopenharmony_ci        glTransformFeedbackMixedVaryingsNV(program, 2, varyingListLengths,
10215bd8deadSopenharmony_ci                                           varyingLists);
10225bd8deadSopenharmony_ci
10235bd8deadSopenharmony_ci    (2) How do multiple vertex streams work, and how do they work in
10245bd8deadSopenharmony_ci    conjunction with transform feedback?
10255bd8deadSopenharmony_ci
10265bd8deadSopenharmony_ci     RESOLVED:  The NV_gpu_program5 and ARB_gpu_shader5 extensions
10275bd8deadSopenharmony_ci     introduce the notion of multiple vertex streams emitted in geometry
10285bd8deadSopenharmony_ci     shaders.  The following figure is a simplified picture of the vertex
10295bd8deadSopenharmony_ci     processing pipeline.
10305bd8deadSopenharmony_ci
10315bd8deadSopenharmony_ci                |
10325bd8deadSopenharmony_ci                | vertices in
10335bd8deadSopenharmony_ci                V
10345bd8deadSopenharmony_ci              vertex
10355bd8deadSopenharmony_ci              shader
10365bd8deadSopenharmony_ci                |
10375bd8deadSopenharmony_ci                V
10385bd8deadSopenharmony_ci             primitive
10395bd8deadSopenharmony_ci             assembly
10405bd8deadSopenharmony_ci                |
10415bd8deadSopenharmony_ci                +-----------+
10425bd8deadSopenharmony_ci                |           |
10435bd8deadSopenharmony_ci                |      tessellation
10445bd8deadSopenharmony_ci                |           |
10455bd8deadSopenharmony_ci                +<----------+
10465bd8deadSopenharmony_ci                |        
10475bd8deadSopenharmony_ci                +---------------+
10485bd8deadSopenharmony_ci                |               |
10495bd8deadSopenharmony_ci                |stream         V
10505bd8deadSopenharmony_ci                |0           geometry
10515bd8deadSopenharmony_ci                |             shader
10525bd8deadSopenharmony_ci                |            | | | |
10535bd8deadSopenharmony_ci                |            V V V V
10545bd8deadSopenharmony_ci                |            primitive
10555bd8deadSopenharmony_ci                |            assembly
10565bd8deadSopenharmony_ci                V            | | | |
10575bd8deadSopenharmony_ci                +------------+ | | |
10585bd8deadSopenharmony_ci                |  stream 0    | | |
10595bd8deadSopenharmony_ci                |              | | |
10605bd8deadSopenharmony_ci                |  +-----------+ | |
10615bd8deadSopenharmony_ci                |  |stream 1     | |
10625bd8deadSopenharmony_ci                |  |             | |
10635bd8deadSopenharmony_ci                |  |     stream 2| |stream 3
10645bd8deadSopenharmony_ci                |  |  +----------+ |
10655bd8deadSopenharmony_ci                |  |  |  +---------+
10665bd8deadSopenharmony_ci                |  |  |  |
10675bd8deadSopenharmony_ci                V  V  V  V
10685bd8deadSopenharmony_ci            transform feedback ----+--------> binding point 0 ----> buffer
10695bd8deadSopenharmony_ci                |                  +--------> binding point 1 ----> buffer
10705bd8deadSopenharmony_ci                | stream 0         +--------> binding point 2 ----> buffer
10715bd8deadSopenharmony_ci                +---+              +--------> binding point 3 ----> buffer
10725bd8deadSopenharmony_ci                    |
10735bd8deadSopenharmony_ci                    V
10745bd8deadSopenharmony_ci                clipping,
10755bd8deadSopenharmony_ci               rasterization,
10765bd8deadSopenharmony_ci                  etc...
10775bd8deadSopenharmony_ci
10785bd8deadSopenharmony_ci     Vertices are initially received via commands such as glDrawArrays,
10795bd8deadSopenharmony_ci     glDrawElements, glArrayElement, or glVertex.  Vertices are first 
10805bd8deadSopenharmony_ci     processed by the vertex shader and/or the fixed-function vertex pipeline
10815bd8deadSopenharmony_ci     and are assembled into primitives (points, lines, triangles, etc...).  If
10825bd8deadSopenharmony_ci     tessellation shaders are enabled, these primitives are processed by the
10835bd8deadSopenharmony_ci     programmable shaders and associated fixed-function hardware and are
10845bd8deadSopenharmony_ci     assembled into primitives.  Each primitive assembled after vertex
10855bd8deadSopenharmony_ci     shading and tessellation is said to belong to vertex stream 0, which is
10865bd8deadSopenharmony_ci     effectively the only vertex stream supported by the GL prior to this
10875bd8deadSopenharmony_ci     extension.
10885bd8deadSopenharmony_ci
10895bd8deadSopenharmony_ci     If a geometry shader is enabled, it is run on each input primitive in
10905bd8deadSopenharmony_ci     vertex stream 0.  Such primitives are consumed by the geometry shader.
10915bd8deadSopenharmony_ci     However, the geometry shader can emit new vertices, and each vertex
10925bd8deadSopenharmony_ci     emitted is directed at a specified vertex stream.  The geometry shader
10935bd8deadSopenharmony_ci     has an effective output primitive type for each vertex stream used to
10945bd8deadSopenharmony_ci     assemble the emitted vertices into primitives.  In the initial
10955bd8deadSopenharmony_ci     implementation of this extension, four such streams are supported, and
10965bd8deadSopenharmony_ci     only the POINTS output primitive type is supported if more than one
10975bd8deadSopenharmony_ci     stream is used.  When a sufficient number of vertices are emitted to a
10985bd8deadSopenharmony_ci     stream, the primitive assembly stage below the geometry shader sends the
10995bd8deadSopenharmony_ci     corresponding primitive down the appropriate primitive stream.  If
11005bd8deadSopenharmony_ci     geometry shaders are disabled, all primitives assembled by previous
11015bd8deadSopenharmony_ci     stages remain on stream 0.
11025bd8deadSopenharmony_ci
11035bd8deadSopenharmony_ci     The primitives on all streams are seen by the transform feedback stage.
11045bd8deadSopenharmony_ci     As each primitive is received on any vertex stream, the transform
11055bd8deadSopenharmony_ci     feedback stage checks the set of varyings/attributes selected for each
11065bd8deadSopenharmony_ci     binding point.  If they don't belong to the vertex stream the primitive
11075bd8deadSopenharmony_ci     came from, nothing is written to buffer attached to the binding point.
11085bd8deadSopenharmony_ci     Otherwise, transform feedbacks loops first over the vertices in the
11095bd8deadSopenharmony_ci     primitive and then the varyings/attributes used for the binding point,
11105bd8deadSopenharmony_ci     writing each selected value to the attached buffer object.  The API
11115bd8deadSopenharmony_ci     doesn't allow a single binding point to store variables from more than
11125bd8deadSopenharmony_ci     one vertex stream, so each binding point effectively has an associated
11135bd8deadSopenharmony_ci     vertex stream it reads from.
11145bd8deadSopenharmony_ci
11155bd8deadSopenharmony_ci     After transform feedback, the primitives from stream zero are passed to
11165bd8deadSopenharmony_ci     subsequent primitive processing stages (flat shading/color selection,
11175bd8deadSopenharmony_ci     clipping, rasterization); primitives on all other streams are discarded.
11185bd8deadSopenharmony_ci
11195bd8deadSopenharmony_ci    (3) How might you use transform feedback with geometry shaders and
11205bd8deadSopenharmony_ci        multiple vertex streams?
11215bd8deadSopenharmony_ci
11225bd8deadSopenharmony_ci      RESOLVED:  As a simple example, let's say you are processing triangles
11235bd8deadSopenharmony_ci      and capture both processed triangle vertices and some values that are
11245bd8deadSopenharmony_ci      computed per-primitive (e.g., facet normal).  The geometry shader
11255bd8deadSopenharmony_ci      might declare its outputs like the following:
11265bd8deadSopenharmony_ci      
11275bd8deadSopenharmony_ci        layout(stream = 0) out vec4 position;
11285bd8deadSopenharmony_ci        layout(stream = 0) out vec4 texcoord;
11295bd8deadSopenharmony_ci        layout(stream = 1) out vec4 normal;
11305bd8deadSopenharmony_ci
11315bd8deadSopenharmony_ci      "position" and "texcoord" would be per-vertex attributes written to
11325bd8deadSopenharmony_ci      vertex stream 0; "normal" would be a per-triangle facet normal.  The
11335bd8deadSopenharmony_ci      geometry shader would emit three vertices to stream zero (the processed
11345bd8deadSopenharmony_ci      input vertices) and a single vertex to stream one (the per-triangle
11355bd8deadSopenharmony_ci      data).  The transform feedback API usage for this case would be
11365bd8deadSopenharmony_ci      something like:
11375bd8deadSopenharmony_ci
11385bd8deadSopenharmony_ci        // Set up buffer objects 21 and 22 to capture data for per-vertex and
11395bd8deadSopenharmony_ci        // per primitive values.
11405bd8deadSopenharmony_ci        glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 21);
11415bd8deadSopenharmony_ci        glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 1, 22);
11425bd8deadSopenharmony_ci
11435bd8deadSopenharmony_ci        // Set up XFB to capture position and texcoord to buffer binding 
11445bd8deadSopenharmony_ci        // point 0 (buffer 21 bound), and normal to binding point 1 (buffer 
11455bd8deadSopenharmony_ci        // 22 bound).
11465bd8deadSopenharmony_ci        char *strings[] = { "position", "texcoord", "gl_NextBuffer", 
11475bd8deadSopenharmony_ci                            "normal" };
11485bd8deadSopenharmony_ci        // create <program>
11495bd8deadSopenharmony_ci        glTransformFeedbackVaryings(program, 4, strings, 
11505bd8deadSopenharmony_ci                                    GL_INTERLEAVED_ATTRIBS);
11515bd8deadSopenharmony_ci        // link <program>
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ci      A setup like:
11545bd8deadSopenharmony_ci
11555bd8deadSopenharmony_ci        char *strings[] = { "position", "gl_NextBuffer", 
11565bd8deadSopenharmony_ci                            "texcoord", "gl_NextBuffer", "normal" };
11575bd8deadSopenharmony_ci
11585bd8deadSopenharmony_ci      would capture "position" to binding point 0, "normal" to binding point
11595bd8deadSopenharmony_ci      1, and "texcoord" to binding point 2.  When a vertex is emitted to
11605bd8deadSopenharmony_ci      vertex stream 0, transform feedback would write to the first two binding
11615bd8deadSopenharmony_ci      points, but not the third.  When per-primitive data is emitted to vertex
11625bd8deadSopenharmony_ci      stream 1, transform feedback would write to the third binding point,
11635bd8deadSopenharmony_ci      but not the first two.
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci      A setup like:
11665bd8deadSopenharmony_ci
11675bd8deadSopenharmony_ci        char *strings[] = { "position", "normal", "gl_NextBuffer", 
11685bd8deadSopenharmony_ci                            "texcoord" };
11695bd8deadSopenharmony_ci
11705bd8deadSopenharmony_ci      would be illegal (LinkProgram would fail) because the first binding
11715bd8deadSopenharmony_ci      point would want to capture varyings from both vertex streams.      
11725bd8deadSopenharmony_ci
11735bd8deadSopenharmony_ci    (4) With multiple vertex streams supported by geometry shaders, the number
11745bd8deadSopenharmony_ci        of primitives generated and/or written by transform feedback is
11755bd8deadSopenharmony_ci        different for each stream.  How should we expose the ability to query
11765bd8deadSopenharmony_ci        these counts?
11775bd8deadSopenharmony_ci
11785bd8deadSopenharmony_ci      RESOLVED:  The set of primitive query object targets
11795bd8deadSopenharmony_ci      (PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN)
11805bd8deadSopenharmony_ci      is extended to contain a target for each vertex stream.  The new
11815bd8deadSopenharmony_ci      query targets PRIMITIVES_GENERATED<n> and
11825bd8deadSopenharmony_ci      TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN<n> are provided to select the
11835bd8deadSopenharmony_ci      stream number to use for a query object.  To simultaneously determine
11845bd8deadSopenharmony_ci      the number of primitives written to multiple vertex streams, multiple
11855bd8deadSopenharmony_ci      query objects should be used.  For example:
11865bd8deadSopenharmony_ci
11875bd8deadSopenharmony_ci        glBeginQuery(GL_PRIMITIVES_GENERATED0, 11);
11885bd8deadSopenharmony_ci        glBeginQuery(GL_PRIMITIVES_GENERATED1, 12);
11895bd8deadSopenharmony_ci        draw_some_stuff();
11905bd8deadSopenharmony_ci        glEndQuery(GL_PRIMITIVES_GENERATED0);
11915bd8deadSopenharmony_ci        glEndQuery(GL_PRIMITIVES_GENERATED1);
11925bd8deadSopenharmony_ci
11935bd8deadSopenharmony_ci      will record the number of primitives generated on vertex stream zero by
11945bd8deadSopenharmony_ci      "draw_some_stuff()" to query object 11 and the number of primitives
11955bd8deadSopenharmony_ci      generated on vertex stream one to query object 12.
11965bd8deadSopenharmony_ci
11975bd8deadSopenharmony_ci      Two other API choices were considered but rejected.  One choice was to
11985bd8deadSopenharmony_ci      define a query target to have multiple query object attachment points
11995bd8deadSopenharmony_ci      (one for each vertex stream).  This would require adding
12005bd8deadSopenharmony_ci      BeginQueryIndexedNV, EndQueryIndexedNV, and GetQueryIndexedNV functions,
12015bd8deadSopenharmony_ci      and modifying all the existing query language to allow for this
12025bd8deadSopenharmony_ci      possibility.  We chose instead to replicate enumerants to avoid adding
12035bd8deadSopenharmony_ci      the new API and spec language.  We expect that 8 streams should be
12045bd8deadSopenharmony_ci      sufficient.
12055bd8deadSopenharmony_ci
12065bd8deadSopenharmony_ci      A second choice was to extend the result values of the existing
12075bd8deadSopenharmony_ci      primitive query objects from a single integer to an <n>-component
12085bd8deadSopenharmony_ci      vector, where <n> is the total number of vertex streams supported.  New
12095bd8deadSopenharmony_ci      query object mechanisms could be provided to query an individual element
12105bd8deadSopenharmony_ci      in that vector.  It might have been possible to define the existing
12115bd8deadSopenharmony_ci      query to return the entire vector integer at once, but that could be a
12125bd8deadSopenharmony_ci      problem for applications that used the old API on new hardware and
12135bd8deadSopenharmony_ci      allocated space for only a single integer in its return buffer.
12145bd8deadSopenharmony_ci
12155bd8deadSopenharmony_ci    (5) How do the EXT- and NV-style transform feedback APIs interact with
12165bd8deadSopenharmony_ci        each other?
12175bd8deadSopenharmony_ci
12185bd8deadSopenharmony_ci      RESOLVED:  The EXT-style API requires that you provide a list of
12195bd8deadSopenharmony_ci      varyings prior to linking a program object, and does not provide the
12205bd8deadSopenharmony_ci      ability to change the set without re-linking.  With the NV-style API,
12215bd8deadSopenharmony_ci      the set of varyings to record is cleared when the program is linked,
12225bd8deadSopenharmony_ci      but you can re-specify the set of varyings to record multiple times
12235bd8deadSopenharmony_ci      after linking without any re-link.
12245bd8deadSopenharmony_ci
12255bd8deadSopenharmony_ci      Fortunately, the two APIs fit together nicely.  When both extensions are
12265bd8deadSopenharmony_ci      supported, the state set by EXT is defined to specify the values to
12275bd8deadSopenharmony_ci      capture when the program is next linked.  If no variables are set using
12285bd8deadSopenharmony_ci      the EXT-style API, the transform feedback state is reset on a link, as
12295bd8deadSopenharmony_ci      called for by the NV-style API.  After linking, the NV-style API can be
12305bd8deadSopenharmony_ci      used to change the variables to capture, and such changes don't collide
12315bd8deadSopenharmony_ci      with any EXT-style state changes, which would require a re-link to take
12325bd8deadSopenharmony_ci      effect.
12335bd8deadSopenharmony_ci
12345bd8deadSopenharmony_ci    (6) What value should we use when defining the separator token for
12355bd8deadSopenharmony_ci        NV-style transform feedback APIs?
12365bd8deadSopenharmony_ci
12375bd8deadSopenharmony_ci      RESOLVED:  Unlike most existing GL defines, as we've chosen the value
12385bd8deadSopenharmony_ci      "-2".  Both the GLSL and assembly NV-style APIs take arrays of signed
12395bd8deadSopenharmony_ci      integers.  For the GLSL API, array entries are integers.  By convention,
12405bd8deadSopenharmony_ci      the "location" an invalid variable name is "-1", with valid locations
12415bd8deadSopenharmony_ci      returned as non-negative integers.  For the assembly-style API, the
12425bd8deadSopenharmony_ci      attribute types are just numbers, with nothing requiring that the number
12435bd8deadSopenharmony_ci      be positive or negative.  The choice of "-2" can be used for both API
12445bd8deadSopenharmony_ci      styles, and guarantees that the separator separator will not collide
12455bd8deadSopenharmony_ci      with a valid GLSL varying location or the "invalid varying" marker of
12465bd8deadSopenharmony_ci      -1.
12475bd8deadSopenharmony_ci
12485bd8deadSopenharmony_ci    (7) How do multiple vertex streams interact with the
12495bd8deadSopenharmony_ci        DrawTransformFeedback() API added by the ARB_transform_feedback2
12505bd8deadSopenharmony_ci        extension?
12515bd8deadSopenharmony_ci
12525bd8deadSopenharmony_ci      RESOLVED:  Prior to this extension, there was only one vertex stream,
12535bd8deadSopenharmony_ci      so the vertex count to be used by DrawTransformFeedback() was
12545bd8deadSopenharmony_ci      unambiguous.  With multiple streams, there may be different vertex
12555bd8deadSopenharmony_ci      counts written to each buffer.  We will add a new
12565bd8deadSopenharmony_ci      DrawTransformFeedbackStream command to draw using the number of
12575bd8deadSopenharmony_ci      vertices recorded to buffers for the specified vertex stream during the
12585bd8deadSopenharmony_ci      last transform feedback operation.  The existing DrawTransformFeedback
12595bd8deadSopenharmony_ci      command is defined to use the number of vertices recorded to buffers for
12605bd8deadSopenharmony_ci      vertex stream zero.
12615bd8deadSopenharmony_ci
12625bd8deadSopenharmony_ci      We chose an API that makes the vertex counts for all streams used by a
12635bd8deadSopenharmony_ci      transform feedback object available for DrawTransformFeedback
12645bd8deadSopenharmony_ci      operations.  We also considered an API that would have required the user
12655bd8deadSopenharmony_ci      to select a single stream prior to calling BeginTransformFeedback,
12665bd8deadSopenharmony_ci      where only the vertex count from that stream would be available for
12675bd8deadSopenharmony_ci      subsequent operations.  We decided that there might be a usage case for
12685bd8deadSopenharmony_ci      an application that sorted its vertices into multiple streams, but still
12695bd8deadSopenharmony_ci      wanted to draw them all in a subsequent pass.  To do this, all vertex
12705bd8deadSopenharmony_ci      counts would have to be made available.
12715bd8deadSopenharmony_ci
12725bd8deadSopenharmony_ci    (8) What happens with the DrawTransformFeedback() API if no complete
12735bd8deadSopenharmony_ci        primitives were emitted to the selected stream?  What if complete
12745bd8deadSopenharmony_ci        primitives were emitted to the stream but no varyings from that stream
12755bd8deadSopenharmony_ci        were selected for transform feedback?
12765bd8deadSopenharmony_ci
12775bd8deadSopenharmony_ci      RESOLVED:  The vertex count used by DrawTransformFeedbackNV() is the
12785bd8deadSopenharmony_ci      number of vertices recorded from the selected stream.  If no primitives
12795bd8deadSopenharmony_ci      are emitted to that stream, the vertex count will be zero.  If the set
12805bd8deadSopenharmony_ci      of varyings selected for transform feedback does not include any
12815bd8deadSopenharmony_ci      belonging to the specified stream, nothing will be recorded when
12825bd8deadSopenharmony_ci      primitives are emitted to that stream, and the corresponding vertex
12835bd8deadSopenharmony_ci      count will be zero.
12845bd8deadSopenharmony_ci
12855bd8deadSopenharmony_ci    (9) The new extension to interleaved mode provides increased flexibility
12865bd8deadSopenharmony_ci        on how varyings or attributes can be assigned to individual buffers
12875bd8deadSopenharmony_ci        for transform feedback.  How can you query which varying/attribute is
12885bd8deadSopenharmony_ci        assigned to which buffer?
12895bd8deadSopenharmony_ci
12905bd8deadSopenharmony_ci      RESOLVED:  The transform feedback attribute enumeration/query
12915bd8deadSopenharmony_ci      functions will return separator values in the positions where they were
12925bd8deadSopenharmony_ci      originally provided.  An application can figure out the buffer a varying
12935bd8deadSopenharmony_ci      goes to by counting the number of separators prior to an attribute.  It
12945bd8deadSopenharmony_ci      would be possible to provide a utility API that says "give me the <n>th
12955bd8deadSopenharmony_ci      varying recorded to binding point <m>", but simply returning separators
12965bd8deadSopenharmony_ci      seems usable enough.
12975bd8deadSopenharmony_ci
12985bd8deadSopenharmony_ci    (10) Previous transform feedback specs disallowed recording the same
12995bd8deadSopenharmony_ci         varying/attribute more than once.  Should we continue that
13005bd8deadSopenharmony_ci         restriction?  In particular, this may be problematic for assembly
13015bd8deadSopenharmony_ci         shaders using multiple vertex streams that wish to use the same
13025bd8deadSopenharmony_ci         attribute locations in multiple streams.
13035bd8deadSopenharmony_ci
13045bd8deadSopenharmony_ci      RESOLVED:  We should probably allow recording the same attribute more
13055bd8deadSopenharmony_ci      than once in some form, if for no other reason than to handle the
13065bd8deadSopenharmony_ci      multi-stream assembly case described in the question. Resolved by 
13075bd8deadSopenharmony_ci      allowing this for TransformFeedbackStreamAttribsNV.
13085bd8deadSopenharmony_ci
13095bd8deadSopenharmony_ci    (11) Should we provide the ability to leave holes in the data emitted by
13105bd8deadSopenharmony_ci         transform feedback?  This would provide applications the ability to
13115bd8deadSopenharmony_ci         combine captured vertex attributes of multiple passes into a single
13125bd8deadSopenharmony_ci         buffer object.
13135bd8deadSopenharmony_ci
13145bd8deadSopenharmony_ci      RESOLVED:  Yes.  This spec extended the separator notion added to
13155bd8deadSopenharmony_ci      write to multiple buffers included in interleaved mode to include
13165bd8deadSopenharmony_ci      special "spacer" markers (e.g., "skip 4 components") as well.  Consider
13175bd8deadSopenharmony_ci      the following example in the EXT_transform_feedback API:
13185bd8deadSopenharmony_ci
13195bd8deadSopenharmony_ci        char *names[] = { "batman", "gl_SkipComponents3", "robin", 
13205bd8deadSopenharmony_ci                          "gl_NextBuffer", "riddler", "gl_SkipComponents2", 
13215bd8deadSopenharmony_ci                          "joker", "manbearpig" };
13225bd8deadSopenharmony_ci        glTransformFeedbackVaryings(program, 8, names,
13235bd8deadSopenharmony_ci                                    GL_INTERLEAVED_ATTRIBS);
13245bd8deadSopenharmony_ci
13255bd8deadSopenharmony_ci      "gl_SkipComponents<N>" is a special marker to indicate that <N> words
13265bd8deadSopenharmony_ci      should be skipped when recording values.  In this case, each vertex
13275bd8deadSopenharmony_ci      written to the first binding point would start with the value of
13285bd8deadSopenharmony_ci      "batman", then leave 3 components worth of data unmodified, and then
13295bd8deadSopenharmony_ci      finish with the value of "robin".
13305bd8deadSopenharmony_ci
13315bd8deadSopenharmony_ci      For the NV_transform_feedback APIs, the special values
13325bd8deadSopenharmony_ci      GL_SKIP_COMPONENTS1_NV through GL_SKIP_COMPONENTS4_NV are provided.  We
13335bd8deadSopenharmony_ci      chose to provide four tokens even for the assembly API, which could have
13345bd8deadSopenharmony_ci      used a GL_SKIP_COMPONENTS_NV token with a separate count value
13355bd8deadSopenharmony_ci      containing 1-4.  However, the GLSL-based API needs separate tokens
13365bd8deadSopenharmony_ci      because there is no way to pass a component count separately.  We
13375bd8deadSopenharmony_ci      decided to use the same tokens for both APIs to minimize confusion.
13385bd8deadSopenharmony_ci
13395bd8deadSopenharmony_ci    (12) Now that you can write to more than one buffer, what does
13405bd8deadSopenharmony_ci         MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS now mean?
13415bd8deadSopenharmony_ci
13425bd8deadSopenharmony_ci      RESOLVED:  This query will return the number of components that may be
13435bd8deadSopenharmony_ci      written to a single buffer in interleaved mode.  Since interleaved mode
13445bd8deadSopenharmony_ci      now supports multiple buffers, the total number of components that may
13455bd8deadSopenharmony_ci      be written in the single pass is the product of this per-buffer limit
13465bd8deadSopenharmony_ci      and the number of buffers that may be written at once.
13475bd8deadSopenharmony_ci
13485bd8deadSopenharmony_ci      The state table entry in the EXT_transform_feedback specification
13495bd8deadSopenharmony_ci      actually defined it this way, using the language "max number of
13505bd8deadSopenharmony_ci      components write to a single buffer in interleaved mode."
13515bd8deadSopenharmony_ci
13525bd8deadSopenharmony_ci    (13) How does rasterization work when vertices may be emitted to multiple
13535bd8deadSopenharmony_ci         streams?
13545bd8deadSopenharmony_ci
13555bd8deadSopenharmony_ci      RESOLVED:  Primitives sent to stream zero are the only ones rasterized.
13565bd8deadSopenharmony_ci      When primitives are received on any other streams, they are discarded
13575bd8deadSopenharmony_ci      after any transform feedback operations involving that stream are
13585bd8deadSopenharmony_ci      completed.
13595bd8deadSopenharmony_ci      
13605bd8deadSopenharmony_ci      When using GLSL geometry shaders, stream zero is the only one that
13615bd8deadSopenharmony_ci      makes sense for rasterization, because the geometry shader output
13625bd8deadSopenharmony_ci      "gl_Position" is associated with stream zero.
13635bd8deadSopenharmony_ci
13645bd8deadSopenharmony_ci      We considered building a mechanism for rasterization to select from any
13655bd8deadSopenharmony_ci      of the vertex streams, but decided not to include such a feature since
13665bd8deadSopenharmony_ci      it would require some way to designate a position for each stream or
13675bd8deadSopenharmony_ci      potentially assign "gl_Position" to all streams.
13685bd8deadSopenharmony_ci
13695bd8deadSopenharmony_ci    (15) How might you use transform feedback with assembly geometry programs
13705bd8deadSopenharmony_ci         and multiple vertex streams?
13715bd8deadSopenharmony_ci
13725bd8deadSopenharmony_ci      RESOLVED:  As in issue (3), let's say you are processing triangles and
13735bd8deadSopenharmony_ci      capture both processed triangle vertices and some values that are
13745bd8deadSopenharmony_ci      computed per-primitive (e.g., facet normal).  The geometry program might
13755bd8deadSopenharmony_ci      declare outputs like the following:
13765bd8deadSopenharmony_ci      
13775bd8deadSopenharmony_ci        RESULT position = result.position;          # used in stream 0
13785bd8deadSopenharmony_ci        RESULT texcoord = result.texcoord[0];       # used in stream 0
13795bd8deadSopenharmony_ci        RESULT normal = result.texcoord[0];         # used in stream 1
13805bd8deadSopenharmony_ci
13815bd8deadSopenharmony_ci      "position" and "texcoord" would be per-vertex attributes written to
13825bd8deadSopenharmony_ci      vertex stream 0; "normal" would be a per-triangle facet normal.  The
13835bd8deadSopenharmony_ci      geometry program would emit three vertices to stream zero (the processed
13845bd8deadSopenharmony_ci      input vertices) and a single vertex to stream one (the per-triangle
13855bd8deadSopenharmony_ci      data).  The transform feedback API usage for this case would be:
13865bd8deadSopenharmony_ci
13875bd8deadSopenharmony_ci        int attribs[] = {
13885bd8deadSopenharmony_ci          GL_TEXTURE_COORD_NV, 3, 0,   // vec3 normal @ result.texcoord[0]
13895bd8deadSopenharmony_ci          NEXT_BUFFER_NV, 0, 0,
13905bd8deadSopenharmony_ci          GL_POSITION,         4, 0,   // vec4 position @ result.position
13915bd8deadSopenharmony_ci          GL_TEXTURE_COORD_NV, 2, 0,   // vec2 texcoord @ result.texcoord[0]
13925bd8deadSopenharmony_ci        };
13935bd8deadSopenharmony_ci        int streams[] = { 1, 0 };
13945bd8deadSopenharmony_ci        glTransformFeedbackStreamAttribsNV(3, attribs, 2, streams,
13955bd8deadSopenharmony_ci                                           GL_INTERLEAVED_ATTRIBS);
13965bd8deadSopenharmony_ci
13975bd8deadSopenharmony_ci      streams[0] is 1, which means that only the vertices emitted to stream
13985bd8deadSopenharmony_ci      one will be written to the first binding point (where "normal" goes).
13995bd8deadSopenharmony_ci      streams[1] is 0, which means that only the vertices emitted to stream
14005bd8deadSopenharmony_ci      zero will be written to the second binding point (where "position" and
14015bd8deadSopenharmony_ci      "texcoord" go).
14025bd8deadSopenharmony_ci
14035bd8deadSopenharmony_ci    (17) How does this extension interact with the old-school feedback and
14045bd8deadSopenharmony_ci         select modes set by glRenderMode?
14055bd8deadSopenharmony_ci
14065bd8deadSopenharmony_ci      RESOLVED:  This spec provides multiple vertex streams, where only
14075bd8deadSopenharmony_ci      stream 0 is sent to the rasterizer.  Feedback and select modes will
14085bd8deadSopenharmony_ci      only operate on primitives sent to the stream 0.  Primitives sent to
14095bd8deadSopenharmony_ci      other streams are ignored, after they are optionally captured in
14105bd8deadSopenharmony_ci      transform feedback mode.
14115bd8deadSopenharmony_ci
14125bd8deadSopenharmony_ci    (18) How do transform feedback vertex streams interact with separate
14135bd8deadSopenharmony_ci         shader objects (EXT_separate_shader_objects)?
14145bd8deadSopenharmony_ci
14155bd8deadSopenharmony_ci      RESOLVED:  The data captured in transform feedback are produced by the
14165bd8deadSopenharmony_ci      last active shader stage prior to the transform feedback stage.  If
14175bd8deadSopenharmony_ci      there is an active program object for the geometry shader stage, and
14185bd8deadSopenharmony_ci      that program has a geometry shader that emits vertices to multiple
14195bd8deadSopenharmony_ci      streams, such a configuration behaves exactly like a similar
14205bd8deadSopenharmony_ci      configuration using a single program object.
14215bd8deadSopenharmony_ci
14225bd8deadSopenharmony_ci
14235bd8deadSopenharmony_ciRevision History
14245bd8deadSopenharmony_ci
14255bd8deadSopenharmony_ci    Rev.    Date     Author    Changes
14265bd8deadSopenharmony_ci    ----  --------   --------  -----------------------------------------
14275bd8deadSopenharmony_ci    12    03/23/2010 pbrown    Update issue (13) and add issue (18) from
14285bd8deadSopenharmony_ci                               issues left behind in the NV_gpu_shader5 when
14295bd8deadSopenharmony_ci                               specs were refactored.
14305bd8deadSopenharmony_ci
14315bd8deadSopenharmony_ci    11    02/04/2010 gsellers  Add indexed query entry points.
14325bd8deadSopenharmony_ci                               Remove indexed enums.
14335bd8deadSopenharmony_ci
14345bd8deadSopenharmony_ci    10    02/02/2010 pbrown    Clarify that "gl_SkipComponents*" is in
14355bd8deadSopenharmony_ci                               units of "float" (bug 5863).
14365bd8deadSopenharmony_ci
14375bd8deadSopenharmony_ci     9    01/20/2010 pbrown    Update extension interaction references 
14385bd8deadSopenharmony_ci                               to use ARB_gpu_shader5 (instead of "EXT").
14395bd8deadSopenharmony_ci
14405bd8deadSopenharmony_ci     8    01/14/2010 Jon Leech Update errors for out of range vertex 
14415bd8deadSopenharmony_ci                               streams passed to
14425bd8deadSopenharmony_ci                               DrawTransformFeedbackStream and
14435bd8deadSopenharmony_ci                               BeginQuery to match core specification 
14445bd8deadSopenharmony_ci                               (Bug 5896).
14455bd8deadSopenharmony_ci
14465bd8deadSopenharmony_ci     7    12/07/2009 jbolz     Rename EXT->ARB.
14475bd8deadSopenharmony_ci
14485bd8deadSopenharmony_ci     6    10/22/2009 jbolz     Close unresolved issues, with no functional
14495bd8deadSopenharmony_ci                               changes.
14505bd8deadSopenharmony_ci
14515bd8deadSopenharmony_ci     5    10/22/2009 jbolz     Incorporated fixes from bmerry. Changed 
14525bd8deadSopenharmony_ci                               GetTransformFeedbackVarying to not return
14535bd8deadSopenharmony_ci                               length=0 for separators.
14545bd8deadSopenharmony_ci
14555bd8deadSopenharmony_ci     4    09/30/2009 pbrown    Removed tessellation shader dependencies,
14565bd8deadSopenharmony_ci                               including language describing capture of
14575bd8deadSopenharmony_ci                               patches.  Capture of patches will only be
14585bd8deadSopenharmony_ci                               supported via NV_gpu_shader5.
14595bd8deadSopenharmony_ci
14605bd8deadSopenharmony_ci     3    09/17/2009 pdaniell  Move PATCHES_EXT into NV dependencies.
14615bd8deadSopenharmony_ci                               Remove VertexDrawStreamEXT as only stream 0
14625bd8deadSopenharmony_ci                               is output to the rasterizer.
14635bd8deadSopenharmony_ci
14645bd8deadSopenharmony_ci     2    09/14/2009 pdaniell  EXTify. Move NV stuff into dependencies.
14655bd8deadSopenharmony_ci
14665bd8deadSopenharmony_ci     1               pbrown    Internal revisions.
14675bd8deadSopenharmony_ci
1468