15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_geometry_program4
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    (none)
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciStatus
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Shipping for GeForce 8 Series (November 2006)
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciVersion
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Last Modified Date:         12/14/09
205bd8deadSopenharmony_ci    NVIDIA Revision:            13
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciNumber
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    323
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciDependencies
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    OpenGL 1.1 is required.
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    This extension is written against the OpenGL 2.0 specification.
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    NV_gpu_program4 is required.  This extension is supported if
335bd8deadSopenharmony_ci    "GL_NV_gpu_program4" is found in the extension string.
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    EXT_framebuffer_object interacts with this extension.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    EXT_framebuffer_blit interacts with this extension.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    EXT_texture_array interacts with this extension.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    ARB_texture_rectangle trivially affects the definition of this extension.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    EXT_texture_buffer_object trivially affects the definition of this
445bd8deadSopenharmony_ci    extension.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    NV_primitive_restart trivially affects the definition of this extension.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciOverview
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    NV_geometry_program4 defines a new type of program available to be run on
515bd8deadSopenharmony_ci    the GPU, called a geometry program.  Geometry programs are run on full
525bd8deadSopenharmony_ci    primitives after vertices are transformed, but prior to flat shading and
535bd8deadSopenharmony_ci    clipping.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    A geometry program begins with a single primitive - a point, line, or
565bd8deadSopenharmony_ci    triangle.  Quads and polygons are allowed, but are decomposed into
575bd8deadSopenharmony_ci    individual triangles prior to geometry program execution.  It can read the
585bd8deadSopenharmony_ci    attributes of any of the vertex in the primitive and use them to generate
595bd8deadSopenharmony_ci    new primitives.  A geometry program has a fixed output primitive type,
605bd8deadSopenharmony_ci    either a point, a line strip, or a triangle strip.  It emits vertices
615bd8deadSopenharmony_ci    (using the EMIT opcode) to define the output primitive.  The attributes of
625bd8deadSopenharmony_ci    emitted vertices are specified by writing to the same set of result
635bd8deadSopenharmony_ci    bindings (e.g., "result.position") provided for vertex programs.
645bd8deadSopenharmony_ci    Additionally, a geometry program can emit multiple disconnected primitives
655bd8deadSopenharmony_ci    by using the ENDPRIM opcode, which is roughly equivalent to calling End
665bd8deadSopenharmony_ci    and then Begin again.  The primitives emitted by the geometry program are
675bd8deadSopenharmony_ci    then clipped and then processed like an equivalent OpenGL primitive
685bd8deadSopenharmony_ci    specified by the application.
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    This extension provides four additional primitive types:  lines with
715bd8deadSopenharmony_ci    adjacency, line strips with adjacency, separate triangles with adjacency,
725bd8deadSopenharmony_ci    and triangle strips with adjacency.  Some of the vertices specified in
735bd8deadSopenharmony_ci    these new primitive types are not part of the ordinary primitives.
745bd8deadSopenharmony_ci    Instead, they represent neighboring vertices that are adjacent to the two
755bd8deadSopenharmony_ci    line segment end points (lines/strips) or the three triangle edges
765bd8deadSopenharmony_ci    (triangles/tstrips).  These "adjacency" vertices can be accessed by
775bd8deadSopenharmony_ci    geometry programs and used to match up the outputs of the geometry program
785bd8deadSopenharmony_ci    with those of neighboring primitives.
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    Additionally, geometry programs allow for layered rendering, where entire
815bd8deadSopenharmony_ci    three-dimensional, cube map, or array textures (EXT_texture_array) can be
825bd8deadSopenharmony_ci    bound to the current framebuffer.  Geometry programs can use the
835bd8deadSopenharmony_ci    "result.layer" binding to select a layer or cube map face to render to.
845bd8deadSopenharmony_ci    Each primitive emitted by such a geometry program is rendered to the layer
855bd8deadSopenharmony_ci    taken from its provoking vertex.
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    Since geometry programs expect a specific input primitive type, an error
885bd8deadSopenharmony_ci    will occur if the application presents primtives of a different type.  For
895bd8deadSopenharmony_ci    example, if an enabled geometry program expects points, an error will
905bd8deadSopenharmony_ci    occur at Begin() time, if a primitive mode of TRIANGLES is specified.
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ciNew Procedures and Functions
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    void ProgramVertexLimitNV(enum target, int limit);
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    void FramebufferTextureEXT(enum target, enum attachment,
975bd8deadSopenharmony_ci                               uint texture, int level);
985bd8deadSopenharmony_ci    void FramebufferTextureLayerEXT(enum target, enum attachment,
995bd8deadSopenharmony_ci                                    uint texture, int level, int layer);
1005bd8deadSopenharmony_ci    void FramebufferTextureFaceEXT(enum target, enum attachment,
1015bd8deadSopenharmony_ci                                   uint texture, int level, enum face);
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ciNew Tokens
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, by
1065bd8deadSopenharmony_ci    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
1075bd8deadSopenharmony_ci    GetDoublev, and by the <target> parameter of ProgramStringARB,
1085bd8deadSopenharmony_ci    BindProgramARB, ProgramEnvParameter4[df][v]ARB,
1095bd8deadSopenharmony_ci    ProgramLocalParameter4[df][v]ARB, GetProgramEnvParameter[df]vARB, 
1105bd8deadSopenharmony_ci    GetProgramLocalParameter[df]vARB, GetProgramivARB and
1115bd8deadSopenharmony_ci    GetProgramStringARB:
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        GEOMETRY_PROGRAM_NV                             0x8C26
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramivARB:
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci        MAX_PROGRAM_OUTPUT_VERTICES_NV                  0x8C27
1185bd8deadSopenharmony_ci        MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV          0x8C28
1195bd8deadSopenharmony_ci        GEOMETRY_VERTICES_OUT_EXT                       0x8DDA
1205bd8deadSopenharmony_ci        GEOMETRY_INPUT_TYPE_EXT                         0x8DDB
1215bd8deadSopenharmony_ci        GEOMETRY_OUTPUT_TYPE_EXT                        0x8DDC
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
1245bd8deadSopenharmony_ci    and GetDoublev:
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci        MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT            0x8C29
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    Accepted by the <mode> parameter of Begin, DrawArrays, MultiDrawArrays,
1295bd8deadSopenharmony_ci    DrawElements, MultiDrawElements, and DrawRangeElements:
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci        LINES_ADJACENCY_EXT                             0xA
1325bd8deadSopenharmony_ci        LINE_STRIP_ADJACENCY_EXT                        0xB
1335bd8deadSopenharmony_ci        TRIANGLES_ADJACENCY_EXT                         0xC
1345bd8deadSopenharmony_ci        TRIANGLE_STRIP_ADJACENCY_EXT                    0xD
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    Returned by CheckFramebufferStatusEXT:
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci        FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT        0x8DA8
1395bd8deadSopenharmony_ci        FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT          0x8DA9
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    Accepted by the <pname> parameter of
1425bd8deadSopenharmony_ci    GetFramebufferAttachmentParameterivEXT:
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_LAYERED_EXT              0x8DA7
1455bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT        0x8CD4
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
1485bd8deadSopenharmony_ci    the <pname> parameter of GetIntegerv, GetFloatv, GetDoublev, and
1495bd8deadSopenharmony_ci    GetBooleanv:
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        PROGRAM_POINT_SIZE_EXT                          0x8642
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    (Note:  The "EXT" tokens above are shared with the EXT_geometry_shader4
1545bd8deadSopenharmony_ci    extension.)
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    (Note:  FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the
1575bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in
1585bd8deadSopenharmony_ci    EXT_framebuffer_object.  This extension generalizes the notion of
1595bd8deadSopenharmony_ci    "<zoffset>" to include layers of an array texture.)
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    (Note:  PROGRAM_POINT_SIZE_EXT is simply an alias for the
1625bd8deadSopenharmony_ci    VERTEX_PROGRAM_POINT_SIZE token provided in OpenGL 2.0, which is itself an
1635bd8deadSopenharmony_ci    alias for VERTEX_PROGRAM_POINT_SIZE_ARB provided by ARB_vertex_program.
1645bd8deadSopenharmony_ci    Program-computed point sizes can be enabled if geometry programs are
1655bd8deadSopenharmony_ci    enabled, even if no vertex program is used.)
1665bd8deadSopenharmony_ci        
1675bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.5 Specification (OpenGL Operation)
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    Modify Section 2.6.1 (Begin and End Objects), p. 13
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    (Add to end of section, p. 18)
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    (add figure)
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci        1 - - - 2----->3 - - - 4     1 - - - 2--->3--->4--->5 - - - 6
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci        5 - - - 6----->7 - - - 8
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci               (a)                             (b)
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci      Figure X.1 (a) Lines with adjacency, (b) Line strip with adjacency. 
1825bd8deadSopenharmony_ci      The vertices connected with solid lines belong to the main primitives;
1835bd8deadSopenharmony_ci      the vertices connected by dashed lines are the adjacent vertices that
1845bd8deadSopenharmony_ci      may be used in a geometry program.
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    Lines with Adjacency
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    Lines with adjacency are independent line segments where each endpoint has
1895bd8deadSopenharmony_ci    a corresponding "adjacent" vertex that can be accessed by a geometry
1905bd8deadSopenharmony_ci    program (Section 2.15).  If geometry programs are disabled, the "adjacent"
1915bd8deadSopenharmony_ci    vertices are ignored.
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    A line segment is drawn from the 4i + 2nd vertex to the 4i + 3rd vertex
1945bd8deadSopenharmony_ci    for each i = 0, 1, ... , n-1, where there are 4n+k vertices between the
1955bd8deadSopenharmony_ci    Begin and End.  k is either 0, 1, 2, or 3; if k is not zero, the final k
1965bd8deadSopenharmony_ci    vertices are ignored.  For line segment i, the 4i + 1st and 4i + 4th
1975bd8deadSopenharmony_ci    vertices are considered adjacent to the 4i + 2nd and 4i + 3rd vertices,
1985bd8deadSopenharmony_ci    respectively.  See Figure X.1.
1995bd8deadSopenharmony_ci
2005bd8deadSopenharmony_ci    Lines with adjacency are generated by calling Begin with the argument
2015bd8deadSopenharmony_ci    value LINES_ADJACENCY_EXT.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    Line Strips with Adjacency
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    Line strips with adjacency are similar to line strips, except that each
2065bd8deadSopenharmony_ci    line segment has a pair of adjacent vertices that can be accessed by
2075bd8deadSopenharmony_ci    geometry programs (Section 2.15).  If geometry programs are disabled, the
2085bd8deadSopenharmony_ci    "adjacent" vertices are ignored.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    A line segment is drawn from the i + 2nd vertex to the i + 3rd vertex for
2115bd8deadSopenharmony_ci    each i = 0, 1, ..., n-1, where there are n+3 vertices between the Begin
2125bd8deadSopenharmony_ci    and End.  If there are fewer than four vertices between a Begin and End,
2135bd8deadSopenharmony_ci    all vertices are ignored.  For line segment i, the i + 1st and i + 4th
2145bd8deadSopenharmony_ci    vertices are considered adjacent to the i + 2nd and i + 3rd vertices,
2155bd8deadSopenharmony_ci    respectively.  See Figure X.1.
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    Line strips with adjacency are generated by calling Begin with the
2185bd8deadSopenharmony_ci    argument value LINE_STRIP_ADJACENCY_EXT.
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    (add figure)
2215bd8deadSopenharmony_ci                   2 - - - 3 - - - 4     8 - - - 9 - - - 10
2225bd8deadSopenharmony_ci                           ^\                    ^\
2235bd8deadSopenharmony_ci                     \     | \     |       \     | \     |
2245bd8deadSopenharmony_ci                           |  \                  |  \
2255bd8deadSopenharmony_ci                       \   |   \   |         \   |   \   |
2265bd8deadSopenharmony_ci                           |    \                |    \
2275bd8deadSopenharmony_ci                         \ |     \ |           \ |     \ |
2285bd8deadSopenharmony_ci                           |      v              |      v
2295bd8deadSopenharmony_ci                           1<------5             7<------11
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci                             \     |               \     |
2325bd8deadSopenharmony_ci
2335bd8deadSopenharmony_ci                               \   |                 \   |
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci                                 \ |                   \ |
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci                                   6                     12
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci      Figure X.2 Triangles with adjacency.  The vertices connected with solid
2405bd8deadSopenharmony_ci      lines belong to the main primitive; the vertices connected by dashed
2415bd8deadSopenharmony_ci      lines are the adjacent vertices that may be used in a geometry program.
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    Triangles with Adjacency
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    Triangles with adjacency are similar to separate triangles, except that
2465bd8deadSopenharmony_ci    each triangle edge has an adjacent vertex that can be accessed by geometry
2475bd8deadSopenharmony_ci    programs (Section 2.15).  If geometry programs are disabled, the
2485bd8deadSopenharmony_ci    "adjacent" vertices are ignored.
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    The 6i + 1st, 6i + 3rd, and 6i + 5th vertices (in that order) determine a
2515bd8deadSopenharmony_ci    triangle for each i = 0, 1, ..., n-1, where there are 6n+k vertices
2525bd8deadSopenharmony_ci    between the Begin and End.  k is either 0, 1, 2, 3, 4, or 5; if k is
2535bd8deadSopenharmony_ci    non-zero, the final k vertices are ignored.  For triangle i, the i + 2nd,
2545bd8deadSopenharmony_ci    i + 4th, and i + 6th vertices are considered adjacent to edges from the i
2555bd8deadSopenharmony_ci    + 1st to the i + 3rd, from the i + 3rd to the i + 5th, and from the i +
2565bd8deadSopenharmony_ci    5th to the i + 1st vertices, respectively.  See Figure X.2.
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci    Triangles with adjacency are generated by calling Begin with the argument
2595bd8deadSopenharmony_ci    value TRIANGLES_ADJACENCY_EXT.
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    (add figure)
2625bd8deadSopenharmony_ci                                  6                     6
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci                                  | \                   | \
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci                                  |   \                 |   \
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci                                  |     \               |     \
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci      2 - - - 3- - - >6   2 - - - 3------>7     2 - - - 3------>7- - - 10
2715bd8deadSopenharmony_ci              ^\                  ^^      |             ^^      ^^      |
2725bd8deadSopenharmony_ci        \     | \     |     \     | \     | \     \     | \     | \
2735bd8deadSopenharmony_ci              |  \                |  \    |             |  \    |  \    |
2745bd8deadSopenharmony_ci          \   |   \   |       \   |   \   |   \     \   |   \   |   \
2755bd8deadSopenharmony_ci              |    \              |    \  |             |    \  |    \  |
2765bd8deadSopenharmony_ci            \ |     \ |         \ |     \ |     \     \ |     \ |     \
2775bd8deadSopenharmony_ci              |      v            |      vv             |      vv      v|
2785bd8deadSopenharmony_ci              1<------5           1<------5 - - - 8     1<------5<------9
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci                \     |             \     |               \     | \     |
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci                  \   |               \   |                 \   |   \   |
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci                    \ |                 \ |                   \ |     \ |
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci                      4                   4                     4       8
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci                                   6       10
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci                                   | \     | \
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ci                                   |   \   |   \
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci                                   |     \ |     \
2965bd8deadSopenharmony_ci                           2 - - - 3------>7------>11
2975bd8deadSopenharmony_ci                                   ^^      ^^      |
2985bd8deadSopenharmony_ci                             \     | \     | \     | \
2995bd8deadSopenharmony_ci                                   |  \    |  \    |
3005bd8deadSopenharmony_ci                               \   |   \   |   \   |   \
3015bd8deadSopenharmony_ci                                   |    \  |    \  |
3025bd8deadSopenharmony_ci                                 \ |     \ |     \ |     \
3035bd8deadSopenharmony_ci                                   |      vv      vv
3045bd8deadSopenharmony_ci                                   1<------5<------9 - - - 12
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci                                     \     | \     |
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci                                       \   |   \   |
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ci                                         \ |     \ |
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci                                           4       8
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci      Figure X.3 Triangle strips with adjacency.  The vertices connected with
3155bd8deadSopenharmony_ci      solid lines belong to the main primitives; the vertices connected by
3165bd8deadSopenharmony_ci      dashed lines are the adjacent vertices that may be used in a geometry
3175bd8deadSopenharmony_ci      program.
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    Triangle Strips with Adjacency
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    Triangle strips with adjacency are similar to triangle strips, except that
3225bd8deadSopenharmony_ci    each triangle edge has an adjacent vertex that can be accessed by geometry
3235bd8deadSopenharmony_ci    programs (Section 2.15).  If geometry programs are disabled, the
3245bd8deadSopenharmony_ci    "adjacent" vertices are ignored.
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    In triangle strips with adjacency, n triangles are drawn using 2 * (n+2) +
3275bd8deadSopenharmony_ci    k vertices between the Begin and End.  k is either 0 or 1; if k is 1, the
3285bd8deadSopenharmony_ci    final vertex is ignored.  If fewer than 6 vertices are specified between
3295bd8deadSopenharmony_ci    the Begin and End, the entire primitive is ignored.  Table X.1 describes
3305bd8deadSopenharmony_ci    the vertices and order used to draw each triangle, and which vertices are
3315bd8deadSopenharmony_ci    considered adjacent to each edge of the triangle.  See Figure X.3.
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci    (add table)
3345bd8deadSopenharmony_ci                                 primitive          adjacent
3355bd8deadSopenharmony_ci                                 vertices           vertices
3365bd8deadSopenharmony_ci      primitive               1st   2nd   3rd     1/2  2/3  3/1
3375bd8deadSopenharmony_ci      ---------------        ----  ----  ----    ---- ---- ----
3385bd8deadSopenharmony_ci      only (i==0, n==1)        1     3     5       2    6    4
3395bd8deadSopenharmony_ci      first (i==0)             1     3     5       2    7    4
3405bd8deadSopenharmony_ci      middle (i odd)         2i+3  2i+1  2i+5    2i-1 2i+4 2i+7
3415bd8deadSopenharmony_ci      middle (i even)        2i+1  2i+3  2i+5    2i-1 2i+7 2i+4
3425bd8deadSopenharmony_ci      last (i==n-1, i odd)   2i+3  2i+1  2i+5    2i-1 2i+4 2i+6
3435bd8deadSopenharmony_ci      last (i==n-1, i even)  2i+1  2i+3  2i+5    2i-1 2i+6 2i+4
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci      Table X.1:  Triangles generated by triangle strips with adjacency.  
3465bd8deadSopenharmony_ci      Each triangle is drawn using the vertices in the "1st", "2nd", and "3rd"
3475bd8deadSopenharmony_ci      columns under "primitive vertices", in that order.  The vertices in the
3485bd8deadSopenharmony_ci      "1/2", "2/3", and "3/1" columns under "adjacent vertices" are considered
3495bd8deadSopenharmony_ci      adjacent to the edges from the first to the second, from the second to
3505bd8deadSopenharmony_ci      the third, and from the third to the first vertex of the triangle,
3515bd8deadSopenharmony_ci      respectively.  The six rows correspond to the six cases:  the first and
3525bd8deadSopenharmony_ci      only triangle (i=0, n=1), the first triangle of several (i=0, n>0),
3535bd8deadSopenharmony_ci      "odd" middle triangles (i=1,3,5...), "even" middle triangles
3545bd8deadSopenharmony_ci      (i=2,4,6,...), and special cases for the last triangle inside the
3555bd8deadSopenharmony_ci      Begin/End, when i is either even or odd.  For the purposes of this
3565bd8deadSopenharmony_ci      table, the first vertex specified after Begin is numbered "1" and the
3575bd8deadSopenharmony_ci      first triangle is numbered "0".
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ci    Triangle strips with adjacency are generated by calling Begin with the
3605bd8deadSopenharmony_ci    argument value TRIANGLE_STRIP_ADJACENCY_EXT.
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci    Modify Section 2.14.1, Lighting (p. 59)
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci    (modify fourth paragraph, p. 63) Additionally, vertex and geometry shaders
3655bd8deadSopenharmony_ci    and programs can operate in two-sided color mode, which is enabled and
3665bd8deadSopenharmony_ci    disabled by calling Enable or Disable with the symbolic value
3675bd8deadSopenharmony_ci    VERTEX_PROGRAM_TWO_SIDE.  When a vertex or geometry shader is active, the
3685bd8deadSopenharmony_ci    shaders can write front and back color values to the gl_FrontColor,
3695bd8deadSopenharmony_ci    gl_BackColor, gl_FrontSecondaryColor and gl_BackSecondaryColor outputs.
3705bd8deadSopenharmony_ci    When a vertex or geometry program is active, programs can write front and
3715bd8deadSopenharmony_ci    back colors using the available color result bindings.  When a vertex or
3725bd8deadSopenharmony_ci    geometry shader or program is active and two-sided color mode is enabled,
3735bd8deadSopenharmony_ci    the GL chooses between front and back colors, as described below.  If
3745bd8deadSopenharmony_ci    two-sided color mode is disabled, the front color output is always
3755bd8deadSopenharmony_ci    selected.
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    Insert New Section 2.14.6, Geometry Programs (between 2.14.5, Color Index
3785bd8deadSopenharmony_ci    Lighting and 2.14.6, Clamping and Masking, p. 69)
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ci    Section 2.14.6, Geometry Programs
3815bd8deadSopenharmony_ci
3825bd8deadSopenharmony_ci    Each primitive may be optionally transformed by a geometry program.
3835bd8deadSopenharmony_ci    Geometry programs are enabled by calling Enable with the value
3845bd8deadSopenharmony_ci    GEOMETRY_PROGRAM_NV.  A geometry program takes a single input primitive
3855bd8deadSopenharmony_ci    and generates vertices to be arranged into one or more output primitives.
3865bd8deadSopenharmony_ci    The original input primitive is discarded, and the output primitives are
3875bd8deadSopenharmony_ci    processed in order by the remainder of the GL pipeline.
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    Section 2.14.6.1, Geometry Program Input Primitives
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci    A geometry program can operate on one of five input primitive types, as
3925bd8deadSopenharmony_ci    specified by the mandatory "PRIMITIVE_IN" declaration.  Depending on the
3935bd8deadSopenharmony_ci    input primitive type, one to six vertices are available when the program
3945bd8deadSopenharmony_ci    is executed.  A geometry program will fail to load unless it contains
3955bd8deadSopenharmony_ci    exactly one such declaration.
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    Each input primitive type supports only a subset of the primitives
3985bd8deadSopenharmony_ci    provided by the GL.  If geometry programs are enabled, Begin, or any
3995bd8deadSopenharmony_ci    function that implicitly calls Begin, will produce an INVALID_OPERATION
4005bd8deadSopenharmony_ci    error if the <mode> parameter is incompatible with the input primitive
4015bd8deadSopenharmony_ci    type of the current geometry program.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    The supported input primitive types are:
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    Points (POINTS)
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ci    Geometry programs that operate on points are valid only for the POINTS
4085bd8deadSopenharmony_ci    primitive type.  There is a only a single vertex available for each
4095bd8deadSopenharmony_ci    program invocation: "vertex[0]" refers to the single point.
4105bd8deadSopenharmony_ci
4115bd8deadSopenharmony_ci    Lines (LINES)
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci    Geometry programs that operate on line segments are valid only for the
4145bd8deadSopenharmony_ci    LINES, LINE_STRIP, and LINE_LOOP primitive types.  There are two vertices
4155bd8deadSopenharmony_ci    available for each program invocation:  "vertex[0]" and "vertex[1]" refer
4165bd8deadSopenharmony_ci    to the beginning and end of the line segment.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    Lines with Adjacency (LINES_ADJACENCY)
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    Geometry programs that operate on line segments with adjacent vertices are
4215bd8deadSopenharmony_ci    valid only for the LINES_ADJACENCY_EXT and LINE_STRIP_ADJACENCY_EXT
4225bd8deadSopenharmony_ci    primitive types.  There are four vertices available for each program
4235bd8deadSopenharmony_ci    invocation.  "vertex[1]" and "vertex[2]" refer to the beginning and end of
4245bd8deadSopenharmony_ci    the line segment.  "vertex[0]" and "vertex[3]" refer to the vertices
4255bd8deadSopenharmony_ci    adjacent to the beginning and end of the line segment, respectively.
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci    Triangles (TRIANGLES)
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci    Geometry programs that operate on triangles are valid for the TRIANGLES,
4305bd8deadSopenharmony_ci    TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP, and POLYGON primitive
4315bd8deadSopenharmony_ci    types.  
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    When used with a geometry program that operates on triangles, QUADS,
4345bd8deadSopenharmony_ci    QUAD_STRIP, and POLYGON primitives are decomposed into triangles in an
4355bd8deadSopenharmony_ci    unspecified, implementation-dependent manner.  For convex polygons
4365bd8deadSopenharmony_ci    (already required in the core GL specification), this decomposition
4375bd8deadSopenharmony_ci    satisfies three properties:
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci      * the collection of triangles fully covers the area of the original
4405bd8deadSopenharmony_ci        primitive,
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci      * no two triangles in the decomposition overlap, and
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci      * the orientation of each triangle is consistent with the orientation of
4455bd8deadSopenharmony_ci        the original primitive.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    For such primitives, the program is executed once for each triangle in the
4485bd8deadSopenharmony_ci    decomposition.
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci    There are three vertices available for each program invocation.
4515bd8deadSopenharmony_ci    "vertex[0]", "vertex[1]", and "vertex[2]", refer to the first, second, and
4525bd8deadSopenharmony_ci    third vertex of the triangle, respectively.
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci    Triangles with Adjacency (TRIANGLES_ADJACENCY)
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci    Geometry programs that operate on triangles with adjacent vertices are
4575bd8deadSopenharmony_ci    valid for the TRIANGLES_ADJACENCY_EXT and TRIANGLE_STRIP_ADJACENCY_EXT
4585bd8deadSopenharmony_ci    primitive types.  There are six vertices available for each program
4595bd8deadSopenharmony_ci    invocation.  "vertex[0]", "vertex[2]", and "vertex[4]" refer to the first,
4605bd8deadSopenharmony_ci    second, and third vertex of the triangle respectively.  "vertex[1]",
4615bd8deadSopenharmony_ci    "vertex[3]", and "vertex[5]" refer to the vertices adjacent to the edges
4625bd8deadSopenharmony_ci    from the first to the second vertex, from the second to the third vertex,
4635bd8deadSopenharmony_ci    and from the third to the first vertex, respectively.
4645bd8deadSopenharmony_ci
4655bd8deadSopenharmony_ci    Section 2.14.6.2, Geometry Program Output Primitives
4665bd8deadSopenharmony_ci
4675bd8deadSopenharmony_ci    A geometry program can generate primitives of one of three types, as
4685bd8deadSopenharmony_ci    specified by the mandatory "PRIMITIVE_OUT" declaration.  A geometry
4695bd8deadSopenharmony_ci    program will fail to load unless it contains exactly one such declaration.
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci    The supported output primitive types are points (POINTS), line strips
4725bd8deadSopenharmony_ci    (LINE_STRIP), and triangle strips (TRIANGLE_STRIP).  The vertices output
4735bd8deadSopenharmony_ci    by the geometry program are decomposed into points, lines, or triangles
4745bd8deadSopenharmony_ci    based on the output primitive type in the manner described in section
4755bd8deadSopenharmony_ci    2.6.1.
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    Section 2.14.6.3, Geometry Program Execution Environment
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ci    Geometry programs execute using the instruction set documented in the
4805bd8deadSopenharmony_ci    GL_NV_gpu_program4 extension specification and in a manner similar to
4815bd8deadSopenharmony_ci    vertex programs.  Each vertex attribute access must identify the vertex
4825bd8deadSopenharmony_ci    number being accessed.  For example, "vertex[1].position" identifies the
4835bd8deadSopenharmony_ci    transformed position of "vertex[1]" as specified in teh description of the
4845bd8deadSopenharmony_ci    input primitive type.  Output vertices are specified by writing to vertex
4855bd8deadSopenharmony_ci    result variables in the same manner as done by vertex programs.
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ci    The special instruction "EMIT" specifies that a vertex is completed.  A
4885bd8deadSopenharmony_ci    vertex is added to the current output primitive using the current values
4895bd8deadSopenharmony_ci    of the vertex result variables.  The values of any unwritten result
4905bd8deadSopenharmony_ci    variables (or components) are undefined.  
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci    After an EMIT instruction is completed, the current values of all vertex
4935bd8deadSopenharmony_ci    result variables become undefined.  If a program wants to ensure that the
4945bd8deadSopenharmony_ci    same result is used for every vertex written by the program, it is
4955bd8deadSopenharmony_ci    necessary to write the corresponding value once per vertex.
4965bd8deadSopenharmony_ci
4975bd8deadSopenharmony_ci    The special instruction "ENDPRIM" specifies that the current output
4985bd8deadSopenharmony_ci    primitive should be completed and a new output primitive should be
4995bd8deadSopenharmony_ci    started.  A geometry program starts with an output primitive containing no
5005bd8deadSopenharmony_ci    vertices.  When a geometry program terminates, the current output
5015bd8deadSopenharmony_ci    primitive is automatically completed.  ENDPRIM has no effect if the
5025bd8deadSopenharmony_ci    geometry program's output primitive type is POINTS.
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci    When a primitive generated by a geometry program is completed, the
5055bd8deadSopenharmony_ci    vertices added by the EMIT instruction are decomposed into points, lines,
5065bd8deadSopenharmony_ci    or triangles according to the output primitive type in the manner
5075bd8deadSopenharmony_ci    described in Section 2.8.1.  The resulting primitives are then clipped and
5085bd8deadSopenharmony_ci    rasterized.  If the number of vertices emitted by the geometry program is
5095bd8deadSopenharmony_ci    not sufficient to produce a single primitive, nothing is drawn.
5105bd8deadSopenharmony_ci
5115bd8deadSopenharmony_ci    Like vertex and fragment programs, geometry programs can access textures.
5125bd8deadSopenharmony_ci    The maximum number of texture image units that can be accessed by a
5135bd8deadSopenharmony_ci    geometry program is given by the value of
5145bd8deadSopenharmony_ci    MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT.
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci    Section 2.14.6.4, Geometry Program Output Limits
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci    A geometry program may not emit an unlimited number of vertices per
5195bd8deadSopenharmony_ci    invocation.  Each geometry program must declare a vertex limit, which is
5205bd8deadSopenharmony_ci    the maximum number of vertices that the program can ever produce.  The
5215bd8deadSopenharmony_ci    vertex limit is specified using the "VERTICES_OUT" declaration.  A
5225bd8deadSopenharmony_ci    geometry program will fail to load unless it contains exactly one such
5235bd8deadSopenharmony_ci    declaration.
5245bd8deadSopenharmony_ci
5255bd8deadSopenharmony_ci    There are two implementation-dependent limits that limit the total number
5265bd8deadSopenharmony_ci    of vertices that a program can emit.  First, the vertex limit may not
5275bd8deadSopenharmony_ci    exceed the value of MAX_PROGRAM_OUTPUT_VERTICES_NV.  Second, product of
5285bd8deadSopenharmony_ci    the vertex limit and the number of result variable components written by
5295bd8deadSopenharmony_ci    the program (PROGRAM_RESULT_COMPONENTS_NV, as described in section 2.X.3.5
5305bd8deadSopenharmony_ci    of NV_gpu_program4) may not exceed the value of
5315bd8deadSopenharmony_ci    MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV.  A geometry program will fail to
5325bd8deadSopenharmony_ci    load if its maximum vertex count or maximum total component count exceeds
5335bd8deadSopenharmony_ci    the implementation-dependent limit.  The limits may be queried by calling
5345bd8deadSopenharmony_ci    GetProgramiv with a <target> of GEOMETRY_PROGRAM_NV.  Note that the
5355bd8deadSopenharmony_ci    maximum number of vertices that a geometry program can emit may be much
5365bd8deadSopenharmony_ci    lower than MAX_PROGRAM_OUTPUT_VERTICES_NV if the program writes a large
5375bd8deadSopenharmony_ci    number of result variable components.
5385bd8deadSopenharmony_ci
5395bd8deadSopenharmony_ci    After a geometry program is compiled, the vertex limit may be changed
5405bd8deadSopenharmony_ci    using the command
5415bd8deadSopenharmony_ci
5425bd8deadSopenharmony_ci      void ProgramVertexLimitNV(enum target, int limit);
5435bd8deadSopenharmony_ci
5445bd8deadSopenharmony_ci    <target> must be GEOMETRY_PROGRAM_NV.  <limit> is the new vertex limit,
5455bd8deadSopenharmony_ci    which must satisfy the two rules described above.  The error INVALID_VALUE
5465bd8deadSopenharmony_ci    is generated if <limit> is less than or equal to zero, <limit> is greater
5475bd8deadSopenharmony_ci    than or equal to MAX_PROGRAM_OUTPUT_VERTICES_NV, or if the total number of
5485bd8deadSopenharmony_ci    components emitted would exceed MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV.
5495bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if the current geometry program
5505bd8deadSopenharmony_ci    has not been successfully loaded.
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci    When a program executes, the number of vertices it emits should not exceed
5535bd8deadSopenharmony_ci    the vertex limit.  Once a geometry program emits a number of vertices
5545bd8deadSopenharmony_ci    equal to the vertex limit, subsequent EMIT instructions may or may not
5555bd8deadSopenharmony_ci    have any effect.
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci    Modify Section 2.X.2, Program Grammar
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci    (replace third paragraph)
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ci    Geometry programs are required to begin with the header string
5625bd8deadSopenharmony_ci    "!!NVgp4.0".  This header string identifies the subsequent program body as
5635bd8deadSopenharmony_ci    being a geometry program and indicates that it should be parsed according
5645bd8deadSopenharmony_ci    to the base NV_gpu_program4 grammar plus the additions below.  Program
5655bd8deadSopenharmony_ci    string parsing begins with the character immediately following the header
5665bd8deadSopenharmony_ci    string.
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci    (add the following grammar rules to the NV_gpu_program4 base grammar)
5695bd8deadSopenharmony_ci
5705bd8deadSopenharmony_ci    <declSequence>          ::= <declaration> <declSequence>
5715bd8deadSopenharmony_ci
5725bd8deadSopenharmony_ci    <instruction>           ::= <SpecialInstruction>
5735bd8deadSopenharmony_ci
5745bd8deadSopenharmony_ci    <attribUseV>            ::= <attribVarName> <arrayMem> <arrayMem> 
5755bd8deadSopenharmony_ci                                <swizzleSuffix>
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci    <attribUseS>            ::= <attribVarName> <arrayMem> <arrayMem> 
5785bd8deadSopenharmony_ci                                <scalarSuffix>
5795bd8deadSopenharmony_ci
5805bd8deadSopenharmony_ci    <attribUseVNS>          ::= <attribVarName> <arrayMem> <arrayMem>
5815bd8deadSopenharmony_ci
5825bd8deadSopenharmony_ci    <resultUseW>            ::= <resultVarName> <arrayMem> <optWriteMask>
5835bd8deadSopenharmony_ci                              | <resultColor> <optWriteMask>
5845bd8deadSopenharmony_ci                              | <resultColor> "." <colorType> <optWriteMask>
5855bd8deadSopenharmony_ci                              | <resultColor> "." <faceType> <optWriteMask>
5865bd8deadSopenharmony_ci                              | <resultColor> "." <faceType> "." <colorType> 
5875bd8deadSopenharmony_ci                                "." <optWriteMask>
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci    <resultUseD>            ::= <resultColor>
5905bd8deadSopenharmony_ci                              | <resultColor> "." <colorType>
5915bd8deadSopenharmony_ci                              | <resultMulti>
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    <declaration>           ::= "PRIMITIVE_IN" <declPrimInType>
5945bd8deadSopenharmony_ci                              | "PRIMITIVE_OUT" <declPrimOutType>
5955bd8deadSopenharmony_ci                              | "VERTICES_OUT" <int>
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci    <declPrimInType>        ::= "POINTS"
5985bd8deadSopenharmony_ci                              | "LINES"
5995bd8deadSopenharmony_ci                              | "LINES_ADJACENCY"
6005bd8deadSopenharmony_ci                              | "TRIANGLES"
6015bd8deadSopenharmony_ci                              | "TRIANGLES_ADJACENCY"
6025bd8deadSopenharmony_ci
6035bd8deadSopenharmony_ci    <declPrimOutType>       ::= "POINTS"
6045bd8deadSopenharmony_ci                              | "LINE_STRIP"
6055bd8deadSopenharmony_ci                              | "TRIANGLE_STRIP"
6065bd8deadSopenharmony_ci
6075bd8deadSopenharmony_ci    <SpecialInstruction>    ::= "EMIT"
6085bd8deadSopenharmony_ci                              | "ENDPRIM"
6095bd8deadSopenharmony_ci
6105bd8deadSopenharmony_ci    <attribBasic>           ::= <vtxPrefix> "position"
6115bd8deadSopenharmony_ci                              | <vtxPrefix> "fogcoord"
6125bd8deadSopenharmony_ci                              | <vtxPrefix> "pointsize"
6135bd8deadSopenharmony_ci                              | <vtxPrefix> "id"
6145bd8deadSopenharmony_ci                              | <attribTexCoord> <optArrayMemAbs>
6155bd8deadSopenharmony_ci                              | <attribClip> <arrayMemAbs>
6165bd8deadSopenharmony_ci                              | <attribGeneric> <arrayMemAbs>
6175bd8deadSopenharmony_ci                              | "primitive" "." "id"
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci    <attribColor>           ::= <vtxPrefix> "color"
6205bd8deadSopenharmony_ci
6215bd8deadSopenharmony_ci    <attribMulti>           ::= <attribTexCoord> <arrayRange>
6225bd8deadSopenharmony_ci                              | <attribClip> <arrayRange>
6235bd8deadSopenharmony_ci                              | <attribGeneric> <arrayRange>
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ci    <attribTexCoord>        ::= <vtxPrefix> "texcoord"
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci    <attribClip>            ::= <vtxPrefix> "clip"
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci    <attribGeneric>         ::= <vtxPrefix> "attrib"
6305bd8deadSopenharmony_ci
6315bd8deadSopenharmony_ci    <vtxPrefix>             ::= "vertex" <optArrayMemAbs>
6325bd8deadSopenharmony_ci
6335bd8deadSopenharmony_ci    <resultBasic>           ::= <resPrefix> "position"
6345bd8deadSopenharmony_ci                              | <resPrefix> "fogcoord"
6355bd8deadSopenharmony_ci                              | <resPrefix> "pointsize"
6365bd8deadSopenharmony_ci                              | <resPrefix> "primid"
6375bd8deadSopenharmony_ci                              | <resPrefix> "layer"
6385bd8deadSopenharmony_ci                              | <resultTexCoord> <optArrayMemAbs>
6395bd8deadSopenharmony_ci                              | <resultClip> <arrayMemAbs>
6405bd8deadSopenharmony_ci                              | <resultGeneric> <arrayMemAbs>
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    <resultColor>           ::= <resPrefix> "color"
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci    <resultMulti>           ::= <resultTexCoord> <arrayRange>
6455bd8deadSopenharmony_ci                              | <resultClip> <arrayRange>
6465bd8deadSopenharmony_ci                              | <resultGeneric> <arrayRange>
6475bd8deadSopenharmony_ci
6485bd8deadSopenharmony_ci    <resultTexCoord>        ::= <resPrefix> "texcoord"
6495bd8deadSopenharmony_ci
6505bd8deadSopenharmony_ci    <resultClip>            ::= <resPrefix> "clip"
6515bd8deadSopenharmony_ci
6525bd8deadSopenharmony_ci    <resultGeneric>         ::= <resPrefix> "attrib"
6535bd8deadSopenharmony_ci
6545bd8deadSopenharmony_ci    <resPrefix>             ::= "result" "."
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci    (add the following subsection to section 2.X.3.2, Program Attribute
6575bd8deadSopenharmony_ci    Variables)
6585bd8deadSopenharmony_ci
6595bd8deadSopenharmony_ci    Geometry program attribute variables describe the attributes of each
6605bd8deadSopenharmony_ci    transformed vertex accessible to the geometry program.  Most attributes
6615bd8deadSopenharmony_ci    correspond to the per-vertex results generated by vertex program execution
6625bd8deadSopenharmony_ci    or fixed-function vertex processing.  The "primitive.id" attribute is
6635bd8deadSopenharmony_ci    generated specially, as described below.
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci    If vertex programs are enabled, attributes will be obtained from the
6665bd8deadSopenharmony_ci    per-vertex outputs of the vertex program used to generate the vertex in
6675bd8deadSopenharmony_ci    question.  Geometry program attributes should be read using the same
6685bd8deadSopenharmony_ci    component data type used to write the corresponding vertex program
6695bd8deadSopenharmony_ci    results.  The value of any attribute corresponding to a vertex output not
6705bd8deadSopenharmony_ci    written by the vertex program is undefined.
6715bd8deadSopenharmony_ci
6725bd8deadSopenharmony_ci    If vertex programs are disabled, attributes will be obtained from the
6735bd8deadSopenharmony_ci    values computed by fixed-function vertex processing.  All attributes,
6745bd8deadSopenharmony_ci    except for the primitive ID should be read as floating-point values in
6755bd8deadSopenharmony_ci    this case.
6765bd8deadSopenharmony_ci
6775bd8deadSopenharmony_ci      Geometry Vertex Binding         Components  Description
6785bd8deadSopenharmony_ci      -----------------------------   ----------  ----------------------------
6795bd8deadSopenharmony_ci      vertex[m].position              (x,y,z,w)   clip coordinates
6805bd8deadSopenharmony_ci      vertex[m].color                 (r,g,b,a)   front primary color
6815bd8deadSopenharmony_ci      vertex[m].color.primary         (r,g,b,a)   front primary color
6825bd8deadSopenharmony_ci      vertex[m].color.secondary       (r,g,b,a)   front secondary color
6835bd8deadSopenharmony_ci      vertex[m].color.front           (r,g,b,a)   front primary color
6845bd8deadSopenharmony_ci      vertex[m].color.front.primary   (r,g,b,a)   front primary color
6855bd8deadSopenharmony_ci      vertex[m].color.front.secondary (r,g,b,a)   front secondary color
6865bd8deadSopenharmony_ci      vertex[m].color.back            (r,g,b,a)   back primary color
6875bd8deadSopenharmony_ci      vertex[m].color.back.primary    (r,g,b,a)   back primary color
6885bd8deadSopenharmony_ci      vertex[m].color.back.secondary  (r,g,b,a)   back secondary color
6895bd8deadSopenharmony_ci      vertex[m].fogcoord              (f,-,-,-)   fog coordinate
6905bd8deadSopenharmony_ci      vertex[m].pointsize             (s,-,-,-)   point size
6915bd8deadSopenharmony_ci      vertex[m].texcoord              (s,t,r,q)   texture coordinate, unit 0
6925bd8deadSopenharmony_ci      vertex[m].texcoord[n]           (s,t,r,q)   texture coordinate, unit n
6935bd8deadSopenharmony_ci      vertex[m].attrib[n]             (x,y,z,w)   generic interpolant n
6945bd8deadSopenharmony_ci      vertex[m].clip[n]               (d,-,-,-)   clip plane distance
6955bd8deadSopenharmony_ci      vertex[m].texcoord[n..o]        (s,t,r,q)   array of texture coordinates
6965bd8deadSopenharmony_ci      vertex[m].attrib[n..o]          (x,y,z,w)   array of generic interpolants
6975bd8deadSopenharmony_ci      vertex[m].clip[n..o]            (d,-,-,-)   array of clip distances
6985bd8deadSopenharmony_ci      vertex[m].id                    (id,-,-,-)  vertex id
6995bd8deadSopenharmony_ci      primitive.id                    (id,-,-,-)  primitive number
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci      Table X.2, Geometry Program Attribute Bindings.  <m> refers to a vertex
7025bd8deadSopenharmony_ci      number, while <n>, and <o> refer to integer constants.  Only the
7035bd8deadSopenharmony_ci      "vertex[m].texcoord" and "vertex.attrib" bindings are available in
7045bd8deadSopenharmony_ci      arrays.
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    For bindings that include "vertex[m]", <m> identifies the vertex number
7075bd8deadSopenharmony_ci    whose attributes are used for the binding.  For bindings in explicit
7085bd8deadSopenharmony_ci    variable declarations, "[m]" is optional.  If "[m]" is specified, <m> must
7095bd8deadSopenharmony_ci    be an integer constant and must be in the valid range of vertices
7105bd8deadSopenharmony_ci    supported for the input primitive type.  If "[m]" is not specified, the
7115bd8deadSopenharmony_ci    declared variable is accessed as an array, with the first array index
7125bd8deadSopenharmony_ci    specifying the vertex number.  If such a variable is declared an array, it
7135bd8deadSopenharmony_ci    must have a second array index to identify the individual array element.
7145bd8deadSopenharmony_ci    For bindings used directly in instructions, "[m]" is required and must be
7155bd8deadSopenharmony_ci    an integer constant specifying a vertex number.  The following examples
7165bd8deadSopenharmony_ci    illustrate various legal and illegal geometry program bindings and their
7175bd8deadSopenharmony_ci    meanings.
7185bd8deadSopenharmony_ci
7195bd8deadSopenharmony_ci      ATTRIB pos = vertex.position;
7205bd8deadSopenharmony_ci      ATTRIB pos2 = vertex[2].position;
7215bd8deadSopenharmony_ci      ATTRIB texcoords[] = { vertex.texcoord[0..3] };
7225bd8deadSopenharmony_ci      ATTRIB tcoords1[4] = { vertex[1].texcoord[1..4] };
7235bd8deadSopenharmony_ci      INT TEMP A0;
7245bd8deadSopenharmony_ci      ...
7255bd8deadSopenharmony_ci      MOV R0, pos[1];                   # position of vertex 1
7265bd8deadSopenharmony_ci      MOV R0, vertex[1].position;       # position of vertex 1
7275bd8deadSopenharmony_ci      MOV R0, pos2;                     # position of vertex 2
7285bd8deadSopenharmony_ci      MOV R0, texcoords[A0.x][1];       # texcoord 1 of vertex A0.x
7295bd8deadSopenharmony_ci      MOV R0, texcoords[A0.x][A0.y];    # texcoord A0.y of vertex A0.x
7305bd8deadSopenharmony_ci      MOV R0, tcoords1[2];              # texcoord 3 of vertex 1
7315bd8deadSopenharmony_ci      MOV R0, vertex[A0.x].texcoord[1]; # ILLEGAL allowed -- vertex number
7325bd8deadSopenharmony_ci                                        #    must be constant here.
7335bd8deadSopenharmony_ci
7345bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].position", the "x",
7355bd8deadSopenharmony_ci    "y", "z" and "w" components of the geometry attribute variable are filled
7365bd8deadSopenharmony_ci    with the "x", "y", "z", and "w" components, respectively, of the
7375bd8deadSopenharmony_ci    transformed position of vertex <m>, in clip coordinates.
7385bd8deadSopenharmony_ci
7395bd8deadSopenharmony_ci    If a geometry attribute binding matches any binding in Table X.2 beginning
7405bd8deadSopenharmony_ci    with "vertex[m].color", the "x", "y", "z", and "w" components of the
7415bd8deadSopenharmony_ci    geometry attribute variable are filled with the "r", "g", "b", and "a"
7425bd8deadSopenharmony_ci    components, respectively, of the corresponding color of vertex <m>.
7435bd8deadSopenharmony_ci    Bindings containing "front" and "back" refer to the front and back colors,
7445bd8deadSopenharmony_ci    respectively.  Bindings containing "primary" and "secondary" refer to
7455bd8deadSopenharmony_ci    primary and secondary colors, respectively.  If face or color type is
7465bd8deadSopenharmony_ci    omitted in the binding, the binding is treated as though "front" and
7475bd8deadSopenharmony_ci    "primary", respectively, were specified.
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].fogcoord", the "x"
7505bd8deadSopenharmony_ci    component of the geometry attribute variable is filled with the fog
7515bd8deadSopenharmony_ci    coordinate of vertex <m>.  The "y", "z", and "w" components are undefined.
7525bd8deadSopenharmony_ci
7535bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].pointsize", the "x"
7545bd8deadSopenharmony_ci    component of the geometry attribute variable is filled with the point size
7555bd8deadSopenharmony_ci    of vertex <m> computed by the vertex program.  For fixed-function vertex
7565bd8deadSopenharmony_ci    processing, the point size attribute is undefined.  The "y", "z", and "w"
7575bd8deadSopenharmony_ci    components are always undefined.
7585bd8deadSopenharmony_ci
7595bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].texcoord" or
7605bd8deadSopenharmony_ci    "vertex[m].texcoord[n]", the "x", "y", "z", and "w" coordinates of the
7615bd8deadSopenharmony_ci    geometry attribute variable are filled with the "s", "t", "r", and "q"
7625bd8deadSopenharmony_ci    coordinates of texture coordinate set <n> of vertex <m>.  If <n> is
7635bd8deadSopenharmony_ci    omitted, texture coordinate set zero is used.
7645bd8deadSopenharmony_ci
7655bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].attrib[n]", the "x",
7665bd8deadSopenharmony_ci    "y", "z", and "w" components of the geometry attribute variable are filled
7675bd8deadSopenharmony_ci    with the "x", "y", "z", and "w" coordinates of generic interpolant <n> of
7685bd8deadSopenharmony_ci    vertex <m>.  All generic interpolants will be undefined when used with
7695bd8deadSopenharmony_ci    fixed-function vertex processing.
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].clip[n]", the "x"
7725bd8deadSopenharmony_ci    component of the geometry attribute variable is filled the clip distance
7735bd8deadSopenharmony_ci    of vertex <m> for clip plane <n>, as written by the vertex program.  If
7745bd8deadSopenharmony_ci    fixed-function vertex processing or position-invariant vertex programs are
7755bd8deadSopenharmony_ci    used, the clip distance is obtained by computing the per-clip plane dot
7765bd8deadSopenharmony_ci    product:
7775bd8deadSopenharmony_ci
7785bd8deadSopenharmony_ci      (p_1' p_2' p_3' p_4') dot (x_e y_e z_e w_e),
7795bd8deadSopenharmony_ci
7805bd8deadSopenharmony_ci    at the vertex location, as described in section 2.12.  The clip distance
7815bd8deadSopenharmony_ci    for clip plane <n> is undefined if clip plane <n> is disabled.  The "y",
7825bd8deadSopenharmony_ci    "z", and "w" components of the attribute are undefined.
7835bd8deadSopenharmony_ci
7845bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].texcoord[n..o]",
7855bd8deadSopenharmony_ci    "vertex[m].attrib[n..o]", or "vertex[m].clip[n..o]", a sequence of
7865bd8deadSopenharmony_ci    1+<o>-<n> texture coordinate bindings is created.  For texture coordinate
7875bd8deadSopenharmony_ci    bindings, it is as though the sequence "vertex[m].texcoord[n],
7885bd8deadSopenharmony_ci    vertex[m].texcoord[n+1], ... vertex[m].texcoord[o]" were specfied.  These
7895bd8deadSopenharmony_ci    bindings are available only in explicit declarations of array variables.
7905bd8deadSopenharmony_ci    A program will fail to load if <n> is greater than <o>.
7915bd8deadSopenharmony_ci
7925bd8deadSopenharmony_ci    If a geometry attribute binding matches "vertex[m].id", the "x" component
7935bd8deadSopenharmony_ci    is filled with the vertex ID.  If a vertex program is currently active,
7945bd8deadSopenharmony_ci    the attribute variable is filled with the vertex ID result written by the
7955bd8deadSopenharmony_ci    vertex program.  If fixed-function vertex processing is used, the vertex
7965bd8deadSopenharmony_ci    ID is undefined.  The "y", "z", and "w" components of the attribute are
7975bd8deadSopenharmony_ci    undefined.
7985bd8deadSopenharmony_ci
7995bd8deadSopenharmony_ci    If a geometry attribute binding matches "primitive.id", the "x" component
8005bd8deadSopenharmony_ci    is filled with the number of primitives received by the GL since the last
8015bd8deadSopenharmony_ci    time Begin was called (directly or indirectly via vertex array functions).
8025bd8deadSopenharmony_ci    The first primitive generated after a Begin is numbered zero, and the
8035bd8deadSopenharmony_ci    primitive ID counter is incremented after every individual point, line, or
8045bd8deadSopenharmony_ci    polygon primitive is processed.  For QUADS and QUAD_STRIP primitives that
8055bd8deadSopenharmony_ci    are decomposed into triangles, the primitive ID is incremented after each
8065bd8deadSopenharmony_ci    complete quad is processed.  For POLYGON primitives, the primitive ID
8075bd8deadSopenharmony_ci    counter is zero.  Restarting a primitive topology using the primitive
8085bd8deadSopenharmony_ci    restart index has no effect on the primitive ID counter.  The "y", "z",
8095bd8deadSopenharmony_ci    and "w" components of the variable are always undefined.
8105bd8deadSopenharmony_ci
8115bd8deadSopenharmony_ci    (add the following subsection to section 2.X.3.5, Program Results.)
8125bd8deadSopenharmony_ci
8135bd8deadSopenharmony_ci    Geometry programs emit vertices, and the set of result variables available
8145bd8deadSopenharmony_ci    to such programs correspond to the attributes of each emitted vertex.  The
8155bd8deadSopenharmony_ci    set of allowable result variable bindings for geometry programs is given
8165bd8deadSopenharmony_ci    in Table X.3.
8175bd8deadSopenharmony_ci
8185bd8deadSopenharmony_ci      Binding                        Components  Description
8195bd8deadSopenharmony_ci      -----------------------------  ----------  ----------------------------
8205bd8deadSopenharmony_ci      result.position                (x,y,z,w)   position in clip coordinates
8215bd8deadSopenharmony_ci      result.color                   (r,g,b,a)   front-facing primary color
8225bd8deadSopenharmony_ci      result.color.primary           (r,g,b,a)   front-facing primary color
8235bd8deadSopenharmony_ci      result.color.secondary         (r,g,b,a)   front-facing secondary color
8245bd8deadSopenharmony_ci      result.color.front             (r,g,b,a)   front-facing primary color
8255bd8deadSopenharmony_ci      result.color.front.primary     (r,g,b,a)   front-facing primary color
8265bd8deadSopenharmony_ci      result.color.front.secondary   (r,g,b,a)   front-facing secondary color
8275bd8deadSopenharmony_ci      result.color.back              (r,g,b,a)   back-facing primary color
8285bd8deadSopenharmony_ci      result.color.back.primary      (r,g,b,a)   back-facing primary color
8295bd8deadSopenharmony_ci      result.color.back.secondary    (r,g,b,a)   back-facing secondary color
8305bd8deadSopenharmony_ci      result.fogcoord                (f,*,*,*)   fog coordinate
8315bd8deadSopenharmony_ci      result.pointsize               (s,*,*,*)   point size
8325bd8deadSopenharmony_ci      result.texcoord                (s,t,r,q)   texture coordinate, unit 0
8335bd8deadSopenharmony_ci      result.texcoord[n]             (s,t,r,q)   texture coordinate, unit n
8345bd8deadSopenharmony_ci      result.attrib[n]               (x,y,z,w)   generic interpolant n
8355bd8deadSopenharmony_ci      result.clip[n]                 (d,*,*,*)   clip plane distance
8365bd8deadSopenharmony_ci      result.texcoord[n..o]          (s,t,r,q)   texture coordinates n thru o
8375bd8deadSopenharmony_ci      result.attrib[n..o]            (x,y,z,w)   generic interpolants n thru o
8385bd8deadSopenharmony_ci      result.clip[n..o]              (d,*,*,*)   clip distances n thru o
8395bd8deadSopenharmony_ci      result.primid                  (id,*,*,*)  primitive id
8405bd8deadSopenharmony_ci      result.layer                   (l,*,*,*)   layer for cube/array/3D FBOs
8415bd8deadSopenharmony_ci
8425bd8deadSopenharmony_ci      Table X.3:  Geometry Program Result Variable Bindings.
8435bd8deadSopenharmony_ci      Components labeled "*" are unused.
8445bd8deadSopenharmony_ci
8455bd8deadSopenharmony_ci    If a result variable binding matches "result.position", updates to the
8465bd8deadSopenharmony_ci    "x", "y", "z", and "w" components of the result variable modify the "x",
8475bd8deadSopenharmony_ci    "y", "z", and "w" components, respectively, of the transformed vertex's
8485bd8deadSopenharmony_ci    clip coordinates.  Final window coordinates will be generated for the
8495bd8deadSopenharmony_ci    vertex as described in section 2.14.4.4.
8505bd8deadSopenharmony_ci
8515bd8deadSopenharmony_ci    If a result variable binding match begins with "result.color", updates to
8525bd8deadSopenharmony_ci    the "x", "y", "z", and "w" components of the result variable modify the
8535bd8deadSopenharmony_ci    "r", "g", "b", and "a" components, respectively, of the corresponding
8545bd8deadSopenharmony_ci    vertex color attribute in Table X.3.  Color bindings that do not specify
8555bd8deadSopenharmony_ci    "front" or "back" are consided to refer to front-facing colors.  Color
8565bd8deadSopenharmony_ci    bindings that do not specify "primary" or "secondary" are considered to
8575bd8deadSopenharmony_ci    refer to primary colors.
8585bd8deadSopenharmony_ci
8595bd8deadSopenharmony_ci    If a result variable binding matches "result.fogcoord", updates to the "x"
8605bd8deadSopenharmony_ci    component of the result variable set the transformed vertex's fog
8615bd8deadSopenharmony_ci    coordinate.  Updates to the "y", "z", and "w" components of the result
8625bd8deadSopenharmony_ci    variable have no effect.
8635bd8deadSopenharmony_ci
8645bd8deadSopenharmony_ci    If a result variable binding matches "result.pointsize", updates to the
8655bd8deadSopenharmony_ci    "x" component of the result variable set the transformed vertex's point
8665bd8deadSopenharmony_ci    size.  Updates to the "y", "z", and "w" components of the result variable
8675bd8deadSopenharmony_ci    have no effect.
8685bd8deadSopenharmony_ci
8695bd8deadSopenharmony_ci    If a result variable binding matches "result.texcoord" or
8705bd8deadSopenharmony_ci    "result.texcoord[n]", updates to the "x", "y", "z", and "w" components of
8715bd8deadSopenharmony_ci    the result variable set the "s", "t", "r" and "q" components,
8725bd8deadSopenharmony_ci    respectively, of the transformed vertex's texture coordinates for texture
8735bd8deadSopenharmony_ci    unit <n>.  If "[n]" is omitted, texture unit zero is selected.
8745bd8deadSopenharmony_ci
8755bd8deadSopenharmony_ci    If a result variable binding matches "result.attrib[n]", updates to the
8765bd8deadSopenharmony_ci    "x", "y", "z", and "w" components of the result variable set the "x", "y",
8775bd8deadSopenharmony_ci    "z", and "w" components of the generic interpolant <n>.
8785bd8deadSopenharmony_ci
8795bd8deadSopenharmony_ci    If a result variable binding matches "result.clip[n]", updates to the "x"
8805bd8deadSopenharmony_ci    component of the result variable set the clip distance for clip plane <n>.
8815bd8deadSopenharmony_ci
8825bd8deadSopenharmony_ci    If a result variable binding matches "result.texcoord[n..o]",
8835bd8deadSopenharmony_ci    "result.attrib[n..o]", or "result.clip[n..o]", a sequence of 1+<o>-<n>
8845bd8deadSopenharmony_ci    bindings is created.  For texture coordinates, it is as though the
8855bd8deadSopenharmony_ci    sequence "result.texcoord[n], result.texcoord[n+1],
8865bd8deadSopenharmony_ci    ... result.texcoord[o]" were specfied.  These bindings are available only
8875bd8deadSopenharmony_ci    in explicit declarations of array variables.  A program will fail to load
8885bd8deadSopenharmony_ci    if <n> is greater than <o>.
8895bd8deadSopenharmony_ci
8905bd8deadSopenharmony_ci    If a result variable binding matches "result.primid", updates to the "x"
8915bd8deadSopenharmony_ci    component of the result variable provide a single integer that serves as a
8925bd8deadSopenharmony_ci    primitive identifier.  The written primitive ID is available to fragment
8935bd8deadSopenharmony_ci    programs using the "primitive.id" attribute binding.  If a fragment
8945bd8deadSopenharmony_ci    program using primitive IDs is active and a geometry program is also
8955bd8deadSopenharmony_ci    active, the geometry program must write "result.primid" or the primitive
8965bd8deadSopenharmony_ci    ID number is undefined.
8975bd8deadSopenharmony_ci
8985bd8deadSopenharmony_ci    If a result variable binding matches "result.layer", updates to the "x"
8995bd8deadSopenharmony_ci    component of the result variable provide a single integer that serves as a
9005bd8deadSopenharmony_ci    layer selector for layered rendering (section 2.14.6.5).  The layer must
9015bd8deadSopenharmony_ci    be written as an integer value; writing a floating-point layer number will
9025bd8deadSopenharmony_ci    produce undefined results.
9035bd8deadSopenharmony_ci
9045bd8deadSopenharmony_ci    (modify Table X.13 in section 2.X.4, Program Instructions, to include the
9055bd8deadSopenharmony_ci    following.)
9065bd8deadSopenharmony_ci
9075bd8deadSopenharmony_ci                Modifiers 
9085bd8deadSopenharmony_ci    Instruction F I C S H D  Inputs     Out  Description
9095bd8deadSopenharmony_ci    ----------- - - - - - -  ---------- ---  --------------------------------
9105bd8deadSopenharmony_ci    EMIT        - - - - - -  -          -    emit vertex
9115bd8deadSopenharmony_ci    ENDPRIM     - - - - - -  -          -    end of primitive
9125bd8deadSopenharmony_ci
9135bd8deadSopenharmony_ci    (add the following subsection to section 2.X.6, Program Options.)
9145bd8deadSopenharmony_ci
9155bd8deadSopenharmony_ci    Section 2.X.6.Y, Geometry Program Options
9165bd8deadSopenharmony_ci
9175bd8deadSopenharmony_ci    No options are supported at present for geometry programs.
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci    (add the following subsection to section 2.X.7, Program Declarations.)
9205bd8deadSopenharmony_ci
9215bd8deadSopenharmony_ci    Section 2.X.7.Y, Geometry Program Declarations
9225bd8deadSopenharmony_ci
9235bd8deadSopenharmony_ci    Geometry programs support three types of declaration statements, as
9245bd8deadSopenharmony_ci    described below.  Each of the three must be included exactly once in the
9255bd8deadSopenharmony_ci    geometry program.
9265bd8deadSopenharmony_ci
9275bd8deadSopenharmony_ci    - Input Primitive Type (PRIMITIVE_IN)
9285bd8deadSopenharmony_ci
9295bd8deadSopenharmony_ci    The PRIMITIVE_IN statement declares the type of primitives seen by a
9305bd8deadSopenharmony_ci    geometry program.  The single argument must be one of "POINTS", "LINES",
9315bd8deadSopenharmony_ci    "LINES_ADJACENCY", "TRIANGLES", or "TRIANGLES_ADJACENCY".
9325bd8deadSopenharmony_ci
9335bd8deadSopenharmony_ci    - Output Primitive Type (PRIMITIVE_OUT)
9345bd8deadSopenharmony_ci
9355bd8deadSopenharmony_ci    The PRIMITIVE_OUT statement declares the type of primitive emitted by a
9365bd8deadSopenharmony_ci    geometry program.  The single argument must be one of "POINTS",
9375bd8deadSopenharmony_ci    "LINE_STRIP", or "TRIANGLE_STRIP".
9385bd8deadSopenharmony_ci
9395bd8deadSopenharmony_ci    - Maximum Vertex Count (VERTICES_OUT)
9405bd8deadSopenharmony_ci
9415bd8deadSopenharmony_ci    The VERTICES_OUT statement declares the maximum number of vertices that
9425bd8deadSopenharmony_ci    may be emitted by a geometry program.  The single argument must be a
9435bd8deadSopenharmony_ci    positive integer.  A vertex program that emits more than the specified
9445bd8deadSopenharmony_ci    number of vertices may terminate abnormally.
9455bd8deadSopenharmony_ci
9465bd8deadSopenharmony_ci    (add the following subsections to section 2.X.8, Program Instruction Set.)
9475bd8deadSopenharmony_ci
9485bd8deadSopenharmony_ci    Section 2.X.8.Z, EMIT:  Emit Vertex
9495bd8deadSopenharmony_ci
9505bd8deadSopenharmony_ci    The EMIT instruction emits a new vertex to be added to the current output
9515bd8deadSopenharmony_ci    primitive of a geometry program.  The attributes of the emitted vertex are
9525bd8deadSopenharmony_ci    given by the current values of the vertex result variables.  After the
9535bd8deadSopenharmony_ci    EMIT instruction completes, a new vertex is started and all result
9545bd8deadSopenharmony_ci    variables become undefined.
9555bd8deadSopenharmony_ci
9565bd8deadSopenharmony_ci    Section 2.X.8.Z, ENDPRIM:  End of Primitive
9575bd8deadSopenharmony_ci
9585bd8deadSopenharmony_ci    A geometry program can emit multiple primitives in a single invocation.
9595bd8deadSopenharmony_ci    The ENDPRIM instruction is used in a geometry program to signify the end
9605bd8deadSopenharmony_ci    of the current primitive and the beginning of a new primitive of the same
9615bd8deadSopenharmony_ci    type.  The effect of ENDPRIM is roughly equivalent to calling End followed
9625bd8deadSopenharmony_ci    by a new Begin, where the primitive mode is specified in the text of the
9635bd8deadSopenharmony_ci    geometry program.
9645bd8deadSopenharmony_ci
9655bd8deadSopenharmony_ci    Like End, the ENDPRIM instruction does not emit a vertex.  Any result
9665bd8deadSopenharmony_ci    registers written prior to an ENDPRIM instruction are unchanged, and will
9675bd8deadSopenharmony_ci    be used in the vertex specified by the next EMIT instruction if they are
9685bd8deadSopenharmony_ci    not overwritten first.
9695bd8deadSopenharmony_ci
9705bd8deadSopenharmony_ci    When geometry program execution completes, the current primitive is
9715bd8deadSopenharmony_ci    automatically terminated.  It is not necessary to include an ENDPRIM
9725bd8deadSopenharmony_ci    instruction if the geometry program writes only a single primitive.
9735bd8deadSopenharmony_ci
9745bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.5 Specification (Rasterization)
9755bd8deadSopenharmony_ci
9765bd8deadSopenharmony_ci    Modify Section 3.3, Points (p. 95)
9775bd8deadSopenharmony_ci
9785bd8deadSopenharmony_ci    (replace all Section 3.3 text on p. 95) A point is drawn by generating a
9795bd8deadSopenharmony_ci    set of fragments in the shape of a square or circle centered around the
9805bd8deadSopenharmony_ci    vertex of the point.  Each vertex has an associated point size that
9815bd8deadSopenharmony_ci    controls the size of that square or circle.
9825bd8deadSopenharmony_ci
9835bd8deadSopenharmony_ci    If no vertex or geometry program is active, the size of the point is
9845bd8deadSopenharmony_ci    controlled by
9855bd8deadSopenharmony_ci
9865bd8deadSopenharmony_ci      void PointSize(float size);
9875bd8deadSopenharmony_ci
9885bd8deadSopenharmony_ci    <size> specifies the requested size of a point. The default value is
9895bd8deadSopenharmony_ci    1.0. A value less than or equal to zero results in the error
9905bd8deadSopenharmony_ci    INVALID_VALUE.
9915bd8deadSopenharmony_ci
9925bd8deadSopenharmony_ci    The requested point size is multiplied with a distance attenuation factor,
9935bd8deadSopenharmony_ci    clamped to a specified point size range, and further clamped to the
9945bd8deadSopenharmony_ci    implementation-dependent point size range to produce the derived point
9955bd8deadSopenharmony_ci    size:
9965bd8deadSopenharmony_ci
9975bd8deadSopenharmony_ci       derived size = clamp(size * sqrt(1/(a+b*d+c*d^2)))
9985bd8deadSopenharmony_ci
9995bd8deadSopenharmony_ci    where d is the eye-coordinate distance from the eye, (0,0,0,1) in eye
10005bd8deadSopenharmony_ci    coordinates, to the vertex, and a, b, and c are distance attenuation
10015bd8deadSopenharmony_ci    function coefficients.
10025bd8deadSopenharmony_ci
10035bd8deadSopenharmony_ci    If a vertex or geometry program is active, the derived size depends on the
10045bd8deadSopenharmony_ci    per-vertex point size mode enable.  Per-vertex point size mode is enabled
10055bd8deadSopenharmony_ci    or disabled by calling Enable or Disable with the symbolic value
10065bd8deadSopenharmony_ci    PROGRAM_POINT_SIZE_EXT.  If per-vertex point size is enabled and a geometry
10075bd8deadSopenharmony_ci    program is active, the point size is taken from the point size emitted by
10085bd8deadSopenharmony_ci    the geometry program.  If per-vertex point size is enabled an no geometry
10095bd8deadSopenharmony_ci    program is active, the point size is taken from the point size result of
10105bd8deadSopenharmony_ci    the vertex program.  Otherwise, the point size is taken from the <size>
10115bd8deadSopenharmony_ci    value provided to PointSize, with no distance attenuation applied.  In all
10125bd8deadSopenharmony_ci    cases, the point size is clamped to the implementation-dependent point
10135bd8deadSopenharmony_ci    size range.
10145bd8deadSopenharmony_ci
10155bd8deadSopenharmony_ci    If multisampling is not enabled, the derived size is passed on to
10165bd8deadSopenharmony_ci    rasterization as the point width. ...
10175bd8deadSopenharmony_ci
10185bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.5 Specification (Per-Fragment
10195bd8deadSopenharmony_ciOperations and the Frame Buffer)
10205bd8deadSopenharmony_ci
10215bd8deadSopenharmony_ci    None.
10225bd8deadSopenharmony_ci
10235bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.5 Specification (Special Functions)
10245bd8deadSopenharmony_ci
10255bd8deadSopenharmony_ci    None.
10265bd8deadSopenharmony_ci
10275bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.5 Specification (State and
10285bd8deadSopenharmony_ciState Requests)
10295bd8deadSopenharmony_ci
10305bd8deadSopenharmony_ci    None.
10315bd8deadSopenharmony_ci
10325bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.5 Specification (Invariance)
10335bd8deadSopenharmony_ci
10345bd8deadSopenharmony_ci    None.
10355bd8deadSopenharmony_ci
10365bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci    None.
10395bd8deadSopenharmony_ci
10405bd8deadSopenharmony_ciGLX Protocol
10415bd8deadSopenharmony_ci
10425bd8deadSopenharmony_ci    The following rendering commands are sent to the server as part of a
10435bd8deadSopenharmony_ci    glXRender request:
10445bd8deadSopenharmony_ci
10455bd8deadSopenharmony_ci    ProgramVertexLimitNV
10465bd8deadSopenharmony_ci
10475bd8deadSopenharmony_ci        2           12               rendering command length
10485bd8deadSopenharmony_ci        2           4312             rendering command opcode
10495bd8deadSopenharmony_ci        4           ENUM             target
10505bd8deadSopenharmony_ci        4           INT32            limit
10515bd8deadSopenharmony_ci
10525bd8deadSopenharmony_ci
10535bd8deadSopenharmony_ci    The extension EXT_geometry_shader4 defines GLX protocol for
10545bd8deadSopenharmony_ci    the following non-rendering commands:
10555bd8deadSopenharmony_ci
10565bd8deadSopenharmony_ci        FramebufferTextureEXT, FramebufferTextureLayerEXT,
10575bd8deadSopenharmony_ci        FramebufferTextureFaceEXT.
10585bd8deadSopenharmony_ci
10595bd8deadSopenharmony_ciErrors
10605bd8deadSopenharmony_ci
10615bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if Begin, or any command that
10625bd8deadSopenharmony_ci    implicitly calls Begin, is called when geometry program mode is enabled
10635bd8deadSopenharmony_ci    and the currently bound geometry program object does not contain a valid
10645bd8deadSopenharmony_ci    geometry program.
10655bd8deadSopenharmony_ci
10665bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if Begin, or any command that
10675bd8deadSopenharmony_ci    implicitly calls Begin, is called when geometry program mode is enabled
10685bd8deadSopenharmony_ci    and:
10695bd8deadSopenharmony_ci
10705bd8deadSopenharmony_ci      * the input primitive type of the current geometry program is POINTS and
10715bd8deadSopenharmony_ci        <mode> is not POINTS,
10725bd8deadSopenharmony_ci
10735bd8deadSopenharmony_ci      * the input primitive type of the current geometry program is LINES and
10745bd8deadSopenharmony_ci        <mode> is not LINES, LINE_STRIP, or LINE_LOOP,
10755bd8deadSopenharmony_ci
10765bd8deadSopenharmony_ci      * the input primitive type of the current geometry program is TRIANGLES
10775bd8deadSopenharmony_ci        and <mode> is not TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, QUADS,
10785bd8deadSopenharmony_ci        QUAD_STRIP, or POLYGON,
10795bd8deadSopenharmony_ci
10805bd8deadSopenharmony_ci      * the input primitive type of the current geometry program is
10815bd8deadSopenharmony_ci        LINES_ADJACENCY and <mode> is not LINES_ADJACENCY_EXT or
10825bd8deadSopenharmony_ci        LINE_STRIP_ADJACENCY_EXT, or
10835bd8deadSopenharmony_ci
10845bd8deadSopenharmony_ci      * the input primitive type of the current geometry program is
10855bd8deadSopenharmony_ci        TRIANGLES_ADJACENCY and <mode> is not TRIANGLES_ADJACENCY_EXT or
10865bd8deadSopenharmony_ci        TRIANGLE_STRIP_ADJACENCY_EXT.
10875bd8deadSopenharmony_ci
10885bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if GetProgramivARB is called with a 
10895bd8deadSopenharmony_ci    <pname> of MAX_PROGRAM_OUTPUT_VERTICES_NV or
10905bd8deadSopenharmony_ci    MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV and the target isn't
10915bd8deadSopenharmony_ci    GEOMETRY_PROGRAM_NV.
10925bd8deadSopenharmony_ci
10935bd8deadSopenharmony_ciDependencies on EXT_framebuffer_object
10945bd8deadSopenharmony_ci
10955bd8deadSopenharmony_ci    If EXT_framebuffer_object (or similar functionality) is not supported, the
10965bd8deadSopenharmony_ci    "result.layer" binding should be removed.  "FramebufferTextureEXT" and
10975bd8deadSopenharmony_ci    "FramebufferTextureLayerEXT" should be removed from "New Procedures and
10985bd8deadSopenharmony_ci    Functions", and FRAMEBUFFER_ATTACHMENT_LAYERED_EXT,
10995bd8deadSopenharmony_ci    FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT, and
11005bd8deadSopenharmony_ci    FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT should be removed from "New
11015bd8deadSopenharmony_ci    Tokens".
11025bd8deadSopenharmony_ci
11035bd8deadSopenharmony_ci    Otherwise, this extension modifies EXT_framebuffer_object to add the
11045bd8deadSopenharmony_ci    notion of layered framebuffer attachments and framebuffers that can be
11055bd8deadSopenharmony_ci    used in conjunction with geometry programs to allow programs to direct
11065bd8deadSopenharmony_ci    primitives to a face of a cube map or layer of a three-dimensional texture
11075bd8deadSopenharmony_ci    or one- or two-dimensional array texture.  The layer used for rendering
11085bd8deadSopenharmony_ci    can be selected by the geometry program at run time.
11095bd8deadSopenharmony_ci
11105bd8deadSopenharmony_ci    (insert before the end of Section 4.4.2, Attaching Images to Framebuffer
11115bd8deadSopenharmony_ci    Objects)
11125bd8deadSopenharmony_ci
11135bd8deadSopenharmony_ci    There are several types of framebuffer-attachable images:
11145bd8deadSopenharmony_ci
11155bd8deadSopenharmony_ci      * the image of a renderbuffer object, which is always two-dimensional,
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci      * a single level of a one-dimensional texture, which is treated as a
11185bd8deadSopenharmony_ci        two-dimensional image with a height of one,
11195bd8deadSopenharmony_ci
11205bd8deadSopenharmony_ci      * a single level of a two-dimensional or rectangle texture,
11215bd8deadSopenharmony_ci
11225bd8deadSopenharmony_ci      * a single face of a cube map texture level, which is treated as a
11235bd8deadSopenharmony_ci        two-dimensional image, or
11245bd8deadSopenharmony_ci
11255bd8deadSopenharmony_ci      * a single layer of a one- or two-dimensional array texture or
11265bd8deadSopenharmony_ci        three-dimensional texture, which is treated as a two-dimensional
11275bd8deadSopenharmony_ci        image.
11285bd8deadSopenharmony_ci
11295bd8deadSopenharmony_ci    Additionally, an entire level of a three-dimensional texture, cube map
11305bd8deadSopenharmony_ci    texture, or one- or two-dimensional array texture can be attached to an
11315bd8deadSopenharmony_ci    attachment point.  Such attachments are treated as an array of
11325bd8deadSopenharmony_ci    two-dimensional images, arranged in layers, and the corresponding
11335bd8deadSopenharmony_ci    attachment point is considered to be layered.
11345bd8deadSopenharmony_ci
11355bd8deadSopenharmony_ci    (replace section 4.4.2.3, "Attaching Texture Images to a Framebuffer")
11365bd8deadSopenharmony_ci
11375bd8deadSopenharmony_ci    GL supports copying the rendered contents of the framebuffer into the
11385bd8deadSopenharmony_ci    images of a texture object through the use of the routines
11395bd8deadSopenharmony_ci    CopyTexImage{1D|2D}, and CopyTexSubImage{1D|2D|3D}.  Additionally, GL
11405bd8deadSopenharmony_ci    supports rendering directly into the images of a texture object.
11415bd8deadSopenharmony_ci
11425bd8deadSopenharmony_ci    To render directly into a texture image, a specified level of a texture
11435bd8deadSopenharmony_ci    object can be attached as one of the logical buffers of the currently
11445bd8deadSopenharmony_ci    bound framebuffer object by calling:
11455bd8deadSopenharmony_ci
11465bd8deadSopenharmony_ci      void FramebufferTextureEXT(enum target, enum attachment,
11475bd8deadSopenharmony_ci                                 uint texture, int level);
11485bd8deadSopenharmony_ci
11495bd8deadSopenharmony_ci    <target> must be FRAMEBUFFER_EXT.  <attachment> must be one of the
11505bd8deadSopenharmony_ci    attachment points of the framebuffer listed in table 1.nnn.
11515bd8deadSopenharmony_ci
11525bd8deadSopenharmony_ci    If <texture> is zero, any image or array of images attached to the
11535bd8deadSopenharmony_ci    attachment point named by <attachment> is detached, and the state of the
11545bd8deadSopenharmony_ci    attachment point is reset to its initial values.  <level> is ignored if
11555bd8deadSopenharmony_ci    <texture> is zero.
11565bd8deadSopenharmony_ci
11575bd8deadSopenharmony_ci    If <texture> is non-zero, FramebufferTextureEXT attaches level <level> of
11585bd8deadSopenharmony_ci    the texture object named <texture> to the framebuffer attachment point
11595bd8deadSopenharmony_ci    named by <attachment>.  The error INVALID_VALUE is generated if <texture>
11605bd8deadSopenharmony_ci    is not the name of a texture object, or if <level> is not a supported
11615bd8deadSopenharmony_ci    texture level number for textures of the type corresponding to <target>.
11625bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if <texture> is the name of a
11635bd8deadSopenharmony_ci    buffer texture.
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci    If <texture> is the name of a three-dimensional texture, cube map texture,
11665bd8deadSopenharmony_ci    or one- or two-dimensional array texture, the texture level attached to
11675bd8deadSopenharmony_ci    the framebuffer attachment point is an array of images, and the
11685bd8deadSopenharmony_ci    framebuffer attachment is considered layered.
11695bd8deadSopenharmony_ci
11705bd8deadSopenharmony_ci    The command
11715bd8deadSopenharmony_ci
11725bd8deadSopenharmony_ci      void FramebufferTextureLayerEXT(enum target, enum attachment,
11735bd8deadSopenharmony_ci                                      uint texture, int level, int layer);
11745bd8deadSopenharmony_ci
11755bd8deadSopenharmony_ci    operates like FramebufferTextureEXT, except that only a single layer of
11765bd8deadSopenharmony_ci    the texture level, numbered <layer>, is attached to the attachment point.
11775bd8deadSopenharmony_ci    If <texture> is non-zero, the error INVALID_VALUE is generated if <layer>
11785bd8deadSopenharmony_ci    is negative, or if <texture> is not the name of a texture object.  The
11795bd8deadSopenharmony_ci    error INVALID_OPERATION is generated unless <texture> is zero or the name
11805bd8deadSopenharmony_ci    of a three-dimensional or one- or two-dimensional array texture.
11815bd8deadSopenharmony_ci
11825bd8deadSopenharmony_ci    The command
11835bd8deadSopenharmony_ci
11845bd8deadSopenharmony_ci      void FramebufferTextureFaceEXT(enum target, enum attachment,
11855bd8deadSopenharmony_ci                                     uint texture, int level, enum face);
11865bd8deadSopenharmony_ci
11875bd8deadSopenharmony_ci    operates like FramebufferTextureEXT, except that only a single face of a
11885bd8deadSopenharmony_ci    cube map texture, given by <face>, is attached to the attachment point.
11895bd8deadSopenharmony_ci    <face> is one of TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
11905bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
11915bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z. If <texture> is
11925bd8deadSopenharmony_ci    non-zero, the error INVALID_VALUE is generated if <texture> is not the
11935bd8deadSopenharmony_ci    name of a texture object.  The error INVALID_OPERATION is generated unless
11945bd8deadSopenharmony_ci    <texture> is zero or the name of a cube map texture.
11955bd8deadSopenharmony_ci
11965bd8deadSopenharmony_ci    The command
11975bd8deadSopenharmony_ci
11985bd8deadSopenharmony_ci      void FramebufferTexture1DEXT(enum target, enum attachment,
11995bd8deadSopenharmony_ci                                   enum textarget, uint texture, int level);
12005bd8deadSopenharmony_ci
12015bd8deadSopenharmony_ci    operates identically to FramebufferTextureEXT, except for two additional
12025bd8deadSopenharmony_ci    restrictions.  If <texture> is non-zero, the error INVALID_ENUM is
12035bd8deadSopenharmony_ci    generated if <textarget> is not TEXTURE_1D and the error INVALID_OPERATION
12045bd8deadSopenharmony_ci    is generated unless <texture> is the name of a one-dimensional texture.
12055bd8deadSopenharmony_ci
12065bd8deadSopenharmony_ci    The command
12075bd8deadSopenharmony_ci
12085bd8deadSopenharmony_ci      void FramebufferTexture2DEXT(enum target, enum attachment,
12095bd8deadSopenharmony_ci                                   enum textarget, uint texture, int level);
12105bd8deadSopenharmony_ci
12115bd8deadSopenharmony_ci    operates similarly to FramebufferTextureEXT.  If <textarget> is TEXTURE_2D
12125bd8deadSopenharmony_ci    or TEXTURE_RECTANGLE_ARB, <texture> must be zero or the name of a
12135bd8deadSopenharmony_ci    two-dimensional or rectangle texture.  If <textarget> is
12145bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
12155bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
12165bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z, <texture>
12175bd8deadSopenharmony_ci    must be zero or the name of a cube map texture.  For cube map textures,
12185bd8deadSopenharmony_ci    only the single face of the cube map texture level given by <textarget> is
12195bd8deadSopenharmony_ci    attached.  The error INVALID_ENUM is generated if <texture> is not zero
12205bd8deadSopenharmony_ci    and <textarget> is not one of the values enumerated above.  The error
12215bd8deadSopenharmony_ci    INVALID_OPERATION is generated if <texture> is the name of a texture whose
12225bd8deadSopenharmony_ci    type does not match the texture type required by <textarget>.
12235bd8deadSopenharmony_ci
12245bd8deadSopenharmony_ci    The command
12255bd8deadSopenharmony_ci
12265bd8deadSopenharmony_ci      void FramebufferTexture3DEXT(enum target, enum attachment,
12275bd8deadSopenharmony_ci                                   enum textarget, uint texture,
12285bd8deadSopenharmony_ci                                   int level, int zoffset);
12295bd8deadSopenharmony_ci
12305bd8deadSopenharmony_ci    behaves identically to FramebufferTextureLayerEXT, with the <layer>
12315bd8deadSopenharmony_ci    parameter set to the value of <zoffset>.  The error INVALID_ENUM is
12325bd8deadSopenharmony_ci    generated if <textarget> is not TEXTURE_3D.  The error INVALID_OPERATION
12335bd8deadSopenharmony_ci    is generated unless <texture> is zero or the name of a three-dimensional
12345bd8deadSopenharmony_ci    texture.
12355bd8deadSopenharmony_ci
12365bd8deadSopenharmony_ci    For all FramebufferTexture commands, if <texture> is non-zero and the
12375bd8deadSopenharmony_ci    command does not result in an error, the framebuffer attachment state
12385bd8deadSopenharmony_ci    corresponding to <attachment> is updated based on the new attachment.
12395bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is set to TEXTURE,
12405bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT is set to <texture>, and
12415bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL is set to <level>.
12425bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_FACE is set to <textarget> if
12435bd8deadSopenharmony_ci    FramebufferTexture2DEXT is called and <texture> is the name of a cubemap
12445bd8deadSopenharmony_ci    texture; otherwise, it is set to TEXTURE_CUBE_MAP_POSITIVE_X.
12455bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT is set to <layer> or <zoffset> if
12465bd8deadSopenharmony_ci    FramebufferTextureLayerEXT or FramebufferTexture3DEXT is called;
12475bd8deadSopenharmony_ci    otherwise, it is set to zero.  FRAMEBUFFER_ATTACHMENT_LAYERED_EXT is set
12485bd8deadSopenharmony_ci    to TRUE if FramebufferTextureEXT is called and <texture> is the name of a
12495bd8deadSopenharmony_ci    three-dimensional texture, cube map texture, or one- or two-dimensional
12505bd8deadSopenharmony_ci    array texture; otherwise it is set to FALSE.
12515bd8deadSopenharmony_ci
12525bd8deadSopenharmony_ci    (modify Section 4.4.4.1, Framebuffer Attachment Completeness -- add to the
12535bd8deadSopenharmony_ci    conditions necessary for attachment completeness)
12545bd8deadSopenharmony_ci
12555bd8deadSopenharmony_ci    The framebuffer attachment point <attachment> is said to be "framebuffer
12565bd8deadSopenharmony_ci    attachment complete" if ...:
12575bd8deadSopenharmony_ci
12585bd8deadSopenharmony_ci      * If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and
12595bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a three-dimensional
12605bd8deadSopenharmony_ci        texture, FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be smaller than
12615bd8deadSopenharmony_ci        the depth of the texture.
12625bd8deadSopenharmony_ci
12635bd8deadSopenharmony_ci      * If FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE and
12645bd8deadSopenharmony_ci        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT names a one- or two-dimensional
12655bd8deadSopenharmony_ci        array texture, FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT must be
12665bd8deadSopenharmony_ci        smaller than the number of layers in the texture.
12675bd8deadSopenharmony_ci
12685bd8deadSopenharmony_ci    (modify section 4.4.4.2, Framebuffer Completeness -- add to the list of
12695bd8deadSopenharmony_ci    conditions necessary for completeness)
12705bd8deadSopenharmony_ci
12715bd8deadSopenharmony_ci      * If any framebuffer attachment is layered, all populated attachments
12725bd8deadSopenharmony_ci        must be layered.  Additionally, all populated color attachments must
12735bd8deadSopenharmony_ci        be from textures of the same target (i.e., three-dimensional, cube
12745bd8deadSopenharmony_ci        map, or one- or two-dimensional array textures).
12755bd8deadSopenharmony_ci        { FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT }
12765bd8deadSopenharmony_ci
12775bd8deadSopenharmony_ci      * If any framebuffer attachment is layered, all attachments must have
12785bd8deadSopenharmony_ci        the same layer count.  For three-dimensional textures, the layer count
12795bd8deadSopenharmony_ci        is the depth of the attached volume.  For cube map textures, the layer
12805bd8deadSopenharmony_ci        count is always six.  For one- and two-dimensional array textures, the
12815bd8deadSopenharmony_ci        layer count is simply the number of layers in the array texture.
12825bd8deadSopenharmony_ci        { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT }
12835bd8deadSopenharmony_ci
12845bd8deadSopenharmony_ci    The enum in { brackets } after each clause of the framebuffer completeness
12855bd8deadSopenharmony_ci    rules specifies the return value of CheckFramebufferStatusEXT (see below)
12865bd8deadSopenharmony_ci    that is generated when that clause is violated. ...
12875bd8deadSopenharmony_ci
12885bd8deadSopenharmony_ci    (add section 4.4.7, Layered Framebuffers)
12895bd8deadSopenharmony_ci
12905bd8deadSopenharmony_ci    A framebuffer is considered to be layered if it is complete and all of its
12915bd8deadSopenharmony_ci    populated attachments are layered.  When rendering to a layered
12925bd8deadSopenharmony_ci    framebuffer, each fragment generated by the GL is assigned a layer number.
12935bd8deadSopenharmony_ci    The layer number for a fragment is zero if
12945bd8deadSopenharmony_ci
12955bd8deadSopenharmony_ci      * the fragment is generated by DrawPixels, CopyPixels, or Bitmap,
12965bd8deadSopenharmony_ci
12975bd8deadSopenharmony_ci      * geometry programs are disabled, or
12985bd8deadSopenharmony_ci
12995bd8deadSopenharmony_ci      * the current geometry program does not contain an instruction that
13005bd8deadSopenharmony_ci        writes to the layer result binding.
13015bd8deadSopenharmony_ci
13025bd8deadSopenharmony_ci    Otherwise, the layer for each point, line, or triangle emitted by the
13035bd8deadSopenharmony_ci    geometry program is taken from the layer output of the provoking vertex.
13045bd8deadSopenharmony_ci    For line strips, the provoking vertex is the second vertex of each line
13055bd8deadSopenharmony_ci    segment.  For triangle strips, the provoking vertex is the third vertex of
13065bd8deadSopenharmony_ci    each individual triangles.  The per-fragment layer can be different for
13075bd8deadSopenharmony_ci    fragments generated by each individual point, line, or triangle emitted by
13085bd8deadSopenharmony_ci    a single geometry program invocation.  A layer number written by a
13095bd8deadSopenharmony_ci    geometry program has no effect if the framebuffer is not layered.
13105bd8deadSopenharmony_ci
13115bd8deadSopenharmony_ci    When fragments are written to a layered framebuffer, the fragment's layer
13125bd8deadSopenharmony_ci    number selects a single image from the array of images at each attachment
13135bd8deadSopenharmony_ci    point to use for the stencil test (section 4.1.5), depth buffer test
13145bd8deadSopenharmony_ci    (section 4.1.6), and for blending and color buffer writes (section 4.1.8).
13155bd8deadSopenharmony_ci    If the fragment's layer number is negative or greater than the number of
13165bd8deadSopenharmony_ci    layers attached, the effects of the fragment on the framebuffer contents
13175bd8deadSopenharmony_ci    are undefined.
13185bd8deadSopenharmony_ci
13195bd8deadSopenharmony_ci    When the Clear command is used to clear a layered framebuffer attachment,
13205bd8deadSopenharmony_ci    all layers of the attachment are cleared.
13215bd8deadSopenharmony_ci
13225bd8deadSopenharmony_ci    When commands such as ReadPixels or CopyPixels read from a layered
13235bd8deadSopenharmony_ci    framebuffer, the image at layer zero of the selected attachment is always
13245bd8deadSopenharmony_ci    used to obtain pixel values.
13255bd8deadSopenharmony_ci
13265bd8deadSopenharmony_ci    When cube map texture levels are attached to a layered framebuffer, there
13275bd8deadSopenharmony_ci    are six layers attached, numbered zero through five.  Each layer number is
13285bd8deadSopenharmony_ci    mapped to a cube map face, as indicated in Table X.4.
13295bd8deadSopenharmony_ci
13305bd8deadSopenharmony_ci      layer number   cube map face
13315bd8deadSopenharmony_ci      ------------   ---------------------------
13325bd8deadSopenharmony_ci           0         TEXTURE_CUBE_MAP_POSITIVE_X
13335bd8deadSopenharmony_ci           1         TEXTURE_CUBE_MAP_NEGATIVE_X
13345bd8deadSopenharmony_ci           2         TEXTURE_CUBE_MAP_POSITIVE_Y
13355bd8deadSopenharmony_ci           3         TEXTURE_CUBE_MAP_NEGATIVE_Y
13365bd8deadSopenharmony_ci           4         TEXTURE_CUBE_MAP_POSITIVE_Z
13375bd8deadSopenharmony_ci           5         TEXTURE_CUBE_MAP_NEGATIVE_Z
13385bd8deadSopenharmony_ci
13395bd8deadSopenharmony_ci      Table X.4, Layer numbers for cube map texture faces.  The layers are
13405bd8deadSopenharmony_ci      numbered in the same sequence as the cube map face token values.
13415bd8deadSopenharmony_ci
13425bd8deadSopenharmony_ci    (modify Section 6.1.3, Enumerated Queries -- Modify/add to list of <pname>
13435bd8deadSopenharmony_ci    values for GetFramebufferAttachmentParameterivEXT if
13445bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT is TEXTURE)
13455bd8deadSopenharmony_ci
13465bd8deadSopenharmony_ci      If <pname> is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT and the attached
13475bd8deadSopenharmony_ci      image is a layer of a three-dimensional texture or one- or
13485bd8deadSopenharmony_ci      two-dimensional array texture, then <params> will contain the specified
13495bd8deadSopenharmony_ci      layer number.  Otherwise, <params> will contain the value zero.
13505bd8deadSopenharmony_ci
13515bd8deadSopenharmony_ci      If <pname> is FRAMEBUFFER_ATTACHMENT_LAYERED_EXT, then <params> will
13525bd8deadSopenharmony_ci      contain TRUE if an entire level of a three-dimesional texture, cube map
13535bd8deadSopenharmony_ci      texture, or one- or two-dimensional array texture is attached to the
13545bd8deadSopenharmony_ci      <attachment>.  Otherwise, <params> will contain FALSE.
13555bd8deadSopenharmony_ci
13565bd8deadSopenharmony_ci    (Modify the Additions to Chapter 5, section 5.4)
13575bd8deadSopenharmony_ci
13585bd8deadSopenharmony_ci    Add the commands FramebufferTextureEXT, FramebufferTextureLayerEXT, and
13595bd8deadSopenharmony_ci    FramebufferTextureFaceEXT to the list of commands that are not compiled
13605bd8deadSopenharmony_ci    into a display list, but executed immediately.
13615bd8deadSopenharmony_ci
13625bd8deadSopenharmony_ciDependencies on EXT_framebuffer_blit
13635bd8deadSopenharmony_ci
13645bd8deadSopenharmony_ci    If EXT_framebuffer_blit is supported, the EXT_framebuffer_object language
13655bd8deadSopenharmony_ci    should be further amended so that <target> values passed to
13665bd8deadSopenharmony_ci    FramebufferTextureEXT and FramebufferTextureLayerEXT can be
13675bd8deadSopenharmony_ci    DRAW_FRAMEBUFFER_EXT or READ_FRAMEBUFFER_EXT, and that those functions
13685bd8deadSopenharmony_ci    set/query state for the draw framebuffer if <target> is FRAMEBUFFER_EXT.
13695bd8deadSopenharmony_ci
13705bd8deadSopenharmony_ci    If BlitFramebufferEXT() is called with a layered read framebuffer, pixel
13715bd8deadSopenharmony_ci    values are obtained from layer zero from the read framebuffer.  If the
13725bd8deadSopenharmony_ci    draw framebuffer is layered, pixel values are written to layer zero of the
13735bd8deadSopenharmony_ci    draw framebuffer.  If both framebuffers are layered, the two-dimensional
13745bd8deadSopenharmony_ci    blit operation is still performed only on layer zero.
13755bd8deadSopenharmony_ci
13765bd8deadSopenharmony_ciDependencies on EXT_texture_array
13775bd8deadSopenharmony_ci
13785bd8deadSopenharmony_ci    If EXT_texture_array is not supported, the discussion array textures the
13795bd8deadSopenharmony_ci    layered rendering edits to EXT_framebuffer_object should be removed.
13805bd8deadSopenharmony_ci    Layered rendering to cube map and 3D textures would still be supported.
13815bd8deadSopenharmony_ci
13825bd8deadSopenharmony_ci    If EXT_texture_array is supported, the edits to EXT_framebuffer_object
13835bd8deadSopenharmony_ci    supersede those made in EXT_texture_array, except for language pertaining
13845bd8deadSopenharmony_ci    to mipmap generation of array textures.  
13855bd8deadSopenharmony_ci
13865bd8deadSopenharmony_ci    There are no functional incompatibilities between the FBO support in these
13875bd8deadSopenharmony_ci    two specifications.  The only differences are that this extension supports
13885bd8deadSopenharmony_ci    layered rendering and also rewrites certain sections of the core FBO
13895bd8deadSopenharmony_ci    specification more aggressively.
13905bd8deadSopenharmony_ci
13915bd8deadSopenharmony_ciDependencies on ARB_texture_rectangle
13925bd8deadSopenharmony_ci
13935bd8deadSopenharmony_ci    If ARB_texture_rectangle is not supported, all references to rectangle
13945bd8deadSopenharmony_ci    textures in the EXT_framebuffer_object spec language should be removed.
13955bd8deadSopenharmony_ci
13965bd8deadSopenharmony_ciDependencies on EXT_texture_buffer_object
13975bd8deadSopenharmony_ci
13985bd8deadSopenharmony_ci    If EXT_buffer_object is not supported, the reference to an
13995bd8deadSopenharmony_ci    INVALID_OPERATION error if a buffer texture is passed to
14005bd8deadSopenharmony_ci    FramebufferTextureEXT should be removed.
14015bd8deadSopenharmony_ci
14025bd8deadSopenharmony_ciDependencies on NV_primitive_restart
14035bd8deadSopenharmony_ci
14045bd8deadSopenharmony_ci    The spec describes the behavior that primitive restart does not affect the
14055bd8deadSopenharmony_ci    primitive ID counter, including for POLYGON primitives (where one could
14065bd8deadSopenharmony_ci    argue that the restart index starts a new primitive without a new Begin to
14075bd8deadSopenharmony_ci    reset the count).  If NV_primitive_restart is not supported, references to
14085bd8deadSopenharmony_ci    that extension in the discussion of the "primitive.id" attribute should be
14095bd8deadSopenharmony_ci    removed.
14105bd8deadSopenharmony_ci
14115bd8deadSopenharmony_ciNew State
14125bd8deadSopenharmony_ci                                                       Initial
14135bd8deadSopenharmony_ci    Get Value                  Type    Get Command      Value  Description            Sec.    Attribute
14145bd8deadSopenharmony_ci    -------------------------  ----    -----------     ------- ---------------------- ------  ---------
14155bd8deadSopenharmony_ci    GEOMETRY_PROGRAM_NV         B      IsEnabled        FALSE  Geometry shader enable 2.14.6   enable
14165bd8deadSopenharmony_ci    FRAMEBUFFER_ATTACHMENT_    nxB     GetFramebuffer-  FALSE  Framebuffer attachment 4.4.2.3    -
14175bd8deadSopenharmony_ci      LAYERED_EXT                      Attachment-             is layered
14185bd8deadSopenharmony_ci                                       ParameterivEXT
14195bd8deadSopenharmony_ci    GEOMETRY_VERTICES_OUT_EXT   Z+     GetProgramivARB    0    vertex limit of the    2.14.6.4   -
14205bd8deadSopenharmony_ci                                                               current geometry 
14215bd8deadSopenharmony_ci                                                               program
14225bd8deadSopenharmony_ci    GEOMETRY_INPUT_TYPE_EXT     Z+     GetProgramivARB    0    input primitive type   2.14.6.4   -
14235bd8deadSopenharmony_ci                                                               of the current geometry 
14245bd8deadSopenharmony_ci                                                               program
14255bd8deadSopenharmony_ci    GEOMETRY_OUTPUT_TYPE_EXT    Z+     GetProgramivARB    0    output primitive type  2.14.6.4   -
14265bd8deadSopenharmony_ci                                                               of the current geometry 
14275bd8deadSopenharmony_ci                                                               program
14285bd8deadSopenharmony_ci
14295bd8deadSopenharmony_ciNew Implementation Dependent State
14305bd8deadSopenharmony_ci
14315bd8deadSopenharmony_ci                                                              Minimum
14325bd8deadSopenharmony_ci    Get Value                        Type    Get Command      Value       Description             Sec           Attrib
14335bd8deadSopenharmony_ci    -------------------------------  ----    ---------------  ----------  --------------------    ------------  ------
14345bd8deadSopenharmony_ci    MAX_GEOMETRY_TEXTURE_            Z+      GetIntegerv      16          maximum number of       2.14.6.3      -
14355bd8deadSopenharmony_ci        IMAGE_UNITS_EXT                                                   texture image units
14365bd8deadSopenharmony_ci                                                                          accessible in a
14375bd8deadSopenharmony_ci                                                                          geometry program
14385bd8deadSopenharmony_ci    MAX_PROGRAM_OUTPUT_VERTICES_NV   Z+      GetProgramivARB  256         maximum number of       2.14.6.4      -
14395bd8deadSopenharmony_ci                                                                          vertices that any
14405bd8deadSopenharmony_ci                                                                          geometry program
14415bd8deadSopenharmony_ci                                                                          could emit
14425bd8deadSopenharmony_ci    MAX_PROGRAM_TOTAL_OUTPUT_        Z+      GetProgramivARB  1024        maximum number of       2.14.6.4      -
14435bd8deadSopenharmony_ci      COMPONENTS_NV                                                       result components (all
14445bd8deadSopenharmony_ci                                                                          vertices) that a
14455bd8deadSopenharmony_ci                                                                          geometry program
14465bd8deadSopenharmony_ci                                                                          can emit
14475bd8deadSopenharmony_ci
14485bd8deadSopenharmony_ci
14495bd8deadSopenharmony_ciNVIDIA Implementation Details
14505bd8deadSopenharmony_ci
14515bd8deadSopenharmony_ci    Because of a hardware limitation, some GeForce 8 series chips use the
14525bd8deadSopenharmony_ci    odd vertex of an incomplete TRIANGLE_STRIP_ADJACENCY_EXT primitive
14535bd8deadSopenharmony_ci    as a replacement adjacency vertex rather than ignoring it.
14545bd8deadSopenharmony_ci
14555bd8deadSopenharmony_ciIssues
14565bd8deadSopenharmony_ci
14575bd8deadSopenharmony_ci    (1) How do geometry programs fit into the existing GL pipeline?
14585bd8deadSopenharmony_ci
14595bd8deadSopenharmony_ci      RESOLVED:  The following diagram illustrates how geometry programs fit
14605bd8deadSopenharmony_ci      into the "vertex processing" portion of the GL (Chapter 2 of the OpenGL
14615bd8deadSopenharmony_ci      2.0 Specification).  
14625bd8deadSopenharmony_ci
14635bd8deadSopenharmony_ci      First, vertex attributes are specified via immediate-mode commands or
14645bd8deadSopenharmony_ci      through vertex arrays.  They can be conventional attributes (e.g.,
14655bd8deadSopenharmony_ci      glVertex, glColor, glTexCoord) or generic (numbered) attributes.
14665bd8deadSopenharmony_ci
14675bd8deadSopenharmony_ci      Vertices are then transformed, either using a vertex program or
14685bd8deadSopenharmony_ci      fixed-function vertex processing.  Fixed-function vertex processing
14695bd8deadSopenharmony_ci      includes position transformation (modelview and projection matrices),
14705bd8deadSopenharmony_ci      lighting, texture coordinate generation, and other calculations.  The
14715bd8deadSopenharmony_ci      results of either method are a "transformed vertex", which has a
14725bd8deadSopenharmony_ci      position (in clip coordinates), front and back colors, texture
14735bd8deadSopenharmony_ci      coordinates, generic attributes (vertex program only), and so on.  Note
14745bd8deadSopenharmony_ci      that on many current GL implementations, vertex processing is performed
14755bd8deadSopenharmony_ci      by executing a "fixed function vertex program" generated by the driver.
14765bd8deadSopenharmony_ci
14775bd8deadSopenharmony_ci      After vertex transformation, vertices are assembled into primitives,
14785bd8deadSopenharmony_ci      according to the topology (e.g., TRIANGLES, QUAD_STRIP) provided by the
14795bd8deadSopenharmony_ci      call to glBegin().  Primitives are points, lines, triangles, quads, or
14805bd8deadSopenharmony_ci      polygons.  Many GL implementations do not directly support quads or
14815bd8deadSopenharmony_ci      polygons, but instead decompose them into triangles as permitted by the
14825bd8deadSopenharmony_ci      spec.
14835bd8deadSopenharmony_ci
14845bd8deadSopenharmony_ci      After initial primitive assembly, a geometry program is executed on each
14855bd8deadSopenharmony_ci      individual point, line, or triangle primitive, if enabled.  It can read
14865bd8deadSopenharmony_ci      the attributes of each transformed vertex, perform arbitrary
14875bd8deadSopenharmony_ci      computations, and emit new transformed vertices.  These emitted vertices
14885bd8deadSopenharmony_ci      are themselves assembled into primitives according to the output
14895bd8deadSopenharmony_ci      primitive type of the geometry program.
14905bd8deadSopenharmony_ci
14915bd8deadSopenharmony_ci      Then, the colors of the vertices of each primitive are clamped to [0,1]
14925bd8deadSopenharmony_ci      (if color clamping is enabled), and flat shading may be performed by
14935bd8deadSopenharmony_ci      taking the color from the provoking vertex of the primitive.
14945bd8deadSopenharmony_ci
14955bd8deadSopenharmony_ci      Each primitive is clipped to the view volume, and to any enabled
14965bd8deadSopenharmony_ci      user-defined clip planes.  Color, texture coordinate, and other
14975bd8deadSopenharmony_ci      attribute values are computed for each new vertex introduced by
14985bd8deadSopenharmony_ci      clipping.
14995bd8deadSopenharmony_ci
15005bd8deadSopenharmony_ci      After clipping, the position of each vertex (in clip coordinates) is
15015bd8deadSopenharmony_ci      converted to normalized device coordinates in the perspective division
15025bd8deadSopenharmony_ci      (divide by w) step, and to window coordinates in the viewport
15035bd8deadSopenharmony_ci      transformation step.
15045bd8deadSopenharmony_ci
15055bd8deadSopenharmony_ci      At the same time, color values may be converted to normalized
15065bd8deadSopenharmony_ci      fixed-point values according to the "Final Color Processing" portion of
15075bd8deadSopenharmony_ci      the specification.
15085bd8deadSopenharmony_ci
15095bd8deadSopenharmony_ci      After the vertices of the primitive are transformed to window
15105bd8deadSopenharmony_ci      coordinate, the GL determines if the primitive is front- or back-facing.
15115bd8deadSopenharmony_ci      That information is used for two-sided color selection, where a single
15125bd8deadSopenharmony_ci      set of colors is selected from either the front or back colors
15135bd8deadSopenharmony_ci      associated with each transformed vertex.
15145bd8deadSopenharmony_ci
15155bd8deadSopenharmony_ci      When all this is done, the final transformed position, colors (primary
15165bd8deadSopenharmony_ci      and secondary), and other attributes are used for rasterization (Chapter
15175bd8deadSopenharmony_ci      3 in the OpenGL 2.0 Specification).
15185bd8deadSopenharmony_ci
15195bd8deadSopenharmony_ci      When the raster position is specified (via glRasterPos), it goes through
15205bd8deadSopenharmony_ci      the entire vertex processing pipeline as though it were a point.
15215bd8deadSopenharmony_ci      However, geometry programs are never run on the raster position.
15225bd8deadSopenharmony_ci
15235bd8deadSopenharmony_ci                        |generic              |conventional
15245bd8deadSopenharmony_ci                        |vertex               |vertex
15255bd8deadSopenharmony_ci                        |attributes           |attributes
15265bd8deadSopenharmony_ci                        |                     |
15275bd8deadSopenharmony_ci                        | +-------------------+
15285bd8deadSopenharmony_ci                        | |                   |
15295bd8deadSopenharmony_ci                        V V                   V
15305bd8deadSopenharmony_ci                      vertex            fixed-function
15315bd8deadSopenharmony_ci                      program              vertex
15325bd8deadSopenharmony_ci                         |               processing
15335bd8deadSopenharmony_ci                         |                    |
15345bd8deadSopenharmony_ci                         |                    |
15355bd8deadSopenharmony_ci                         +<-------------------+                
15365bd8deadSopenharmony_ci                         |                                     Output
15375bd8deadSopenharmony_ci                         |position, color,                   Primitive
15385bd8deadSopenharmony_ci                         |other vertex data                     Type
15395bd8deadSopenharmony_ci                         |                                       |
15405bd8deadSopenharmony_ci                         V                                       |
15415bd8deadSopenharmony_ci        Begin/       primitive        geometry       primitive   |
15425bd8deadSopenharmony_ci         End ------> assembly  -----> program  ----> assembly  <-+
15435bd8deadSopenharmony_ci        State            |                               |
15445bd8deadSopenharmony_ci                         V                               |
15455bd8deadSopenharmony_ci                         +<------------------------------+
15465bd8deadSopenharmony_ci                         |
15475bd8deadSopenharmony_ci                         |
15485bd8deadSopenharmony_ci                         |             color            flat
15495bd8deadSopenharmony_ci                         +----------> clamping ---->  shading
15505bd8deadSopenharmony_ci                         |                               |
15515bd8deadSopenharmony_ci                         V                               |
15525bd8deadSopenharmony_ci                         +<------------------------------+
15535bd8deadSopenharmony_ci                         |
15545bd8deadSopenharmony_ci                         |
15555bd8deadSopenharmony_ci                      clipping
15565bd8deadSopenharmony_ci                         |
15575bd8deadSopenharmony_ci                         |        perspective       viewport
15585bd8deadSopenharmony_ci                         +------>   divide    ----> transform
15595bd8deadSopenharmony_ci                         |                              |
15605bd8deadSopenharmony_ci                         |                          +---+-----+
15615bd8deadSopenharmony_ci                         |                          V         |
15625bd8deadSopenharmony_ci                         |           final        facing      |
15635bd8deadSopenharmony_ci                         +------>    color     determination  |
15645bd8deadSopenharmony_ci                         |         processing       |         |
15655bd8deadSopenharmony_ci                         |             |            |         |
15665bd8deadSopenharmony_ci                         |             |            |         |
15675bd8deadSopenharmony_ci                         |             +-----+ +----+         |
15685bd8deadSopenharmony_ci                         |                   | |              |
15695bd8deadSopenharmony_ci                         |                   V V              |
15705bd8deadSopenharmony_ci                         |                two-sided           |
15715bd8deadSopenharmony_ci                         |                 coloring           |
15725bd8deadSopenharmony_ci                         |                    |               |
15735bd8deadSopenharmony_ci                         |                    |               |
15745bd8deadSopenharmony_ci                         +------------------+ | +-------------+
15755bd8deadSopenharmony_ci                                            | | |
15765bd8deadSopenharmony_ci                                            V V V
15775bd8deadSopenharmony_ci                                        rasterization 
15785bd8deadSopenharmony_ci                                              |
15795bd8deadSopenharmony_ci                                              |
15805bd8deadSopenharmony_ci                                              V
15815bd8deadSopenharmony_ci
15825bd8deadSopenharmony_ci    (2) Why is this called GL_NV_geometry_program4?  There aren't any previous
15835bd8deadSopenharmony_ci    versions of this extension, let alone three?
15845bd8deadSopenharmony_ci
15855bd8deadSopenharmony_ci      RESOLVED:  The instruction set for GPU programs of all types (vertex,
15865bd8deadSopenharmony_ci      fragment, and now geometry) have been unified in the GL_NV_gpu_program4
15875bd8deadSopenharmony_ci      extension, and the "4" suffix in this extension name indicates the
15885bd8deadSopenharmony_ci      instruction set type.  There are three previous NV_vertex_program
15895bd8deadSopenharmony_ci      variants (four if you count NV_vertex_program1_1), so "4" is the next
15905bd8deadSopenharmony_ci      available numeric suffix.
15915bd8deadSopenharmony_ci
15925bd8deadSopenharmony_ci    (3) Should the GL produce errors at Begin time if an application specifies
15935bd8deadSopenharmony_ci    a primitive mode that is "incompatible" with the geometry program?  For
15945bd8deadSopenharmony_ci    example, if the geometry program operates on triangles and the application
15955bd8deadSopenharmony_ci    sends a POINTS primitive?
15965bd8deadSopenharmony_ci
15975bd8deadSopenharmony_ci      RESOLVED:  Yes.  Mismatches of app-specified primitive types and
15985bd8deadSopenharmony_ci      geometry program input primitive types seem like clear errors and would
15995bd8deadSopenharmony_ci      produce weird and wonderful effects.
16005bd8deadSopenharmony_ci
16015bd8deadSopenharmony_ci    (4) Can the input primitive type of a geometry program be changed at run
16025bd8deadSopenharmony_ci    time?
16035bd8deadSopenharmony_ci
16045bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.  Each geometry program has a single
16055bd8deadSopenharmony_ci      input primitive type, and vertices are presented to the program in a
16065bd8deadSopenharmony_ci      specific order based on that type.
16075bd8deadSopenharmony_ci
16085bd8deadSopenharmony_ci    (5) Can the output primitive type of a geometry program be determined at
16095bd8deadSopenharmony_ci    run time?
16105bd8deadSopenharmony_ci
16115bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.
16125bd8deadSopenharmony_ci
16135bd8deadSopenharmony_ci    (6) Must the output primitive type of a geometry program match the input
16145bd8deadSopenharmony_ci    primitive type in any way?
16155bd8deadSopenharmony_ci
16165bd8deadSopenharmony_ci      RESOLVED:  No, you can have a geometry program generate points out of
16175bd8deadSopenharmony_ci      triangles or triangles out of points.  Some combinations are analogous
16185bd8deadSopenharmony_ci      to existing OpenGL operations:  reading triangles and writing points or
16195bd8deadSopenharmony_ci      line strips can be used to emulate a subset of PolygonMode
16205bd8deadSopenharmony_ci      functionality.  Reading points and writing triangle strips can be used
16215bd8deadSopenharmony_ci      to emulate point sprites.
16225bd8deadSopenharmony_ci
16235bd8deadSopenharmony_ci    (7) Are primitives emitted by a geometry program processed like any other
16245bd8deadSopenharmony_ci    OpenGL primitive?
16255bd8deadSopenharmony_ci
16265bd8deadSopenharmony_ci      RESOLVED:  Yes.  Antialiasing, stippling, polygon offset, polygon mode,
16275bd8deadSopenharmony_ci      culling, two-sided lighting and color selection, point sprite
16285bd8deadSopenharmony_ci      operations, and fragment processing all work as expected.  
16295bd8deadSopenharmony_ci
16305bd8deadSopenharmony_ci      One limitation is that the only output primitive types supported are
16315bd8deadSopenharmony_ci      points, line strips, and triangle strips, none of which meaningfully
16325bd8deadSopenharmony_ci      support edge flags that are sometimes used in conjunction with the POINT
16335bd8deadSopenharmony_ci      and LINE polygon modes (edge flags are always ignored for line-mode
16345bd8deadSopenharmony_ci      triangle strips).
16355bd8deadSopenharmony_ci
16365bd8deadSopenharmony_ci    (8) Should geometry programs support additional input primitive types?
16375bd8deadSopenharmony_ci
16385bd8deadSopenharmony_ci      RESOLVED:  Possibly in a future extension.  It should be straightforward
16395bd8deadSopenharmony_ci      to build a future extension to support geometry programs that operate on
16405bd8deadSopenharmony_ci      quads.  Other primitive types might be more demanding on hardware.
16415bd8deadSopenharmony_ci      Quads with adjacency would require 12 vertices per program execution.
16425bd8deadSopenharmony_ci      General polygons may require even more, since there is no fixed bound on
16435bd8deadSopenharmony_ci      the number of vertices in a polygon.
16445bd8deadSopenharmony_ci
16455bd8deadSopenharmony_ci    (9) Should geometry programs support additional output primitive types?
16465bd8deadSopenharmony_ci
16475bd8deadSopenharmony_ci      RESOLVED:  Possibly in a future extension.  Additional output types
16485bd8deadSopenharmony_ci      (e.g., independent lines, line loops, triangle fans, polygons) may be
16495bd8deadSopenharmony_ci      useful in the future; triangle fans/polygons seem particularly useful.
16505bd8deadSopenharmony_ci
16515bd8deadSopenharmony_ci    (10) Should we provide additional adjacency primitive types that can be
16525bd8deadSopenharmony_ci    used inside a Begin/End?
16535bd8deadSopenharmony_ci
16545bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.  It may be desirable to add new
16555bd8deadSopenharmony_ci      primitive types (e.g., TRIANGLE_FAN_ADJACENCY) in a future extension.
16565bd8deadSopenharmony_ci
16575bd8deadSopenharmony_ci    (11) How do geometry programs interact with RasterPos?
16585bd8deadSopenharmony_ci
16595bd8deadSopenharmony_ci      RESOLVED:  Geometry programs are ignored when specifying the raster
16605bd8deadSopenharmony_ci      position.  While the raster position could be treated as a point,
16615bd8deadSopenharmony_ci      turning it into a triangle strip would be quite bizarre.
16625bd8deadSopenharmony_ci
16635bd8deadSopenharmony_ci    (12) How do geometry programs interact with pixel primitives (DrawPixels,
16645bd8deadSopenharmony_ci    Bitmap)?
16655bd8deadSopenharmony_ci
16665bd8deadSopenharmony_ci      RESOLVED:  They do not.  Fragments generated be DrawPixels and Bitmap
16675bd8deadSopenharmony_ci      are injected into the pipeline after the point where geometry program
16685bd8deadSopenharmony_ci      execution occurs.
16695bd8deadSopenharmony_ci
16705bd8deadSopenharmony_ci    (13) Is there a limit on the number of vertices that can be emitted by a
16715bd8deadSopenharmony_ci    geometry program?
16725bd8deadSopenharmony_ci
16735bd8deadSopenharmony_ci      RESOLVED:  Unfortunately, yes.  Besides practical hardware limits, there
16745bd8deadSopenharmony_ci      may also be practical performance advantages when applications guarantee
16755bd8deadSopenharmony_ci      a tight upper bound on the number of vertices a geometry shader will
16765bd8deadSopenharmony_ci      emit.  GPUs frequently excecute programs in parallel, and there are
16775bd8deadSopenharmony_ci      substantial implementation challenges to parallel execution of geometry
16785bd8deadSopenharmony_ci      threads that can write an unbounded number of results, particular given
16795bd8deadSopenharmony_ci      that the all the primitives generated by the first geometry program
16805bd8deadSopenharmony_ci      invocation must be consumed before any of the primitives generated by
16815bd8deadSopenharmony_ci      the second program invocation.  Limiting the amount of data a geometry
16825bd8deadSopenharmony_ci      program can write substantially eases the implementation burden.
16835bd8deadSopenharmony_ci
16845bd8deadSopenharmony_ci      A geometry program must declare a maximum number of vertices that can be
16855bd8deadSopenharmony_ci      emitted, called the vertex limit.  There is an implementation-dependent
16865bd8deadSopenharmony_ci      limit on the total number of vertices a program can emit (256 minimum)
16875bd8deadSopenharmony_ci      and the product of the vertex limit and the number of active result
16885bd8deadSopenharmony_ci      components (1024 minimum).  A program will fail to load if doesn't
16895bd8deadSopenharmony_ci      declare a limit or exceeds either of the two implementatoin-dependent
16905bd8deadSopenharmony_ci      limits.
16915bd8deadSopenharmony_ci
16925bd8deadSopenharmony_ci      It would be ideal if the limit could be inferred from the instructions
16935bd8deadSopenharmony_ci      in the program itself, and that would be possible for many programs,
16945bd8deadSopenharmony_ci      particularly ones with straight-line flow control.  For programs with
16955bd8deadSopenharmony_ci      more complicated flow control (subroutines, data-dependent looping, and
16965bd8deadSopenharmony_ci      so on), it would be impossible to make such an inference and a "safe"
16975bd8deadSopenharmony_ci      limit would have to be used with adverse and possibly unexpected
16985bd8deadSopenharmony_ci      performance consequences.
16995bd8deadSopenharmony_ci
17005bd8deadSopenharmony_ci      The limit on the number of EMIT instructions that can be issued can not
17015bd8deadSopenharmony_ci      always be enforced at compile time, or even at Begin time.  We specify
17025bd8deadSopenharmony_ci      that if a program tries to emit more vertices than the vertex limit
17035bd8deadSopenharmony_ci      allows, emits that exceed the limit may or may not have any effect.
17045bd8deadSopenharmony_ci
17055bd8deadSopenharmony_ci    (14) Should it be possible to change the limit on the number of vertices
17065bd8deadSopenharmony_ci    emitted by a geometry program after the program is specified?
17075bd8deadSopenharmony_ci
17085bd8deadSopenharmony_ci      RESOLVED:  Yes, using the function ProgramVertexLimitNV().  Applications
17095bd8deadSopenharmony_ci      may want to tweak a piece of data that affects the number of vertices
17105bd8deadSopenharmony_ci      emitted, but doesn't necessarily require recompiling the entire program.
17115bd8deadSopenharmony_ci      Examples might be a "circular point sprite" program, that reads a single
17125bd8deadSopenharmony_ci      point, and draws a circle centered at that point with <N> vertices.  An
17135bd8deadSopenharmony_ci      application could change the value <N> at run time, but it could require
17145bd8deadSopenharmony_ci      a change in the vertex limit.  Another example might be a geometry
17155bd8deadSopenharmony_ci      program that does some fancy subdivision, where the relevant parameter
17165bd8deadSopenharmony_ci      might be a limit on how far the primitive is subdivided.
17175bd8deadSopenharmony_ci
17185bd8deadSopenharmony_ci      Ideally, this program object state should be set by a "program
17195bd8deadSopenharmony_ci      parameter" command, much like texture state is set by a "texture
17205bd8deadSopenharmony_ci      parameter" (TexParameter) command.  Unfortunately, there are already
17215bd8deadSopenharmony_ci      several different "program parameter" functions:
17225bd8deadSopenharmony_ci
17235bd8deadSopenharmony_ci        ProgramEnvParameter4fARB()   -- sets global environment constants
17245bd8deadSopenharmony_ci        ProgramLocalParameter4fARB() -- sets per-program constants
17255bd8deadSopenharmony_ci        ProgramParameter4fNV()       -- also sets global environment constants
17265bd8deadSopenharmony_ci
17275bd8deadSopenharmony_ci      Additionally, GLSL and OpenGL 2.0 introduced "program objects" which are
17285bd8deadSopenharmony_ci      linked collections of vertex, fragment, and now geometry shaders.  A
17295bd8deadSopenharmony_ci      GLSL vertex "shader" is equivalent to an ARB_vertex_program vertex
17305bd8deadSopenharmony_ci      "program", which is nothing like a GLSL program.  As of OpenGL 2.0, GLSL
17315bd8deadSopenharmony_ci      programs do not have settable parameters, by subsequent extensions may
17325bd8deadSopenharmony_ci      want to add them (for example, EXT_geometry_shader4, which has this same
17335bd8deadSopenharmony_ci      functionality for GLSL).  If that happens, they would want their own
17345bd8deadSopenharmony_ci      ProgramParameter API, but with a different prototype than this extension
17355bd8deadSopenharmony_ci      would want.
17365bd8deadSopenharmony_ci
17375bd8deadSopenharmony_ci      Naming this function "ProgramVertexLimitNV" sidesteps this issue for
17385bd8deadSopenharmony_ci      now.
17395bd8deadSopenharmony_ci
17405bd8deadSopenharmony_ci    (15) How do edge flags interact with adjacency primitives?
17415bd8deadSopenharmony_ci
17425bd8deadSopenharmony_ci      RESOLVED:  If geometry programs are disabled, adjacency primitives are
17435bd8deadSopenharmony_ci      still supported.  For TRIANGLES_ADJACENCY_EXT, edge flags will apply as
17445bd8deadSopenharmony_ci      they do for TRIANGLES.  Such primitives are rendered as independent
17455bd8deadSopenharmony_ci      triangles as though the adjacency vertices were not provided.  Edge
17465bd8deadSopenharmony_ci      flags for the "real" vertices are supported.  For all other adjacency
17475bd8deadSopenharmony_ci      primitive types, edge flags are irrelevant.
17485bd8deadSopenharmony_ci
17495bd8deadSopenharmony_ci    (16) How do geometry programs interact with color clamping?
17505bd8deadSopenharmony_ci
17515bd8deadSopenharmony_ci      RESOLVED:  Geometry program execution occurs prior to color clamping in
17525bd8deadSopenharmony_ci      the pipeline.  This means the colors written by vertex programs or
17535bd8deadSopenharmony_ci      fixed-function vertex processing are not clamped to [0,1] before they
17545bd8deadSopenharmony_ci      are read by geometry programs.  If color clamping is enabled, any vertex
17555bd8deadSopenharmony_ci      colors written by the geometry program will have their components
17565bd8deadSopenharmony_ci      clamped to [0,1].
17575bd8deadSopenharmony_ci
17585bd8deadSopenharmony_ci    (17) How are QUADS, QUAD_STRIP, and POLYGON primitives decomposed into
17595bd8deadSopenharmony_ci    triangles in the initial implementation of GL_NV_geometry_program4?
17605bd8deadSopenharmony_ci
17615bd8deadSopenharmony_ci      RESOLVED:  The specification leaves the decomposition undefined, subject
17625bd8deadSopenharmony_ci      to a small number of rules.  Assume that four vertices are specified in
17635bd8deadSopenharmony_ci      the order V0, V1, V2, V3.
17645bd8deadSopenharmony_ci
17655bd8deadSopenharmony_ci      For QUADS primitives, the quad V0->V1->V2->V3 is decomposed into the
17665bd8deadSopenharmony_ci      triangles V0->V1->V2, and V0->V2->V3.  The provoking vertex of the quad
17675bd8deadSopenharmony_ci      (V3) is only found in the second triangle.  If it's necessary to flat
17685bd8deadSopenharmony_ci      shade over an entire quad, take the attributes from V0, which will be
17695bd8deadSopenharmony_ci      the first vertex for both triangles in the decomposition.
17705bd8deadSopenharmony_ci
17715bd8deadSopenharmony_ci      For QUAD_STRIP primitives, the quad V0->V1->V3->V2 is decomposed into
17725bd8deadSopenharmony_ci      the triangles V0->V1->V3 and V2->V0->V3.  This has the property of
17735bd8deadSopenharmony_ci      leaving the provoking vertex for the polygon (V3) as the third vertex
17745bd8deadSopenharmony_ci      for each triangle of the decomposition.
17755bd8deadSopenharmony_ci
17765bd8deadSopenharmony_ci      For POLYGON primitives, the polygon V0->V1->V2->V3 is decomposed into
17775bd8deadSopenharmony_ci      the triangles V1->V2->V0 and V2->V3->V0.  This has the property of
17785bd8deadSopenharmony_ci      leaving the provoking vertex for the polygon (V0) as the third vertex
17795bd8deadSopenharmony_ci      for each triangle of the decomposition.
17805bd8deadSopenharmony_ci
17815bd8deadSopenharmony_ci    (18) Should geometry programs be able to select a layer of a 3D texture,
17825bd8deadSopenharmony_ci    cube map texture, or array texture at run time?  If so, how?
17835bd8deadSopenharmony_ci
17845bd8deadSopenharmony_ci      RESOLVED:  This extension provides a per-vertex result binding called
17855bd8deadSopenharmony_ci      "result.layer", which is an integer specifying the layer to render to.
17865bd8deadSopenharmony_ci      When an each individual point, line, or triangle is emitted by a
17875bd8deadSopenharmony_ci      geometry program, the layer number is taken from the provoking (last)
17885bd8deadSopenharmony_ci      vertex of the primitive and is used for all fragments generated by that
17895bd8deadSopenharmony_ci      primitive.
17905bd8deadSopenharmony_ci
17915bd8deadSopenharmony_ci      The EXT_framebuffer_object (FBO) extension is used for rendering to
17925bd8deadSopenharmony_ci      textures, but for cube maps and 3D textures, it only provides the
17935bd8deadSopenharmony_ci      ability to attach a single face or layer of such textures.
17945bd8deadSopenharmony_ci
17955bd8deadSopenharmony_ci      This extension generalizes FBO by creates new entry points to bind an
17965bd8deadSopenharmony_ci      entire texture level (FramebufferTextureEXT) or a single layer of a
17975bd8deadSopenharmony_ci      texture level (FramebufferTextureLayerEXT) to an attachment point.  The
17985bd8deadSopenharmony_ci      existing FBO binding functions, FramebufferTexture[123]DEXT are
17995bd8deadSopenharmony_ci      retained, and are defined in terms of the more general new functions.
18005bd8deadSopenharmony_ci
18015bd8deadSopenharmony_ci      The new functions do not have a dimension in the function name or a
18025bd8deadSopenharmony_ci      <textarget> parameter, which can be inferred from the provided texture.
18035bd8deadSopenharmony_ci      They can do anything that the old functions can do, except attach a
18045bd8deadSopenharmony_ci      single face of a cube map texture.  We considered adding a separate
18055bd8deadSopenharmony_ci      function FramebufferTextureFaceEXT to provide this functionality, but
18065bd8deadSopenharmony_ci      decided that the existing FramebufferTexture2DEXT API was adequate.  We
18075bd8deadSopenharmony_ci      also considered using FramebufferTextureLayerEXT for this purpose, but
18085bd8deadSopenharmony_ci      it was not clear whether a layer number (0-5) or face enum (e.g,
18095bd8deadSopenharmony_ci      TEXTURE_CUBE_MAP_POSITIVE_X) should be provided.
18105bd8deadSopenharmony_ci
18115bd8deadSopenharmony_ci      When an entire texel level of a cube map, 3D, or array texture is
18125bd8deadSopenharmony_ci      attached, that attachment is considered layered.  The framebuffer is
18135bd8deadSopenharmony_ci      considered layered if any attachment is layered.  When the framebuffer
18145bd8deadSopenharmony_ci      is layered, there are three additional completeness requirements:
18155bd8deadSopenharmony_ci
18165bd8deadSopenharmony_ci        * all attachments must be layered
18175bd8deadSopenharmony_ci        * all color attachments must be from textures of identical type
18185bd8deadSopenharmony_ci        * all attachments must have the same number of layers
18195bd8deadSopenharmony_ci
18205bd8deadSopenharmony_ci      We expect subsequent versions of the FBO spec to relax the requirement
18215bd8deadSopenharmony_ci      that all attachments must have the same width and height, and plan to
18225bd8deadSopenharmony_ci      relax the similar requirement for layer count at that time.
18235bd8deadSopenharmony_ci
18245bd8deadSopenharmony_ci      When rendering to a layered framebuffer, layer zero is used unless a
18255bd8deadSopenharmony_ci      geometry program that writes the layer result is enabled.  When
18265bd8deadSopenharmony_ci      rendering to a non-layered framebuffer, any layer result emitted from
18275bd8deadSopenharmony_ci      geometry programs is ignored and the set of single-image attachments are
18285bd8deadSopenharmony_ci      used.  When reading from a layered framebuffer (e.g., ReadPixels), layer
18295bd8deadSopenharmony_ci      zero is always used.  When clearing a layered framebuffer, all layers
18305bd8deadSopenharmony_ci      are cleared to the corresponding clear values.
18315bd8deadSopenharmony_ci
18325bd8deadSopenharmony_ci      Several other approaches were considered, including leveraging existing
18335bd8deadSopenharmony_ci      FBO attachment functions and requiring the use of FramebufferTexture3D
18345bd8deadSopenharmony_ci      with a <zoffset> of zero to make a framebuffer attachment "layerable"
18355bd8deadSopenharmony_ci      (attaching layer zero means that the attachment could be used for either
18365bd8deadSopenharmony_ci      layered- or non-layered rendering).  Whether rendering was layered or
18375bd8deadSopenharmony_ci      not could either be inferred from the active geometry program, or set as
18385bd8deadSopenharmony_ci      a new property of the framebuffer object.  There is presently
18395bd8deadSopenharmony_ci      FramebufferParameter API to set a property of a framebuffer, so it would
18405bd8deadSopenharmony_ci      have been necessary to create new set/query APIs if this approach were
18415bd8deadSopenharmony_ci      chosen.
18425bd8deadSopenharmony_ci
18435bd8deadSopenharmony_ci    (19) How can single-pass cube map rendering be done efficiently in a
18445bd8deadSopenharmony_ci         geometry program?
18455bd8deadSopenharmony_ci
18465bd8deadSopenharmony_ci      UNRESOLVED:  To do single-pass cubemap rendering, attach entire cube map
18475bd8deadSopenharmony_ci      textures to framebuffer attachment points using the new functions
18485bd8deadSopenharmony_ci      provided by this extension.  The vertex program used should only
18495bd8deadSopenharmony_ci      transform the vertex position to eye coordinates (position relative to
18505bd8deadSopenharmony_ci      the center of the cube map).  A geometry program should be used that
18515bd8deadSopenharmony_ci      effectively projects each input triangle onto each of the six faces of
18525bd8deadSopenharmony_ci      the cube map, emitting a triangle for each.  Each of the projected
18535bd8deadSopenharmony_ci      vertices should be emitted with a "result.layer" value matching the face
18545bd8deadSopenharmony_ci      number (0-5).  When the projected triangle is drawn, it is automatically
18555bd8deadSopenharmony_ci      drawn on the face corresponding to the emitted layer number.  
18565bd8deadSopenharmony_ci
18575bd8deadSopenharmony_ci      It should be simple to skip projecting primitives onto faces they won't
18585bd8deadSopenharmony_ci      touch.  For example, if all of the X eye coordinates are positive, there
18595bd8deadSopenharmony_ci      is no reason to project to the "negative X" cube map face.
18605bd8deadSopenharmony_ci
18615bd8deadSopenharmony_ci      An example should be provided for this issue.
18625bd8deadSopenharmony_ci
18635bd8deadSopenharmony_ci    (20) How should per-vertex point size work with geometry programs?
18645bd8deadSopenharmony_ci
18655bd8deadSopenharmony_ci      RESOLVED:  We will generalize the existing VERTEX_PROGRAM_POINT_SIZE
18665bd8deadSopenharmony_ci      enable to control the point size behavior if either vertex or geometry
18675bd8deadSopenharmony_ci      programs are enabled.
18685bd8deadSopenharmony_ci
18695bd8deadSopenharmony_ci      If geometry programs are enabled, the point size is taken from the point
18705bd8deadSopenharmony_ci      size result of the emitted vertex if VERTEX_PROGRAM_POINT_SIZE is
18715bd8deadSopenharmony_ci      enabled, or from the PointSize state otherwise.
18725bd8deadSopenharmony_ci
18735bd8deadSopenharmony_ci      If no geometry program is enabled, it works like OpenGL 2.0.  If a
18745bd8deadSopenharmony_ci      vertex program is active, it's taken from the point size result or
18755bd8deadSopenharmony_ci      PointSize state, depending on the VERTEX_PROGRAM_POINT_SIZE enable.  If
18765bd8deadSopenharmony_ci      no program is enabled, normal fixed-function point size handling
18775bd8deadSopenharmony_ci      (including distance attenuation) is supported.
18785bd8deadSopenharmony_ci
18795bd8deadSopenharmony_ci      This extension creates a new alias for the VERTEX_PROGRAM_POINT_SIZE
18805bd8deadSopenharmony_ci      enum, called PROGRAM_POINT_SIZE_EXT, to reflect that the point size
18815bd8deadSopenharmony_ci      enable now covers multiple program types.  Both enums have the same
18825bd8deadSopenharmony_ci      value.
18835bd8deadSopenharmony_ci
18845bd8deadSopenharmony_ci    (21) How do vertex IDs work with geometry programs?
18855bd8deadSopenharmony_ci
18865bd8deadSopenharmony_ci      RESOLVED:  Vertex IDs are automatically provided to vertex programs
18875bd8deadSopenharmony_ci      when applicable, via the "vertex.id" binding.  However, they are not
18885bd8deadSopenharmony_ci      automatically copied the transformed vertex results that are read by
18895bd8deadSopenharmony_ci      geometry programs.
18905bd8deadSopenharmony_ci
18915bd8deadSopenharmony_ci      Geometry programs can read the ID of vertex <n> via the
18925bd8deadSopenharmony_ci      "vertex[<n>].id" binding, but the vertex ID must have been copied by
18935bd8deadSopenharmony_ci      the vertex program using an instruction such as:
18945bd8deadSopenharmony_ci
18955bd8deadSopenharmony_ci        MOV result.id.x, vertex.id.x;
18965bd8deadSopenharmony_ci
18975bd8deadSopenharmony_ci      If a vertex program doesn't write vertex ID, or fixed-function vertex
18985bd8deadSopenharmony_ci      processing is used, the vertex ID visible to geometry programs is
18995bd8deadSopenharmony_ci      undefined.
19005bd8deadSopenharmony_ci
19015bd8deadSopenharmony_ci    (22) How do primitive IDs work with geometry programs?
19025bd8deadSopenharmony_ci
19035bd8deadSopenharmony_ci      RESOLVED:  Primitive IDs are automatically available to geometry
19045bd8deadSopenharmony_ci      programs via the "primitive.id" binding and indicate the number of
19055bd8deadSopenharmony_ci      input primitives previously processed since the last explicit or
19065bd8deadSopenharmony_ci      implicit Begin call.
19075bd8deadSopenharmony_ci
19085bd8deadSopenharmony_ci      If a geometry program wants to make the primitive ID available to a
19095bd8deadSopenharmony_ci      fragment program, it should copy the appropriate value to the
19105bd8deadSopenharmony_ci      "result.primid" binding.
19115bd8deadSopenharmony_ci
19125bd8deadSopenharmony_ci    (23) How do primitive IDs work with primitives not supported directly by
19135bd8deadSopenharmony_ci    geometry program input topologies (e.g., QUADS, POLYGON)?
19145bd8deadSopenharmony_ci
19155bd8deadSopenharmony_ci      RESOLVED:  QUADS are decomposed into two triangles.  Both triangles
19165bd8deadSopenharmony_ci      will have the same primitive ID, which is the number of full quads
19175bd8deadSopenharmony_ci      previously processed.  POLYGON primitives are decomposed into a series
19185bd8deadSopenharmony_ci      of triangles, and all of them will have the primitive ID -- zero.
19195bd8deadSopenharmony_ci
19205bd8deadSopenharmony_ci    (24) This is an NV extension (NV_geometry_program4).  Why do some of the
19215bd8deadSopenharmony_ci    new tokens have an "EXT" extension?
19225bd8deadSopenharmony_ci
19235bd8deadSopenharmony_ci      RESOLVED:  Some of the tokens are shared between this extension and the
19245bd8deadSopenharmony_ci      comparable high-level GLSL programmability extension
19255bd8deadSopenharmony_ci      (EXT_geometry_shader4).  Rather than provide a duplicate set of tokens,
19265bd8deadSopenharmony_ci      we simply use the EXT versions here.  The tokens specific to assembly
19275bd8deadSopenharmony_ci      shader uses retain an NV suffix.
19285bd8deadSopenharmony_ci
19295bd8deadSopenharmony_ci    (25) What happens if you try to do a framebuffer blit (via
19305bd8deadSopenharmony_ci        EXT_framebuffer_blit) to/from a layered framebuffer?
19315bd8deadSopenharmony_ci
19325bd8deadSopenharmony_ci      RESOLVED:  BlitFramebufferEXT() is a two-dimensional operation (only has
19335bd8deadSopenharmony_ci      a width and height), so only reads/writes layer zero.  The framebuffer
19345bd8deadSopenharmony_ci      blit operation is defined partially in terms of CopyPixels, which itself
19355bd8deadSopenharmony_ci      is defined in terms of ReadPixels and DrawPixels.  This spec defines
19365bd8deadSopenharmony_ci      both operations to use layer zero when a layered framebuffer is
19375bd8deadSopenharmony_ci      involved.
19385bd8deadSopenharmony_ci
19395bd8deadSopenharmony_ci      It may be desirable to provide a three-dimensional framebuffer blit
19405bd8deadSopenharmony_ci      operation or an explicit copy single-step operation between two
19415bd8deadSopenharmony_ci      three-dimensional, cube map, or array textures.  That functionality is
19425bd8deadSopenharmony_ci      left for a future extension or OpenGL version.
19435bd8deadSopenharmony_ci
19445bd8deadSopenharmony_ci
19455bd8deadSopenharmony_ciRevision History
19465bd8deadSopenharmony_ci
19475bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
19485bd8deadSopenharmony_ci    ----  --------  --------  --------------------------------------------
19495bd8deadSopenharmony_ci    13    12/14/09  mgodse    Added GLX protocol.
19505bd8deadSopenharmony_ci    
19515bd8deadSopenharmony_ci    12    07/21/09  pbrown    Clarify that when doing layered rendering,
19525bd8deadSopenharmony_ci                              a layer specified in the shader is used to
19535bd8deadSopenharmony_ci                              select the depth and stencil layers accessed.
19545bd8deadSopenharmony_ci
19555bd8deadSopenharmony_ci                              Also document several additional entry points
19565bd8deadSopenharmony_ci                              that accept GEOMETRY_PROGRAM_NV.
19575bd8deadSopenharmony_ci
19585bd8deadSopenharmony_ci    11    03/11/09  pbrown    Fix section numbers for option/declaration
19595bd8deadSopenharmony_ci                              sections.
19605bd8deadSopenharmony_ci
19615bd8deadSopenharmony_ci    10    07/29/08  pbrown    Clean up garbled language describing vertex
19625bd8deadSopenharmony_ci                              output limits.
19635bd8deadSopenharmony_ci
19645bd8deadSopenharmony_ci     9    04/04/08  pbrown    Fixed error in the state tables; the geometry
19655bd8deadSopenharmony_ci                              program enable should push/pop only with the
19665bd8deadSopenharmony_ci                              enable bit like all the other program enables.
19675bd8deadSopenharmony_ci
19685bd8deadSopenharmony_ci     8    03/15/08  pbrown    Additional dependency on EXT_framebuffer_blit;
19695bd8deadSopenharmony_ci                              blits to/from layered targets affect only
19705bd8deadSopenharmony_ci                              layer zero.
19715bd8deadSopenharmony_ci
19725bd8deadSopenharmony_ci     7    03/07/08  pbrown    Fix grammar to allow vertex ID, as already 
19735bd8deadSopenharmony_ci                              allowed in the rest of the spec body.
19745bd8deadSopenharmony_ci
19755bd8deadSopenharmony_ci     6              pbrown    Internal spec development.
19765bd8deadSopenharmony_ci
1977