15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci    
35bd8deadSopenharmony_ci    NV_vertex_program
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_vertex_program
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright NVIDIA Corporation, 2000, 2001, 2002, 2003, 2004.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciIP Status
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    NVIDIA Proprietary.
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciStatus
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Shipping, spec at version 1.10.
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciVersion
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    NVIDIA Date:        March 31, 2009
285bd8deadSopenharmony_ci    Revision:           1.10
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciNumber
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    233
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciDependencies
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 1.2.1 specification and
375bd8deadSopenharmony_ci    requires OpenGL 1.2.1.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    Requires support for the ARB_multitexture extension with at least
405bd8deadSopenharmony_ci    two texture units.
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    EXT_point_parameters affects the definition of this extension.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    EXT_secondary_color affects the definition of this extension.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    EXT_fog_coord affects the definition of this extension.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    EXT_vertex_weighting affects the definition of this extension.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    ARB_imaging affects the definition of this extension.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ciOverview
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    Unextended OpenGL mandates a certain set of configurable per-vertex
555bd8deadSopenharmony_ci    computations defining vertex transformation, texture coordinate
565bd8deadSopenharmony_ci    generation and transformation, and lighting.  Several extensions
575bd8deadSopenharmony_ci    have added further per-vertex computations to OpenGL.  For example,
585bd8deadSopenharmony_ci    extensions have defined new texture coordinate generation modes
595bd8deadSopenharmony_ci    (ARB_texture_cube_map, NV_texgen_reflection, NV_texgen_emboss), new
605bd8deadSopenharmony_ci    vertex transformation modes (EXT_vertex_weighting), new lighting modes
615bd8deadSopenharmony_ci    (OpenGL 1.2's separate specular and rescale normal functionality),
625bd8deadSopenharmony_ci    several modes for fog distance generation (NV_fog_distance), and
635bd8deadSopenharmony_ci    eye-distance point size attenuation (EXT_point_parameters).
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    Each such extension adds a small set of relatively inflexible
665bd8deadSopenharmony_ci    per-vertex computations.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    This inflexibility is in contrast to the typical flexibility provided
695bd8deadSopenharmony_ci    by the underlying programmable floating point engines (whether
705bd8deadSopenharmony_ci    micro-coded vertex engines, DSPs, or CPUs) that are traditionally used
715bd8deadSopenharmony_ci    to implement OpenGL's per-vertex computations.  The purpose of this
725bd8deadSopenharmony_ci    extension is to expose to the OpenGL application writer a significant
735bd8deadSopenharmony_ci    degree of per-vertex programmability for computing vertex parameters.
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    For the purposes of discussing this extension, a vertex program is
765bd8deadSopenharmony_ci    a sequence of floating-point 4-component vector operations that
775bd8deadSopenharmony_ci    determines how a set of program parameters (defined outside of
785bd8deadSopenharmony_ci    OpenGL's begin/end pair) and an input set of per-vertex parameters
795bd8deadSopenharmony_ci    are transformed to a set of per-vertex output parameters.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    The per-vertex computations for standard OpenGL given a particular
825bd8deadSopenharmony_ci    set of lighting and texture coordinate generation modes (along with
835bd8deadSopenharmony_ci    any state for extensions defining per-vertex computations) is, in
845bd8deadSopenharmony_ci    essence, a vertex program.  However, the sequence of operations is
855bd8deadSopenharmony_ci    defined implicitly by the current OpenGL state settings rather than
865bd8deadSopenharmony_ci    defined explicitly as a sequence of instructions.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    This extension provides an explicit mechanism for defining vertex
895bd8deadSopenharmony_ci    program instruction sequences for application-defined vertex programs.
905bd8deadSopenharmony_ci    In order to define such vertex programs, this extension defines
915bd8deadSopenharmony_ci    a vertex programming model including a floating-point 4-component
925bd8deadSopenharmony_ci    vector instruction set and a relatively large set of floating-point
935bd8deadSopenharmony_ci    4-component registers.
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    The extension's vertex programming model is designed for efficient
965bd8deadSopenharmony_ci    hardware implementation and to support a wide variety of vertex
975bd8deadSopenharmony_ci    programs.  By design, the entire set of existing vertex programs
985bd8deadSopenharmony_ci    defined by existing OpenGL per-vertex computation extensions can be
995bd8deadSopenharmony_ci    implemented using the extension's vertex programming model.
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ciIssues
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci    What should this extension be called?
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci      RESOLUTION:  NV_vertex_program.  DirectX 8 refers to its similar
1065bd8deadSopenharmony_ci      functionality as "vertex shaders".  This is a confusing term
1075bd8deadSopenharmony_ci      because shaders are usually assumed to operate at the fragment or
1085bd8deadSopenharmony_ci      pixel level, not the vertex level.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci      Conceptually, what the extension defines is an application-defined
1115bd8deadSopenharmony_ci      program (admittedly limited by its sequential execution model) for
1125bd8deadSopenharmony_ci      processing vertices so the "vertex program" term is more accurate.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci      Additionally, some of the API machinery in this extension for
1155bd8deadSopenharmony_ci      describing programs could be useful for extending other OpenGL
1165bd8deadSopenharmony_ci      operations with programs (though other types of programs would
1175bd8deadSopenharmony_ci      likely look very different from vertex programs).
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    What terms are important to this specification?
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci      vertex program mode - when vertex program mode is enabled, vertices
1225bd8deadSopenharmony_ci      are transformed by an application-defined vertex program.
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci      conventional GL vertex transform mode - when vertex program mode
1255bd8deadSopenharmony_ci      is disabled (or the extension is not supported), vertices are
1265bd8deadSopenharmony_ci      transformed by GL's conventional texgen, lighting, and transform
1275bd8deadSopenharmony_ci      state.
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci      provoke - the verb that denotes the beginning of vertex
1305bd8deadSopenharmony_ci      transformation by either vertex program mode or conventional GL
1315bd8deadSopenharmony_ci      vertex transform mode.  Vertices are provoked when either glVertex
1325bd8deadSopenharmony_ci      or glVertexAttribNV(0, ...) is called.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ci      program target - a type or class of program.  This extension
1355bd8deadSopenharmony_ci      supports two program targets:  the vertex program and the vertex
1365bd8deadSopenharmony_ci      state program.  Future extensions could add other program targets.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci      vertex program -  an application-defined vertex program used to
1395bd8deadSopenharmony_ci      transform vertices when vertex program mode is enabled.
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci      vertex state program - a program similar to a vertex program.
1425bd8deadSopenharmony_ci      Unlike a vertex program, a vertex state program runs outside of
1435bd8deadSopenharmony_ci      a glBegin/glEnd pair.  Vertex state programs do not transform
1445bd8deadSopenharmony_ci      a vertex.  They just update program parameters.
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci      vertex attribute - one of 16 4-component per-vertex parameters
1475bd8deadSopenharmony_ci      defined by this extension.  These attributes alias with the
1485bd8deadSopenharmony_ci      conventional per-vertex parameters.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ci      per-vertex parameter - a vertex attribute or a conventional
1515bd8deadSopenharmony_ci      per-vertex parameter such as set by glNormal3f or glColor3f.
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci      program parameter - one of 96 4-component registers available
1545bd8deadSopenharmony_ci      to vertex programs.  The state of these registers is shared
1555bd8deadSopenharmony_ci      among all vertex programs.
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    What part of OpenGL do vertex programs specifically bypass?
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci      Vertex programs bypass the following OpenGL functionality:
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci        o  Normal transformation and normalization
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci        o  Color material
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci        o  Per-vertex lighting
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci        o  Texture coordinate generation
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci        o  The texture matrix
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci        o  The normalization of AUTO_NORMAL evaluated normals
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci        o  The modelview and projection matrix transforms
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci        o  The per-vertex processing in EXT_point_parameters
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci        o  The per-vertex processing in NV_fog_distance
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci        o  Raster position transformation
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci        o  Client-defined clip planes
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci      Operations not subsumed by vertex programs
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci        o  The view frustum clip
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci        o  Perspective divide (division by w)
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci        o  The viewport transformation
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci        o  The depth range transformation
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci        o  Clamping the primary and secondary color to [0,1]
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci        o  Primitive assembly and subsequent operations
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci        o  Evaluator (except the AUTO_NORMAL normalization)
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    How specific should this specification be about precision?
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci      RESOLUTION:  Reasonable precision requirements are incorporated
2025bd8deadSopenharmony_ci      into the specification beyond the often vague requirements of the
2035bd8deadSopenharmony_ci      core OpenGL specification.
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci      This extension essentially defines an instruction set and its
2065bd8deadSopenharmony_ci      corresponding execution environment.  The instruction set specified
2075bd8deadSopenharmony_ci      may find applications beyond the traditional purposes of 3D vertex
2085bd8deadSopenharmony_ci      transformation, lighting, and texture coordinate generation that
2095bd8deadSopenharmony_ci      have fairly lax precision requirements.  To facilitate such
2105bd8deadSopenharmony_ci      possibly unexpected applications of this functionality, minimum
2115bd8deadSopenharmony_ci      precision requirements are specified.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci      The minimum precision requirements in the specification are meant
2145bd8deadSopenharmony_ci      to serve as a baseline so that application developers can write
2155bd8deadSopenharmony_ci      vertex programs with minimal worries about precision issues.
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    What about when the "execution environment" involves support for
2185bd8deadSopenharmony_ci    other extensions?
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci      This extension assumes support for functionality that includes
2215bd8deadSopenharmony_ci      a fog distance, secondary color, point parameters, and multiple
2225bd8deadSopenharmony_ci      texture coordinates.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci      There is a trade-off between requiring support for these extensions
2255bd8deadSopenharmony_ci      to guarantee a particular extended execution environment and
2265bd8deadSopenharmony_ci      requiring lots of functionality that everyone might not support.
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci      Application developers will desire a high baseline of functionality
2295bd8deadSopenharmony_ci      so that OpenGL applications using vertex programs can work in
2305bd8deadSopenharmony_ci      the full context of OpenGL.  But if too much is required, the
2315bd8deadSopenharmony_ci      implementation burden mandated by the extension may limit the
2325bd8deadSopenharmony_ci      number of available implementations.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci      Clearly we do not want to require support for 8 texture units
2355bd8deadSopenharmony_ci      even if the machinery is there for it.  Still multitexture is a
2365bd8deadSopenharmony_ci      common and important feature for using vertex programs effectively.
2375bd8deadSopenharmony_ci      Requiring at least two texture units seems reasonable.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    What do we say about the alpha component of the secondary color?
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci      RESOLUTION:  When vertex program mode is enabled, the alpha
2425bd8deadSopenharmony_ci      component of csec used for the color sum state is assumed always
2435bd8deadSopenharmony_ci      zero.  Another downstream extension may actually make the alpha
2445bd8deadSopenharmony_ci      component written into the COL1 (or BFC1) vertex result register
2455bd8deadSopenharmony_ci      available.
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci    Should client-defined clip planes operate when vertex program mode is
2485bd8deadSopenharmony_ci    enabled?
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci      RESOLUTION.  No.
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci      OpenGL's client-defined clip planes are specified in eye-space.
2535bd8deadSopenharmony_ci      Vertex programs generate homogeneous clip space positions.
2545bd8deadSopenharmony_ci      Unlike the conventional OpenGL vertex transformation mode, vertex
2555bd8deadSopenharmony_ci      program mode requires no semantic equivalent to eye-space.
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci      Applications that require client-defined clip planes can simulate
2585bd8deadSopenharmony_ci      OpenGL-style client-defined clip planes by generating texture
2595bd8deadSopenharmony_ci      coordinates and using alpha testing or other per-fragment tests
2605bd8deadSopenharmony_ci      such as NV_texture_shader's CULL_FRAGMENT_NV program to discard
2615bd8deadSopenharmony_ci      fragments.  In many ways, these schemes provide a more flexible
2625bd8deadSopenharmony_ci      mechanism for clipping than client-defined clip planes.
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci      Unfortunately, vertex programs used in conjunction with selection
2655bd8deadSopenharmony_ci      or feedback will not have a means to support client-defined clip
2665bd8deadSopenharmony_ci      planes because the per-fragment culling mechanisms described in the
2675bd8deadSopenharmony_ci      previous paragraph are not available in the selection or feedback
2685bd8deadSopenharmony_ci      render modes.  Oh well.
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci      Finally, as a practical concern, client-defined clip planes
2715bd8deadSopenharmony_ci      greatly complicate clipping for various hardware rasterization
2725bd8deadSopenharmony_ci      architectures.
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    How are edge flags handled?
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci      RESOLUTION:  Passed through without the ability to be modified by
2775bd8deadSopenharmony_ci      a vertex program.  Applications are free to send edge flags when
2785bd8deadSopenharmony_ci      vertex program mode is enabled.
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    Should vertex attributes alias with conventional per-vertex
2815bd8deadSopenharmony_ci    parameters?
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci      RESOLUTION.  YES.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci      This aliasing should make it easy to use vertex programs with
2865bd8deadSopenharmony_ci      existing OpenGL code that transfers per-vertex parameters using
2875bd8deadSopenharmony_ci      conventional OpenGL per-vertex calls.
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci      It also minimizes the number of per-vertex parameters that the
2905bd8deadSopenharmony_ci      hardware must maintain.
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci      See Table X.2 for the aliasing of vertex attributes and conventional
2935bd8deadSopenharmony_ci      per-vertex parameters.
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    How should vertex attribute arrays interact with conventional vertex
2965bd8deadSopenharmony_ci    arrays?
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci      RESOLUTION:  When vertex program mode is enabled, a particular
2995bd8deadSopenharmony_ci      vertex attribute array will be used if enabled, but if disabled,
3005bd8deadSopenharmony_ci      and the corresponding aliased conventional vertex array is enabled
3015bd8deadSopenharmony_ci      (assuming that there is a corresponding aliased conventional vertex
3025bd8deadSopenharmony_ci      array for the particular vertex array), the conventional vertex
3035bd8deadSopenharmony_ci      array will be used.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci      This matches the way immediate mode per-vertex parameter aliasing
3065bd8deadSopenharmony_ci      works.
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci      This does slightly complicate vertex array validation in program
3095bd8deadSopenharmony_ci      mode, but programmers using vertex arrays can simply enable vertex
3105bd8deadSopenharmony_ci      program mode without reconfiguring their conventional vertex arrays
3115bd8deadSopenharmony_ci      and get what they expect.
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci      Note that this does create an asymmetry between immediate mode
3145bd8deadSopenharmony_ci      and vertex arrays depending on whether vertex program mode is
3155bd8deadSopenharmony_ci      enabled or not.  The immediate mode vertex attribute commands
3165bd8deadSopenharmony_ci      operate unchanged whether vertex program mode is enabled or not.
3175bd8deadSopenharmony_ci      However the vertex attribute vertex arrays are used only when
3185bd8deadSopenharmony_ci      vertex program mode is enabled.
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci      Supporting vertex attribute vertex arrays when vertex program mode
3215bd8deadSopenharmony_ci      is disabled would create a large implementation burden for existing
3225bd8deadSopenharmony_ci      OpenGL implementations that have heavily optimized conventional
3235bd8deadSopenharmony_ci      vertex arrays.  For example, the normal array can be assumed to
3245bd8deadSopenharmony_ci      always contain 3 and only 3 components in conventional OpenGL
3255bd8deadSopenharmony_ci      vertex transform mode, but may contain 1, 2, 3, or 4 components
3265bd8deadSopenharmony_ci      in vertex program mode.
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci      There is not any additional functionality gained by supporting
3295bd8deadSopenharmony_ci      vertex attribute arrays when vertex program mode is disabled, but
3305bd8deadSopenharmony_ci      there is lots of implementation overhead.  In any case, it does not
3315bd8deadSopenharmony_ci      seem something worth encouraging so it is simply not supported.
3325bd8deadSopenharmony_ci      So vertex attribute arrays are IGNORED when vertex program mode
3335bd8deadSopenharmony_ci      is not enabled.
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci      Ignoring VertexAttribute commands or treating VertexAttribute
3365bd8deadSopenharmony_ci      commands as an error when vertex program mode is enabled
3375bd8deadSopenharmony_ci      would likely add overhead for such a conditional check.  The
3385bd8deadSopenharmony_ci      implementation overhead for supporting VertexAttribute commands
3395bd8deadSopenharmony_ci      when vertex program mode is disabled is not that significant.
3405bd8deadSopenharmony_ci      Additionally, it is likely that setting persistent vertex attribute
3415bd8deadSopenharmony_ci      state while vertex program mode is disabled may be useful to
3425bd8deadSopenharmony_ci      applications.  So vertex attribute immediate mode commands are
3435bd8deadSopenharmony_ci      PERMITTED when vertex program mode is not enabled.
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    Colors and normals specified as ints, uints, shorts, ushorts, bytes,
3465bd8deadSopenharmony_ci    and ubytes are converted to floating-point ranges when supplied to
3475bd8deadSopenharmony_ci    core OpenGL as described in Table 2.6.  Other per-vertex attributes
3485bd8deadSopenharmony_ci    such as texture coordinates and positions are not converted.
3495bd8deadSopenharmony_ci    How does this mix with vertex programs where all vertex attributes
3505bd8deadSopenharmony_ci    are supposedly treated identically?
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci      RESOLUTION:  Vertex attributes specified as bytes and ubytes are
3535bd8deadSopenharmony_ci      always converted as described in Table 2.6.  All other formats are
3545bd8deadSopenharmony_ci      not converted according to Table 2.6 but simply converted directly
3555bd8deadSopenharmony_ci      to floating-point.
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci      The ubyte type is converted because those types seem more useful
3585bd8deadSopenharmony_ci      for passing colors in the [0,1] range.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci      If an application desires a conversion, the conversion can be
3615bd8deadSopenharmony_ci      incorporated into the vertex program itself.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci      This also applies to vertex attribute arrays.  However, by enabling
3645bd8deadSopenharmony_ci      a color or normal vertex array and not enabling the corresponding
3655bd8deadSopenharmony_ci      aliased vertex attribute array, programmers can get the conventional
3665bd8deadSopenharmony_ci      conversions for color and normal arrays (but only for the vertex
3675bd8deadSopenharmony_ci      attribute arrays that alias to the conventional color and normal
3685bd8deadSopenharmony_ci      arrays and only with the sizes/types supported by these color and
3695bd8deadSopenharmony_ci      normal arrays).
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    Should programs be C-style null-terminated strings?
3725bd8deadSopenharmony_ci      
3735bd8deadSopenharmony_ci      RESOLUTION:  No.  Programs should be specified as an array of
3745bd8deadSopenharmony_ci      GLubyte with an explicit length parameter.  OpenGL has no precedent
3755bd8deadSopenharmony_ci      for passing null-terminated strings into the API (though glGetString
3765bd8deadSopenharmony_ci      returns null-terminated strings).  Null-terminated strings are
3775bd8deadSopenharmony_ci      problematic for some languages.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    Should all existing OpenGL transform functionality and extensions
3805bd8deadSopenharmony_ci    be implementable as vertex programs?
3815bd8deadSopenharmony_ci
3825bd8deadSopenharmony_ci      RESOLUTION:  Yes.  Vertex programs should be a complete superset
3835bd8deadSopenharmony_ci      of what you can do with OpenGL 1.2 and existing vertex transform
3845bd8deadSopenharmony_ci      extensions.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci      To implement EXT_point_parameters, the
3875bd8deadSopenharmony_ci      GL_VERTEX_PROGRAM_POINT_SIZE_NV enable is introduced.
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci      To implement two-sided lighting, the GL_VERTEX_PROGRAM_TWO_SIDE_NV
3905bd8deadSopenharmony_ci      enable is introduced.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci    How does glPointSize work with vertex programs?
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci      RESOLUTION:  If GL_VERTEX_PROGRAM_POINT_SIZE_NV is disabled, the size
3955bd8deadSopenharmony_ci      of points is determine by the glPointSize state.  If enabled,
3965bd8deadSopenharmony_ci      the point size is determined per-vertex by the clamped value of
3975bd8deadSopenharmony_ci      the vertex result PSIZ register.
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci    Can the currently bound vertex program object name be deleted or
4005bd8deadSopenharmony_ci    reloaded?
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci      RESOLUTION.  Yes.  When a vertex program object name is deleted
4035bd8deadSopenharmony_ci      or reloaded when it is the currently bound vertex program object,
4045bd8deadSopenharmony_ci      it is as if a rebind occurs after the deletion or reload.
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci      In the case of a reload, the new vertex program object will be
4075bd8deadSopenharmony_ci      used from then on.  In the case of a deletion, the current vertex
4085bd8deadSopenharmony_ci      program object will be treated as if it is nonexistent.
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ci    Should program objects have a mechanism for managing program
4115bd8deadSopenharmony_ci    residency?
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci      RESOLUTION:  Yes.  Vertex program instruction memory is a limited
4145bd8deadSopenharmony_ci      hardware resource.  glBindProgramNV will be faster if binding to
4155bd8deadSopenharmony_ci      a resident program.  Applications are likely to want to quickly
4165bd8deadSopenharmony_ci      switch between a small collection of programs.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci      glAreProgramsResidentNV allows the residency status of a
4195bd8deadSopenharmony_ci      group of programs to be queried.  This mimics
4205bd8deadSopenharmony_ci      glAreTexturesResident.
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci      Instead of adopting the glPrioritizeTextures mechanism, a new
4235bd8deadSopenharmony_ci      glRequestResidentProgramsNV command is specified instead.
4245bd8deadSopenharmony_ci      Assigning priorities to textures has always been a problematic
4255bd8deadSopenharmony_ci      endeavor and few OpenGL implementations implemented it effectively.
4265bd8deadSopenharmony_ci      For the priority mechanism to work well, it requires the client
4275bd8deadSopenharmony_ci      to routinely update the priorities of textures.
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci      The glRequestResidentProgramsNV indicates to the GL that a
4305bd8deadSopenharmony_ci      set of programs are intended for use together.  Because all
4315bd8deadSopenharmony_ci      the programs are requesting residency as a group, drivers
4325bd8deadSopenharmony_ci      should be able to attempt to load all the requested programs
4335bd8deadSopenharmony_ci      at once (and remove from residency programs not in the group if
4345bd8deadSopenharmony_ci      necessary).  Clients can use glAreProgramsResidentNV to query the
4355bd8deadSopenharmony_ci      relative success of the request.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ci      glRequestResidentProgramsNV should be superior to loading programs
4385bd8deadSopenharmony_ci      on-demand because fragmentation can be avoided.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    What happens when you execute a nonexistent or invalid program?
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci      RESOLUTION:  glBegin will fail with a GL_INVALID_OPERATION if the
4435bd8deadSopenharmony_ci      currently bound vertex program is nonexistent or invalid.  The same
4445bd8deadSopenharmony_ci      applies to glRasterPos and any command that implies a glBegin.
4455bd8deadSopenharmony_ci
4465bd8deadSopenharmony_ci      Because the glVertex and glVertexAttribNV(0, ...) are ignored
4475bd8deadSopenharmony_ci      outside of a glBegin/glEnd pair (without generating an error) it
4485bd8deadSopenharmony_ci      is impossible to provoke a vertex program if the current vertex
4495bd8deadSopenharmony_ci      program is nonexistent or invalid.  Other per-vertex parameters
4505bd8deadSopenharmony_ci      (for examples those set by glColor, glNormal, and glVertexAttribNV
4515bd8deadSopenharmony_ci      when the attribute number is not zero) are recorded since they
4525bd8deadSopenharmony_ci      are legal outside of a glBegin/glEnd.
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci      For vertex state programs, the problem is simpler because
4555bd8deadSopenharmony_ci      glExecuteProgramNV can immediately fail with a GL_INVALID_OPERATION
4565bd8deadSopenharmony_ci      when the named vertex state program is nonexistent or invalid.
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci    What happens when a matrix has been tracked into a set of program
4595bd8deadSopenharmony_ci    parameters, but then glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, addr,
4605bd8deadSopenharmony_ci    GL_NONE, GL_IDENTITY_NV) is performed?
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci      RESOLUTION:  The specified program parameters stop tracking a
4635bd8deadSopenharmony_ci      matrix, but they retain the values of the matrix they were last
4645bd8deadSopenharmony_ci      tracking.
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci    Can rows of tracked matrices be queried by querying the program
4675bd8deadSopenharmony_ci    parameters that track them?
4685bd8deadSopenharmony_ci
4695bd8deadSopenharmony_ci      RESOLUTION:  Yes.
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci    Discussing matrices is confusing because of row-major versus
4725bd8deadSopenharmony_ci    column-major issues.  Can you give an example of how a matrix is
4735bd8deadSopenharmony_ci    tracked?
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci      // When loaded, the first row is "1, 2, 3, 4", because of column-major
4765bd8deadSopenharmony_ci      // (OpenGL spec) vs. row-major (C) differences.
4775bd8deadSopenharmony_ci      GLfloat matrix[16] = { 1, 5, 9,  13,
4785bd8deadSopenharmony_ci                             2, 6, 10, 14,
4795bd8deadSopenharmony_ci                             3, 7, 11, 15,
4805bd8deadSopenharmony_ci                             4, 8, 12, 16 };
4815bd8deadSopenharmony_ci      GLfloat row1[4], row2[4];
4825bd8deadSopenharmony_ci
4835bd8deadSopenharmony_ci      glMatrixMode(GL_MATRIX0_NV);
4845bd8deadSopenharmony_ci      glLoadMatrixf(matrix);
4855bd8deadSopenharmony_ci      glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MATRIX0_NV, GL_IDENTITY_NV);
4865bd8deadSopenharmony_ci      glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 8, GL_MATRIX0_NV, GL_TRANSPOSE_NV);
4875bd8deadSopenharmony_ci      glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 5,
4885bd8deadSopenharmony_ci        GL_PROGRAM_PARAMETER_NV, row1);
4895bd8deadSopenharmony_ci      /* row1 is now [ 5 6 7 8 ] */
4905bd8deadSopenharmony_ci      glGetProgramParameterfvNV(GL_VERTEX_PROGRAM_NV, 9,
4915bd8deadSopenharmony_ci        GL_PROGRAM_PARAMETER_NV, row2);
4925bd8deadSopenharmony_ci      /* row2 is now [ 2 6 10 14 ] because the tracked matrix is transposed */
4935bd8deadSopenharmony_ci
4945bd8deadSopenharmony_ci    Should evaluators be extended to evaluate arbitrary vertex
4955bd8deadSopenharmony_ci    attributes?
4965bd8deadSopenharmony_ci
4975bd8deadSopenharmony_ci      RESOLUTION:  Yes.  We'll support 32 new maps (16 for MAP1 and 16
4985bd8deadSopenharmony_ci      for MAP2) that take priority over the conventional maps that they
4995bd8deadSopenharmony_ci      might alias to (only when vertex program mode is enabled).
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ci      These new maps always evaluate all four components.  The rationale
5025bd8deadSopenharmony_ci      for this is that if we supported 1, 2, 3, or 4 components, that
5035bd8deadSopenharmony_ci      would add 128 (16*4*2) enumerants which is too many.  In addition,
5045bd8deadSopenharmony_ci      if you wanted to evaluate two 2-component vertex attributes, you
5055bd8deadSopenharmony_ci      could instead generate one 4-component vertex attribute and use
5065bd8deadSopenharmony_ci      the vertex program with swizzling to treat this as two-components.
5075bd8deadSopenharmony_ci
5085bd8deadSopenharmony_ci      Moreover, we are assuming 4-component vector instructions so less
5095bd8deadSopenharmony_ci      than 4-component evaluations might not be any more efficient
5105bd8deadSopenharmony_ci      than 4-component evaluations.  Implementations that use vector
5115bd8deadSopenharmony_ci      instructions such as Intel's SSE instructions will be easier to
5125bd8deadSopenharmony_ci      implement since they can focus on optimizing just the 4-component
5135bd8deadSopenharmony_ci      case.
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci    How should GL_AUTO_NORMAL work with vertex programs?
5165bd8deadSopenharmony_ci
5175bd8deadSopenharmony_ci      RESOLUTION:  GL_AUTO_NORMAL should NOT guarantee that the generated
5185bd8deadSopenharmony_ci      analytical normal be normalized.  In vertex program mode, the
5195bd8deadSopenharmony_ci      current vertex program can easily normalize the normal if required.
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci      This can lead to greater efficiency if the vertex program transforms
5225bd8deadSopenharmony_ci      the normal to another coordinate system such as eye-space with a
5235bd8deadSopenharmony_ci      transform that preserves vector length.  Then a single normalize
5245bd8deadSopenharmony_ci      after transform is more efficient than normalizing after evaluation
5255bd8deadSopenharmony_ci      and also normalizing after transform.
5265bd8deadSopenharmony_ci
5275bd8deadSopenharmony_ci      Conceptually, the normalize mandated for AUTO_NORMAL in section
5285bd8deadSopenharmony_ci      5.1 is just one of the many transformation operations subsumed by
5295bd8deadSopenharmony_ci      vertex programs.
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci    Should the new vertex program related enables push/pop with
5325bd8deadSopenharmony_ci    GL_ENABLE_BIT?
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci      RESOLUTION:  Yes.  Pushing and popping enable bits is easy.
5355bd8deadSopenharmony_ci      This includes the 32 new evaluator map enable bits.  These evaluator
5365bd8deadSopenharmony_ci      enable bits are also pushed and popped using GL_EVAL_BIT.
5375bd8deadSopenharmony_ci
5385bd8deadSopenharmony_ci    Should all the vertex attribute state push/pop with GL_CURRENT_BIT?
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci      RESOLUTION: Yes.  The state is aliased with the conventional
5415bd8deadSopenharmony_ci      per-vertex parameter state so it really should push/pop.
5425bd8deadSopenharmony_ci
5435bd8deadSopenharmony_ci    Should all the vertex attrib vertex array state push/pop with
5445bd8deadSopenharmony_ci    GL_CLIENT_VERTEX_ARRAY_BIT?
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ci      RESOLUTION: Yes.
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ci    Should all the other vertex program-related state push/pop somehow?
5495bd8deadSopenharmony_ci
5505bd8deadSopenharmony_ci      RESOLUTION:  No.
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci      The other vertex program doesn't fit well with the existing bits.
5535bd8deadSopenharmony_ci      To be clear, GL_ALL_ATTRIB_BITS does not push/pop vertex program
5545bd8deadSopenharmony_ci      state other than enables.
5555bd8deadSopenharmony_ci
5565bd8deadSopenharmony_ci    Should we generate a GL_INVALID_OPERATION operation if updating
5575bd8deadSopenharmony_ci    a vertex attribute greater than 15?
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci      RESOLUTION:  Yes.
5605bd8deadSopenharmony_ci
5615bd8deadSopenharmony_ci      The other option would be to mask or modulo the vertex attribute
5625bd8deadSopenharmony_ci      index with 16.  This is cheap, but it would make it difficult to
5635bd8deadSopenharmony_ci      increase the number of vertex attributes in the future.
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci      If we check for the error, it should be a well predicted branch
5665bd8deadSopenharmony_ci      for immediate mode calls.  For vertex arrays, the check is only
5675bd8deadSopenharmony_ci      required at vertex array specification time.
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci      Hopefully this will encourage people to use vertex arrays over
5705bd8deadSopenharmony_ci      immediate mode.
5715bd8deadSopenharmony_ci
5725bd8deadSopenharmony_ci    Should writes to program parameter registers during a vertex program
5735bd8deadSopenharmony_ci    be supported?
5745bd8deadSopenharmony_ci
5755bd8deadSopenharmony_ci      RESOLUTION.  No.
5765bd8deadSopenharmony_ci
5775bd8deadSopenharmony_ci      Writes to program parameter registers from within a vertex program
5785bd8deadSopenharmony_ci      would require the execution of vertex programs to be serialized
5795bd8deadSopenharmony_ci      with respect to each other.  This would create an unwarranted
5805bd8deadSopenharmony_ci      implementation penalty for parallel vertex program execution
5815bd8deadSopenharmony_ci      implementations.
5825bd8deadSopenharmony_ci
5835bd8deadSopenharmony_ci      However vertex state programs may write to program parameter
5845bd8deadSopenharmony_ci      registers (that is the whole point of vertex state programs).
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci    Should we support variously sized immediate mode byte and ubyte
5875bd8deadSopenharmony_ci    commands?  How about for vertex arrays?
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci      RESOLUTION.  Only support the 4ub mode.
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ci      There are simply too many glVertexAttribNV routines.  Passing less
5925bd8deadSopenharmony_ci      than 4 bytes at a time is inefficient.  We expect the main use
5935bd8deadSopenharmony_ci      for bytes to be for colors where these will be unsigned bytes.
5945bd8deadSopenharmony_ci      So let's just support 4ub mode for bytes.  This applies to
5955bd8deadSopenharmony_ci      vertex arrays too.
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci    Should we support integer, unsigned integer, and unsigned short
5985bd8deadSopenharmony_ci    formats for vertex attributes?
5995bd8deadSopenharmony_ci
6005bd8deadSopenharmony_ci      RESOLUTION:  No.  It's just too many immediate mode entry points,
6015bd8deadSopenharmony_ci      most of which are not that useful.  Signed shorts are supported
6025bd8deadSopenharmony_ci      however.  We expect signed shorts to be useful for passing compact
6035bd8deadSopenharmony_ci      texture coordinates.
6045bd8deadSopenharmony_ci
6055bd8deadSopenharmony_ci    Should we support doubles for vertex attributes?
6065bd8deadSopenharmony_ci
6075bd8deadSopenharmony_ci      RESOLUTION:  Yes.  Some implementation of the extension might
6085bd8deadSopenharmony_ci      support double precision.  Lots of math routines output double
6095bd8deadSopenharmony_ci      precision.
6105bd8deadSopenharmony_ci
6115bd8deadSopenharmony_ci    Should there be a way to determine where in a loaded program
6125bd8deadSopenharmony_ci    string the first parse error occurs?
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci      RESOLUTION:  Yes.  You can query PROGRAM_ERROR_POSITION_NV.
6155bd8deadSopenharmony_ci
6165bd8deadSopenharmony_ci    Should program objects be shared among rendering contexts in the
6175bd8deadSopenharmony_ci    same manner as display lists and texture objects?
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci      RESOLUTION:  Yes.
6205bd8deadSopenharmony_ci
6215bd8deadSopenharmony_ci    How should this extension interact with color material?
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci      RESOLUTION:  It should not.  Color material is a conventional
6245bd8deadSopenharmony_ci      OpenGL vertex transform mode.  It does not have a place for vertex
6255bd8deadSopenharmony_ci      programs.  If you want to emulate color material with vertex
6265bd8deadSopenharmony_ci      programs, you would simply write a program where the material
6275bd8deadSopenharmony_ci      parameters feed from the color vertex attribute.
6285bd8deadSopenharmony_ci
6295bd8deadSopenharmony_ci    Should there be a glMatrixMode or glActiveTextureARB style selector
6305bd8deadSopenharmony_ci    for vertex attributes?
6315bd8deadSopenharmony_ci
6325bd8deadSopenharmony_ci      RESOLUTION:  No.  While this would let us reduce a lot of
6335bd8deadSopenharmony_ci      enumerants down, it would make programming a hassle in lots
6345bd8deadSopenharmony_ci      of cases.  Consider having to change the vertex attribute
6355bd8deadSopenharmony_ci      mode to enable a set of vertex arrays.
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci    How should gets for vertex attribute array pointers?
6385bd8deadSopenharmony_ci
6395bd8deadSopenharmony_ci      RESOLUTION:  Add new get commands.  Using the existing calls
6405bd8deadSopenharmony_ci      would require adding 4 sets of 16 enumerants stride, type, size,
6415bd8deadSopenharmony_ci      and pointer.  That's too many gets.
6425bd8deadSopenharmony_ci
6435bd8deadSopenharmony_ci      Instead add glGetVertexAttribNV and glGetVertexAttribPointervNV.
6445bd8deadSopenharmony_ci      glGetVertexAttribNV is also useful for querying the current vertex
6455bd8deadSopenharmony_ci      attribute.
6465bd8deadSopenharmony_ci
6475bd8deadSopenharmony_ci      glGet and glGetPointerv will not return vertex attribute array
6485bd8deadSopenharmony_ci      pointers.
6495bd8deadSopenharmony_ci
6505bd8deadSopenharmony_ci    Why is the address register numbered and why is it a vector
6515bd8deadSopenharmony_ci    register?
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci      In the future, A0.y and A0.z and A0.w may exist.  For this
6545bd8deadSopenharmony_ci      extension, only A0.x is useful.  Also in the future, there may be
6555bd8deadSopenharmony_ci      more than one address register.
6565bd8deadSopenharmony_ci
6575bd8deadSopenharmony_ci      There's a nice consistency in thinking about all the registers
6585bd8deadSopenharmony_ci      as 4-component vectors even if the address register has only one
6595bd8deadSopenharmony_ci      usable component.
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci    Should vertex programs and vertex state programs be required to
6625bd8deadSopenharmony_ci    have a header token and an end token?
6635bd8deadSopenharmony_ci
6645bd8deadSopenharmony_ci      RESOLUTION:  Yes.
6655bd8deadSopenharmony_ci
6665bd8deadSopenharmony_ci      The "!!VP1.0" and "!!VSP1.0" tokens start vertex programs and
6675bd8deadSopenharmony_ci      vertex state programs respectively.  Both types of programs must
6685bd8deadSopenharmony_ci      end with the "END" token.
6695bd8deadSopenharmony_ci
6705bd8deadSopenharmony_ci      The initial header token reminds the programmer what type of program
6715bd8deadSopenharmony_ci      they are writing.  If vertex programs and vertex state programs are
6725bd8deadSopenharmony_ci      ever read from disk files, the header token can serve as a magic
6735bd8deadSopenharmony_ci      number for identifying vertex programs and vertex state programs.
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci      The target type for vertex programs and vertex state programs can be
6765bd8deadSopenharmony_ci      distinguished based on their respective grammars independent of the
6775bd8deadSopenharmony_ci      initial header tokens, but the initial header tokens will make it
6785bd8deadSopenharmony_ci      easier for programmers to distinguish the two program target types.
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ci      We expect programs to often be generated by concatenation of
6815bd8deadSopenharmony_ci      program fragments.  The "END" token will hopefully reduce bugs
6825bd8deadSopenharmony_ci      due to specifying an incorrectly concatenated program.
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci      It's tempting to make these additional header and end tokens
6855bd8deadSopenharmony_ci      optional, but if there is a sanity check value in header and end
6865bd8deadSopenharmony_ci      tokens, that value is undermined if the tokens are optional.
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ci    What should be said about rendering invariances?
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci      RESOLUTION:  See the Appendix A additions below.
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ci      The justification for the two rules cited is to support multi-pass
6935bd8deadSopenharmony_ci      rendering when using vertex programs.  Different rendering passes
6945bd8deadSopenharmony_ci      will likely use different programs so there must be some means of
6955bd8deadSopenharmony_ci      guaranteeing that two different programs can generate particular
6965bd8deadSopenharmony_ci      identical vertex results between different passes.
6975bd8deadSopenharmony_ci
6985bd8deadSopenharmony_ci      In practice, this does limit the type of vertex program
6995bd8deadSopenharmony_ci      implementations that are possible.
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci      For example, consider a limited hardware implementation of vertex
7025bd8deadSopenharmony_ci      programs that uses a different floating-point implementation
7035bd8deadSopenharmony_ci      than the CPU's floating-point implementation.  If the limited
7045bd8deadSopenharmony_ci      hardware implementation can only run small vertex programs (say
7055bd8deadSopenharmony_ci      the hardware provides on 4 temporary registers instead of the
7065bd8deadSopenharmony_ci      required 12), the implementation is incorrect and non-conformant
7075bd8deadSopenharmony_ci      if programs that only require 4 temporary registers use the vertex
7085bd8deadSopenharmony_ci      program hardware, but programs that require more than 4 temporary
7095bd8deadSopenharmony_ci      registers are implemented by the CPU.
7105bd8deadSopenharmony_ci
7115bd8deadSopenharmony_ci      This is a very important practical requirement.  Consider a
7125bd8deadSopenharmony_ci      multi-pass rendering algorithm where one pass uses a vertex program
7135bd8deadSopenharmony_ci      that uses only 4 temporary registers, but a different pass uses a
7145bd8deadSopenharmony_ci      vertex program that uses 5 temporary registers.  If two programs
7155bd8deadSopenharmony_ci      have instruction sequences that given the same input state compute
7165bd8deadSopenharmony_ci      identical resulting vertex positions, the multi-pass algorithm
7175bd8deadSopenharmony_ci      should generate identically positioned primitives for each pass.
7185bd8deadSopenharmony_ci      But given the non-conformant vertex program implementation described
7195bd8deadSopenharmony_ci      above, this could not be guaranteed.
7205bd8deadSopenharmony_ci
7215bd8deadSopenharmony_ci      This does not mean that schemes for splitting vertex program
7225bd8deadSopenharmony_ci      implementations between dedicated hardware and CPUs are impossible.
7235bd8deadSopenharmony_ci      If the CPU and dedicated vertex program hardware used IDENTICAL
7245bd8deadSopenharmony_ci      floating-point implementations and therefore generated exactly
7255bd8deadSopenharmony_ci      identical results, the above described could work.
7265bd8deadSopenharmony_ci
7275bd8deadSopenharmony_ci      While these invariance rules are vital for vertex programs operating
7285bd8deadSopenharmony_ci      correctly for multi-pass algorithms, there is no requirement that
7295bd8deadSopenharmony_ci      conventional OpenGL vertex transform mode will be invariant with
7305bd8deadSopenharmony_ci      vertex program mode.  A multi-pass algorithm should not assume
7315bd8deadSopenharmony_ci      that one pass using vertex program mode and another pass using
7325bd8deadSopenharmony_ci      conventional GL vertex transform mode will generate identically
7335bd8deadSopenharmony_ci      positioned primitives.
7345bd8deadSopenharmony_ci
7355bd8deadSopenharmony_ci      Consider that while the conventional OpenGL vertex program mode
7365bd8deadSopenharmony_ci      is repeatable with itself, the exact procedure used to transform
7375bd8deadSopenharmony_ci      vertices is not specified nor is the procedure's precision
7385bd8deadSopenharmony_ci      specified.  The GL specification indicates that vertex coordinates
7395bd8deadSopenharmony_ci      are transformed by the modelview matrix and then transformed by the
7405bd8deadSopenharmony_ci      projection matrix.  Some implementations may perform this sequence
7415bd8deadSopenharmony_ci      of transformations exactly, but other implementations may transform
7425bd8deadSopenharmony_ci      vertex coordinates by the composite of the modelview and projection
7435bd8deadSopenharmony_ci      matrices (one matrix transform instead of two matrix transforms
7445bd8deadSopenharmony_ci      in sequence).  Given this implementation flexibility, there is no
7455bd8deadSopenharmony_ci      way for a vertex program author to exactly duplicate the precise
7465bd8deadSopenharmony_ci      computations used by the conventional OpenGL vertex transform mode.
7475bd8deadSopenharmony_ci
7485bd8deadSopenharmony_ci      The guidance to OpenGL application programs is clear.  If you are
7495bd8deadSopenharmony_ci      going to implement multi-pass rendering algorithms that require
7505bd8deadSopenharmony_ci      certain invariances between the multiple passes, choose either
7515bd8deadSopenharmony_ci      vertex program mode or the conventional OpenGL vertex transform
7525bd8deadSopenharmony_ci      mode for your rendering passes, but do not mix the two modes.
7535bd8deadSopenharmony_ci
7545bd8deadSopenharmony_ci    What range of relative addressing offsets should be allowed?
7555bd8deadSopenharmony_ci
7565bd8deadSopenharmony_ci      RESOLUTION:  -64 to 63.
7575bd8deadSopenharmony_ci
7585bd8deadSopenharmony_ci      Negative offsets are useful for accessing a table centered at zero
7595bd8deadSopenharmony_ci      without extra bias instructions.  Having the offsets support much
7605bd8deadSopenharmony_ci      larger magnitudes just seems to increase the required instruction
7615bd8deadSopenharmony_ci      widths.  The -64 to 63 range seems like a reasonable compromise.
7625bd8deadSopenharmony_ci
7635bd8deadSopenharmony_ci    When EXT_secondary_color is supported, how does the GL_COLOR_SUM_EXT
7645bd8deadSopenharmony_ci    enable affect vertex program mode?
7655bd8deadSopenharmony_ci
7665bd8deadSopenharmony_ci      RESOLUTION:  The GL_COLOR_SUM_EXT enable has no affect when vertex
7675bd8deadSopenharmony_ci      program mode is enabled.
7685bd8deadSopenharmony_ci
7695bd8deadSopenharmony_ci      When vertex program mode is enabled, the color sum operation is
7705bd8deadSopenharmony_ci      always in operation.  A program can "avoid" the color sum operation
7715bd8deadSopenharmony_ci      by not writing the COL1 (or BFC1 when GL_VERTEX_PROGRAM_TWO_SIDE_NV)
7725bd8deadSopenharmony_ci      vertex result registers because the default values of all vertex
7735bd8deadSopenharmony_ci      result registers is (0,0,0,1).  For the color sum operation,
7745bd8deadSopenharmony_ci      the alpha value is always assumed zero.  So by not writing the
7755bd8deadSopenharmony_ci      secondary color vertex result registers, the program assures that
7765bd8deadSopenharmony_ci      zero is added as part of the color sum operation.
7775bd8deadSopenharmony_ci
7785bd8deadSopenharmony_ci      If there is a cost to the color sum operation, OpenGL
7795bd8deadSopenharmony_ci      implementations may be smart enough to determine at program bind
7805bd8deadSopenharmony_ci      time whether a secondary color vertex result is generated and
7815bd8deadSopenharmony_ci      implicitly disable the color sum operation.
7825bd8deadSopenharmony_ci
7835bd8deadSopenharmony_ci    Why must RCP of 1.0 always be 1.0?
7845bd8deadSopenharmony_ci
7855bd8deadSopenharmony_ci      This is important for 3D graphics so that non-projective textures
7865bd8deadSopenharmony_ci      and orthogonal projections work as expected.  Basically when q or
7875bd8deadSopenharmony_ci      w is 1.0, things should work as expected.
7885bd8deadSopenharmony_ci
7895bd8deadSopenharmony_ci      Stronger requirements such as "RCP of -1.0 must always be -1.0"
7905bd8deadSopenharmony_ci      are encouraged, but there is no compelling reason to state such
7915bd8deadSopenharmony_ci      requirements explicitly as is the case for "RCP of 1.0 must always
7925bd8deadSopenharmony_ci      be 1.0".
7935bd8deadSopenharmony_ci
7945bd8deadSopenharmony_ci    What happens when the source scalar value for the ARL instruction
7955bd8deadSopenharmony_ci    is an extremely positive or extremely negative floating-point value?
7965bd8deadSopenharmony_ci    Is there a problem mapping the value to a constrained integer range?
7975bd8deadSopenharmony_ci
7985bd8deadSopenharmony_ci      RESOLUTION:  It is not a problem.  Relative addressing can by offset
7995bd8deadSopenharmony_ci      by a limited range of offsets (-64 to 63).  Relative addressing
8005bd8deadSopenharmony_ci      that falls outside of the 0 to 95 range of program parameter
8015bd8deadSopenharmony_ci      registers is automatically mapped to (0,0,0,0).
8025bd8deadSopenharmony_ci
8035bd8deadSopenharmony_ci      Clamping the source scalar value for ARL to the range -64 to 160
8045bd8deadSopenharmony_ci      inclusive is sufficient to ensure that relative addressing is out
8055bd8deadSopenharmony_ci      of range.
8065bd8deadSopenharmony_ci
8075bd8deadSopenharmony_ci    How do you perform a 3-component normalize in three instructions?
8085bd8deadSopenharmony_ci
8095bd8deadSopenharmony_ci      #
8105bd8deadSopenharmony_ci      # R1 = (nx,ny,nz)
8115bd8deadSopenharmony_ci      #
8125bd8deadSopenharmony_ci      # R0.xyz = normalize(R1)
8135bd8deadSopenharmony_ci      # R0.w   = 1/sqrt(nx*nx + ny*ny + nz*nz)
8145bd8deadSopenharmony_ci      #
8155bd8deadSopenharmony_ci      DP3 R0.w, R1, R1;
8165bd8deadSopenharmony_ci      RSQ R0.w, R0.w;
8175bd8deadSopenharmony_ci      MUL R0.xyz, R1, R0.w;
8185bd8deadSopenharmony_ci
8195bd8deadSopenharmony_ci    How do you perform a 3-component cross product in two instructions?
8205bd8deadSopenharmony_ci
8215bd8deadSopenharmony_ci      #
8225bd8deadSopenharmony_ci      # Cross product |  i     j     k   | into R2.
8235bd8deadSopenharmony_ci      #               | R0.x  R0.y  R0.z |
8245bd8deadSopenharmony_ci      #               | R1.x  R1.y  R1.z |
8255bd8deadSopenharmony_ci      #
8265bd8deadSopenharmony_ci      MUL R2, R0.zxyw, R1.yzxw;
8275bd8deadSopenharmony_ci      MAD R2, R0.yzxw, R1.zxyw, -R2;
8285bd8deadSopenharmony_ci
8295bd8deadSopenharmony_ci    How do you perform a 4-component vector absolute value in one
8305bd8deadSopenharmony_ci    instruction?
8315bd8deadSopenharmony_ci
8325bd8deadSopenharmony_ci      #
8335bd8deadSopenharmony_ci      # Absolute value is the maximum of the negative and positive
8345bd8deadSopenharmony_ci      # components of a vector.
8355bd8deadSopenharmony_ci      #
8365bd8deadSopenharmony_ci      # R1 = abs(R0)
8375bd8deadSopenharmony_ci      #
8385bd8deadSopenharmony_ci      MAX R1, R0, -R0;
8395bd8deadSopenharmony_ci
8405bd8deadSopenharmony_ci    How do you compute the determinant of a 3x3 matrix in three
8415bd8deadSopenharmony_ci    instructions?
8425bd8deadSopenharmony_ci
8435bd8deadSopenharmony_ci      #
8445bd8deadSopenharmony_ci      # Determinant of | R0.x  R0.y  R0.z | into R3
8455bd8deadSopenharmony_ci      #                | R1.x  R1.y  R1.z |
8465bd8deadSopenharmony_ci      #                | R2.x  R2.y  R2.z |
8475bd8deadSopenharmony_ci      #
8485bd8deadSopenharmony_ci      MUL R3, R1.zxyw, R2.yzxw;
8495bd8deadSopenharmony_ci      MAD R3, R1.yzxw, R2.zxyw, -R3;
8505bd8deadSopenharmony_ci      DP3 R3, R0, R3;
8515bd8deadSopenharmony_ci
8525bd8deadSopenharmony_ci    How do you transform a vertex position by a 4x4 matrix and then
8535bd8deadSopenharmony_ci    perform a homogeneous divide?
8545bd8deadSopenharmony_ci
8555bd8deadSopenharmony_ci      #
8565bd8deadSopenharmony_ci      # c[20] = modelview row 0
8575bd8deadSopenharmony_ci      # c[21] = modelview row 1
8585bd8deadSopenharmony_ci      # c[22] = modelview row 2
8595bd8deadSopenharmony_ci      # c[23] = modelview row 3
8605bd8deadSopenharmony_ci      #
8615bd8deadSopenharmony_ci      # result = R5
8625bd8deadSopenharmony_ci      #
8635bd8deadSopenharmony_ci      DP4 R5.w, v[OPOS], c[23];
8645bd8deadSopenharmony_ci      DP4 R5.x, v[OPOS], c[20];
8655bd8deadSopenharmony_ci      DP4 R5.y, v[OPOS], c[21];
8665bd8deadSopenharmony_ci      DP4 R5.z, v[OPOS], c[22];
8675bd8deadSopenharmony_ci      RCP R11, R5.w;
8685bd8deadSopenharmony_ci      MUL R5,R5,R11;
8695bd8deadSopenharmony_ci
8705bd8deadSopenharmony_ci    How do you perform a vector weighting of two vectors using a single
8715bd8deadSopenharmony_ci    weight?
8725bd8deadSopenharmony_ci
8735bd8deadSopenharmony_ci      #
8745bd8deadSopenharmony_ci      # R2        = vector 0
8755bd8deadSopenharmony_ci      # R3        = vector 1
8765bd8deadSopenharmony_ci      # v[WGHT].x = scalar weight to blend vectors 0 and 1
8775bd8deadSopenharmony_ci      # result    = R2 * v[WGHT].x + R3 * (1-v[WGHT])
8785bd8deadSopenharmony_ci      #
8795bd8deadSopenharmony_ci      # this is because A*B + (1-A)*C = A*(B-C) + C
8805bd8deadSopenharmony_ci      #
8815bd8deadSopenharmony_ci      ADD R4, R2, -R3;
8825bd8deadSopenharmony_ci      MAD R4, v[WGHT].x, R4, R3;
8835bd8deadSopenharmony_ci
8845bd8deadSopenharmony_ci    How do you reduce a value to some fundamental period such as 2*PI?
8855bd8deadSopenharmony_ci
8865bd8deadSopenharmony_ci      #
8875bd8deadSopenharmony_ci      # c[36] = (1.0/(2*PI), 2*PI, 0.0, 0.0)
8885bd8deadSopenharmony_ci      #
8895bd8deadSopenharmony_ci      # R1.x = input value
8905bd8deadSopenharmony_ci      # R2   = result
8915bd8deadSopenharmony_ci      #
8925bd8deadSopenharmony_ci      MUL R0, R1, c[36].x;
8935bd8deadSopenharmony_ci      EXP R4, R0.x;
8945bd8deadSopenharmony_ci      MUL R2, R4.y, c[36].y;
8955bd8deadSopenharmony_ci
8965bd8deadSopenharmony_ci    How do you implement a simple specular and diffuse lighting
8975bd8deadSopenharmony_ci    computation with an eye-space normal?
8985bd8deadSopenharmony_ci
8995bd8deadSopenharmony_ci      !!VP1.0
9005bd8deadSopenharmony_ci      #
9015bd8deadSopenharmony_ci      # c[0-3]  = modelview projection (composite) matrix
9025bd8deadSopenharmony_ci      # c[4-7]  = modelview inverse transpose
9035bd8deadSopenharmony_ci      # c[32]   = normalized eye-space light direction (infinite light)
9045bd8deadSopenharmony_ci      # c[33]   = normalized constant eye-space half-angle vector (infinite viewer)
9055bd8deadSopenharmony_ci      # c[35].x = pre-multiplied monochromatic diffuse light color & diffuse material
9065bd8deadSopenharmony_ci      # c[35].y = pre-multiplied monochromatic ambient light color & diffuse material
9075bd8deadSopenharmony_ci      # c[36]   = specular color
9085bd8deadSopenharmony_ci      # c[38].x = specular power
9095bd8deadSopenharmony_ci      #
9105bd8deadSopenharmony_ci      # outputs homogenous position and color
9115bd8deadSopenharmony_ci      #
9125bd8deadSopenharmony_ci      DP4   o[HPOS].x, c[0], v[OPOS];
9135bd8deadSopenharmony_ci      DP4   o[HPOS].y, c[1], v[OPOS];
9145bd8deadSopenharmony_ci      DP4   o[HPOS].z, c[2], v[OPOS];
9155bd8deadSopenharmony_ci      DP4   o[HPOS].w, c[3], v[OPOS];
9165bd8deadSopenharmony_ci      DP3   R0.x, c[4], v[NRML];
9175bd8deadSopenharmony_ci      DP3   R0.y, c[5], v[NRML]; 
9185bd8deadSopenharmony_ci      DP3   R0.z, c[6], v[NRML];           # R0 = n' = transformed normal
9195bd8deadSopenharmony_ci      DP3   R1.x, c[32], R0;               # R1.x = Lpos DOT n'
9205bd8deadSopenharmony_ci      DP3   R1.y, c[33], R0;               # R1.y = hHat DOT n'
9215bd8deadSopenharmony_ci      MOV   R1.w, c[38].x;                 # R1.w = specular power
9225bd8deadSopenharmony_ci      LIT   R2, R1;                        # Compute lighting values
9235bd8deadSopenharmony_ci      MAD   R3, c[35].x, R2.y, c[35].y;    # diffuse + emissive
9245bd8deadSopenharmony_ci      MAD   o[COL0].xyz, c[36], R2.z, R3;  # + specular
9255bd8deadSopenharmony_ci      END
9265bd8deadSopenharmony_ci
9275bd8deadSopenharmony_ci    Can you perturb transformed vertex positions with a vertex program?
9285bd8deadSopenharmony_ci
9295bd8deadSopenharmony_ci      Yes.  Here is an example that performs an object-space diffuse
9305bd8deadSopenharmony_ci      lighting computations and perturbs the vertex position based on
9315bd8deadSopenharmony_ci      this lighting result.  Do not take this example too seriously.
9325bd8deadSopenharmony_ci
9335bd8deadSopenharmony_ci        !!VP1.0
9345bd8deadSopenharmony_ci        #
9355bd8deadSopenharmony_ci        # c[0-3]  = modelview projection (composite) matrix
9365bd8deadSopenharmony_ci        # c[32]   = normalized light direction in object-space
9375bd8deadSopenharmony_ci        # c[35]   = yellow diffuse material, (1.0, 1.0, 0.0, 1.0)
9385bd8deadSopenharmony_ci        # c[64].x = 0.0
9395bd8deadSopenharmony_ci        # c[64].z = 0.125, a scaling factor
9405bd8deadSopenharmony_ci        #
9415bd8deadSopenharmony_ci        # outputs diffuse illumination for color and perturbed position
9425bd8deadSopenharmony_ci        #
9435bd8deadSopenharmony_ci        DP3   R0, c[32], v[NRML];     # light direction DOT normal
9445bd8deadSopenharmony_ci        MUL   o[COL0].xyz, R0, c[35]; 
9455bd8deadSopenharmony_ci        MAX   R0, c[64].x, R0; 
9465bd8deadSopenharmony_ci        MUL   R0, R0, v[NRML]; 
9475bd8deadSopenharmony_ci        MUL   R0, R0, c[64].z;  
9485bd8deadSopenharmony_ci        ADD   R1, v[OPOS], -R0;       # perturb object space position
9495bd8deadSopenharmony_ci        DP4   o[HPOS].x, c[0], R1; 
9505bd8deadSopenharmony_ci        DP4   o[HPOS].y, c[1], R1; 
9515bd8deadSopenharmony_ci        DP4   o[HPOS].z, c[2], R1; 
9525bd8deadSopenharmony_ci        DP4   o[HPOS].w, c[3], R1; 
9535bd8deadSopenharmony_ci        END
9545bd8deadSopenharmony_ci
9555bd8deadSopenharmony_ci    What if more exponential precision is needed than provided by the
9565bd8deadSopenharmony_ci    builtin EXP instruction?
9575bd8deadSopenharmony_ci
9585bd8deadSopenharmony_ci        A sequence of vertex program instructions can be used refine
9595bd8deadSopenharmony_ci        the initial EXP approximation.  The pseudo-macro below shows an
9605bd8deadSopenharmony_ci        example of how to refine the EXP approximation.
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ci        The psuedo-macro requires 10 instructions, 1 temp register,
9635bd8deadSopenharmony_ci        and 2 constant locations.
9645bd8deadSopenharmony_ci
9655bd8deadSopenharmony_ci        CE0 = { 9.61597636e-03, -1.32823968e-03, 1.47491097e-04, -1.08635004e-05 };
9665bd8deadSopenharmony_ci        CE1 = { 1.00000000e+00, -6.93147182e-01, 2.40226462e-01, -5.55036440e-02 };
9675bd8deadSopenharmony_ci
9685bd8deadSopenharmony_ci        /* Rt != Ro && Rt != Ri */
9695bd8deadSopenharmony_ci        EXP_MACRO(Ro:vector, Ri:scalar, Rt:vector) {
9705bd8deadSopenharmony_ci           EXP Rt, Ri.x;                   /* Use appropriate component of Ri */
9715bd8deadSopenharmony_ci           MAD Rt.w, c[CE0].w, Rt.y, c[CE0].z;
9725bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE0].y;
9735bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE0].x;
9745bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE1].w;
9755bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE1].z;
9765bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE1].y;
9775bd8deadSopenharmony_ci           MAD Rt.w, Rt.w,Rt.y, c[CE1].x;
9785bd8deadSopenharmony_ci           RCP Rt.w, Rt.w;
9795bd8deadSopenharmony_ci           MUL Ro, Rt.w, Rt.x;             /* Apply user write mask to Ro */
9805bd8deadSopenharmony_ci        }
9815bd8deadSopenharmony_ci
9825bd8deadSopenharmony_ci        Simulation gives |max abs error| < 3.77e-07 over the range (0.0
9835bd8deadSopenharmony_ci        <= x < 1.0).  Actual vertex program precision may be slightly
9845bd8deadSopenharmony_ci        less accurate than this.
9855bd8deadSopenharmony_ci
9865bd8deadSopenharmony_ci    What if more exponential precision is needed than provided by the
9875bd8deadSopenharmony_ci    builtin LOG instruction?
9885bd8deadSopenharmony_ci
9895bd8deadSopenharmony_ci        The pseudo-macro requires 10 instructions, 1 temp register,
9905bd8deadSopenharmony_ci        and 3 constant locations.
9915bd8deadSopenharmony_ci   
9925bd8deadSopenharmony_ci        CL0 = { 2.41873696e-01, -1.37531206e-01, 5.20646796e-02, -9.31049418e-03 };
9935bd8deadSopenharmony_ci        CL1 = { 1.44268966e+00, -7.21165776e-01, 4.78684813e-01, -3.47305417e-01 };
9945bd8deadSopenharmony_ci        CL2 = { 1.0, NA, NA, NA };
9955bd8deadSopenharmony_ci
9965bd8deadSopenharmony_ci        /* Rt != Ro && Rt != Ri */
9975bd8deadSopenharmony_ci        LOG_MACRO(Ro:vector, Ri:scalar, Rt:vector) {
9985bd8deadSopenharmony_ci           LOG Rt, Ri.x;                   /* Use appropriate component of Ri */
9995bd8deadSopenharmony_ci           ADD Rt.y, Rt.y, -c[CL2].x;
10005bd8deadSopenharmony_ci           MAD Rt.w, c[CL0].w, Rt.y, c[CL0].z;
10015bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL0].y;
10025bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL0].x;
10035bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL1].w;
10045bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL1].z;
10055bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL1].y;
10065bd8deadSopenharmony_ci           MAD Rt.w, Rt.w, Rt.y,c[CL1].x;
10075bd8deadSopenharmony_ci           MAD Ro, Rt.w, Rt.y, Rt.x;       /* Apply user write mask to Ro */
10085bd8deadSopenharmony_ci        }
10095bd8deadSopenharmony_ci  
10105bd8deadSopenharmony_ci        Simulation gives |max abs error| < 1.79e-07 over the range (1.0
10115bd8deadSopenharmony_ci        <= x < 2.0).  Actual vertex program precision may be slightly
10125bd8deadSopenharmony_ci        less accurate than this.
10135bd8deadSopenharmony_ci
10145bd8deadSopenharmony_ciNew Procedures and Functions
10155bd8deadSopenharmony_ci
10165bd8deadSopenharmony_ci    void BindProgramNV(enum target, uint id);
10175bd8deadSopenharmony_ci
10185bd8deadSopenharmony_ci    void DeleteProgramsNV(sizei n, const uint *ids);
10195bd8deadSopenharmony_ci
10205bd8deadSopenharmony_ci    void ExecuteProgramNV(enum target, uint id, const float *params);
10215bd8deadSopenharmony_ci
10225bd8deadSopenharmony_ci    void GenProgramsNV(sizei n, uint *ids);
10235bd8deadSopenharmony_ci
10245bd8deadSopenharmony_ci    boolean AreProgramsResidentNV(sizei n, const uint *ids,
10255bd8deadSopenharmony_ci                                  boolean *residences);
10265bd8deadSopenharmony_ci
10275bd8deadSopenharmony_ci    void RequestResidentProgramsNV(sizei n, uint *ids);
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ci    void GetProgramParameterfvNV(enum target, uint index,
10305bd8deadSopenharmony_ci                                 enum pname, float *params);
10315bd8deadSopenharmony_ci    void GetProgramParameterdvNV(enum target, uint index,
10325bd8deadSopenharmony_ci                                 enum pname, double *params);
10335bd8deadSopenharmony_ci
10345bd8deadSopenharmony_ci    void GetProgramivNV(uint id, enum pname, int *params);
10355bd8deadSopenharmony_ci
10365bd8deadSopenharmony_ci    void GetProgramStringNV(uint id, enum pname, ubyte *program);
10375bd8deadSopenharmony_ci
10385bd8deadSopenharmony_ci    void GetTrackMatrixivNV(enum target, uint address,
10395bd8deadSopenharmony_ci                            enum pname, int *params);
10405bd8deadSopenharmony_ci
10415bd8deadSopenharmony_ci    void GetVertexAttribdvNV(uint index, enum pname, double *params);
10425bd8deadSopenharmony_ci    void GetVertexAttribfvNV(uint index, enum pname, float *params);
10435bd8deadSopenharmony_ci    void GetVertexAttribivNV(uint index, enum pname, int *params);
10445bd8deadSopenharmony_ci
10455bd8deadSopenharmony_ci    void GetVertexAttribPointervNV(uint index, enum pname, void **pointer);
10465bd8deadSopenharmony_ci
10475bd8deadSopenharmony_ci    boolean IsProgramNV(uint id);
10485bd8deadSopenharmony_ci
10495bd8deadSopenharmony_ci    void LoadProgramNV(enum target, uint id, sizei len,
10505bd8deadSopenharmony_ci                       const ubyte *program);
10515bd8deadSopenharmony_ci
10525bd8deadSopenharmony_ci    void ProgramParameter4fNV(enum target, uint index,
10535bd8deadSopenharmony_ci                              float x, float y, float z, float w)
10545bd8deadSopenharmony_ci    void ProgramParameter4dNV(enum target, uint index,
10555bd8deadSopenharmony_ci                              double x, double y, double z, double w)
10565bd8deadSopenharmony_ci
10575bd8deadSopenharmony_ci    void ProgramParameter4dvNV(enum target, uint index,
10585bd8deadSopenharmony_ci                               const double *params);
10595bd8deadSopenharmony_ci    void ProgramParameter4fvNV(enum target, uint index,
10605bd8deadSopenharmony_ci                               const float *params);
10615bd8deadSopenharmony_ci
10625bd8deadSopenharmony_ci    void ProgramParameters4dvNV(enum target, uint index,
10635bd8deadSopenharmony_ci                                sizei num, const double *params);
10645bd8deadSopenharmony_ci    void ProgramParameters4fvNV(enum target, uint index,
10655bd8deadSopenharmony_ci                                sizei num, const float *params);
10665bd8deadSopenharmony_ci
10675bd8deadSopenharmony_ci    void TrackMatrixNV(enum target, uint address,
10685bd8deadSopenharmony_ci                       enum matrix, enum transform);
10695bd8deadSopenharmony_ci
10705bd8deadSopenharmony_ci    void VertexAttribPointerNV(uint index, int size, enum type, sizei stride,
10715bd8deadSopenharmony_ci                               const void *pointer);
10725bd8deadSopenharmony_ci
10735bd8deadSopenharmony_ci    void VertexAttrib1sNV(uint index, short x);
10745bd8deadSopenharmony_ci    void VertexAttrib1fNV(uint index, float x);
10755bd8deadSopenharmony_ci    void VertexAttrib1dNV(uint index, double x);
10765bd8deadSopenharmony_ci    void VertexAttrib2sNV(uint index, short x, short y);
10775bd8deadSopenharmony_ci    void VertexAttrib2fNV(uint index, float x, float y);
10785bd8deadSopenharmony_ci    void VertexAttrib2dNV(uint index, double x, double y);
10795bd8deadSopenharmony_ci    void VertexAttrib3sNV(uint index, short x, short y, short z);
10805bd8deadSopenharmony_ci    void VertexAttrib3fNV(uint index, float x, float y, float z);
10815bd8deadSopenharmony_ci    void VertexAttrib3dNV(uint index, double x, double y, double z);
10825bd8deadSopenharmony_ci    void VertexAttrib4sNV(uint index, short x, short y, short z, short w);
10835bd8deadSopenharmony_ci    void VertexAttrib4fNV(uint index, float x, float y, float z, float w);
10845bd8deadSopenharmony_ci    void VertexAttrib4dNV(uint index, double x, double y, double z, double w);
10855bd8deadSopenharmony_ci    void VertexAttrib4ubNV(uint index, ubyte x, ubyte y, ubyte z, ubyte w);
10865bd8deadSopenharmony_ci
10875bd8deadSopenharmony_ci    void VertexAttrib1svNV(uint index, const short *v);
10885bd8deadSopenharmony_ci    void VertexAttrib1fvNV(uint index, const float *v);
10895bd8deadSopenharmony_ci    void VertexAttrib1dvNV(uint index, const double *v);
10905bd8deadSopenharmony_ci    void VertexAttrib2svNV(uint index, const short *v);
10915bd8deadSopenharmony_ci    void VertexAttrib2fvNV(uint index, const float *v);
10925bd8deadSopenharmony_ci    void VertexAttrib2dvNV(uint index, const double *v);
10935bd8deadSopenharmony_ci    void VertexAttrib3svNV(uint index, const short *v);
10945bd8deadSopenharmony_ci    void VertexAttrib3fvNV(uint index, const float *v);
10955bd8deadSopenharmony_ci    void VertexAttrib3dvNV(uint index, const double *v);
10965bd8deadSopenharmony_ci    void VertexAttrib4svNV(uint index, const short *v);
10975bd8deadSopenharmony_ci    void VertexAttrib4fvNV(uint index, const float *v);
10985bd8deadSopenharmony_ci    void VertexAttrib4dvNV(uint index, const double *v);
10995bd8deadSopenharmony_ci    void VertexAttrib4ubvNV(uint index, const ubyte *v);
11005bd8deadSopenharmony_ci
11015bd8deadSopenharmony_ci    void VertexAttribs1svNV(uint index, sizei n, const short *v);
11025bd8deadSopenharmony_ci    void VertexAttribs1fvNV(uint index, sizei n, const float *v);
11035bd8deadSopenharmony_ci    void VertexAttribs1dvNV(uint index, sizei n, const double *v);
11045bd8deadSopenharmony_ci    void VertexAttribs2svNV(uint index, sizei n, const short *v);
11055bd8deadSopenharmony_ci    void VertexAttribs2fvNV(uint index, sizei n, const float *v);
11065bd8deadSopenharmony_ci    void VertexAttribs2dvNV(uint index, sizei n, const double *v);
11075bd8deadSopenharmony_ci    void VertexAttribs3svNV(uint index, sizei n, const short *v);
11085bd8deadSopenharmony_ci    void VertexAttribs3fvNV(uint index, sizei n, const float *v);
11095bd8deadSopenharmony_ci    void VertexAttribs3dvNV(uint index, sizei n, const double *v);
11105bd8deadSopenharmony_ci    void VertexAttribs4svNV(uint index, sizei n, const short *v);
11115bd8deadSopenharmony_ci    void VertexAttribs4fvNV(uint index, sizei n, const float *v);
11125bd8deadSopenharmony_ci    void VertexAttribs4dvNV(uint index, sizei n, const double *v);
11135bd8deadSopenharmony_ci    void VertexAttribs4ubvNV(uint index, sizei n, const ubyte *v);
11145bd8deadSopenharmony_ci
11155bd8deadSopenharmony_ciNew Tokens
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
11185bd8deadSopenharmony_ci    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
11195bd8deadSopenharmony_ci    and GetDoublev, and by the <target> parameter of BindProgramNV,
11205bd8deadSopenharmony_ci    ExecuteProgramNV, GetProgramParameter[df]vNV, GetTrackMatrixivNV,
11215bd8deadSopenharmony_ci    LoadProgramNV, ProgramParameter[s]4[df][v]NV, and TrackMatrixNV:
11225bd8deadSopenharmony_ci
11235bd8deadSopenharmony_ci        VERTEX_PROGRAM_NV                              0x8620 
11245bd8deadSopenharmony_ci
11255bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Disable, Enable, and IsEnabled,
11265bd8deadSopenharmony_ci    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
11275bd8deadSopenharmony_ci    and GetDoublev:
11285bd8deadSopenharmony_ci
11295bd8deadSopenharmony_ci        VERTEX_PROGRAM_POINT_SIZE_NV                   0x8642
11305bd8deadSopenharmony_ci        VERTEX_PROGRAM_TWO_SIDE_NV                     0x8643
11315bd8deadSopenharmony_ci
11325bd8deadSopenharmony_ci    Accepted by the <target> parameter of ExecuteProgramNV and
11335bd8deadSopenharmony_ci    LoadProgramNV:
11345bd8deadSopenharmony_ci    
11355bd8deadSopenharmony_ci        VERTEX_STATE_PROGRAM_NV                        0x8621 
11365bd8deadSopenharmony_ci
11375bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetVertexAttrib[dfi]vNV:
11385bd8deadSopenharmony_ci
11395bd8deadSopenharmony_ci        ATTRIB_ARRAY_SIZE_NV                           0x8623
11405bd8deadSopenharmony_ci        ATTRIB_ARRAY_STRIDE_NV                         0x8624
11415bd8deadSopenharmony_ci        ATTRIB_ARRAY_TYPE_NV                           0x8625
11425bd8deadSopenharmony_ci        CURRENT_ATTRIB_NV                              0x8626
11435bd8deadSopenharmony_ci
11445bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramParameterfvNV
11455bd8deadSopenharmony_ci    and GetProgramParameterdvNV:
11465bd8deadSopenharmony_ci
11475bd8deadSopenharmony_ci        PROGRAM_PARAMETER_NV                           0x8644
11485bd8deadSopenharmony_ci
11495bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetVertexAttribPointervNV:
11505bd8deadSopenharmony_ci
11515bd8deadSopenharmony_ci        ATTRIB_ARRAY_POINTER_NV                        0x8645
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramivNV:
11545bd8deadSopenharmony_ci
11555bd8deadSopenharmony_ci        PROGRAM_TARGET_NV                              0x8646
11565bd8deadSopenharmony_ci        PROGRAM_LENGTH_NV                              0x8627
11575bd8deadSopenharmony_ci        PROGRAM_RESIDENT_NV                            0x8647
11585bd8deadSopenharmony_ci
11595bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramStringNV:
11605bd8deadSopenharmony_ci
11615bd8deadSopenharmony_ci        PROGRAM_STRING_NV                              0x8628
11625bd8deadSopenharmony_ci
11635bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTrackMatrixivNV:
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci        TRACK_MATRIX_NV                                0x8648
11665bd8deadSopenharmony_ci        TRACK_MATRIX_TRANSFORM_NV                      0x8649
11675bd8deadSopenharmony_ci
11685bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
11695bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
11705bd8deadSopenharmony_ci
11715bd8deadSopenharmony_ci        MAX_TRACK_MATRIX_STACK_DEPTH_NV                0x862E
11725bd8deadSopenharmony_ci        MAX_TRACK_MATRICES_NV                          0x862F
11735bd8deadSopenharmony_ci        CURRENT_MATRIX_STACK_DEPTH_NV                  0x8640
11745bd8deadSopenharmony_ci        CURRENT_MATRIX_NV                              0x8641
11755bd8deadSopenharmony_ci        VERTEX_PROGRAM_BINDING_NV                      0x864A
11765bd8deadSopenharmony_ci        PROGRAM_ERROR_POSITION_NV                      0x864B
11775bd8deadSopenharmony_ci
11785bd8deadSopenharmony_ci    Accepted by the <matrix> parameter of TrackMatrixNV:
11795bd8deadSopenharmony_ci    
11805bd8deadSopenharmony_ci        NONE
11815bd8deadSopenharmony_ci        MODELVIEW
11825bd8deadSopenharmony_ci        PROJECTION
11835bd8deadSopenharmony_ci        TEXTURE
11845bd8deadSopenharmony_ci        COLOR (if ARB_imaging is supported)
11855bd8deadSopenharmony_ci        MODELVIEW_PROJECTION_NV                        0x8629
11865bd8deadSopenharmony_ci        TEXTUREi_ARB
11875bd8deadSopenharmony_ci
11885bd8deadSopenharmony_ci    where i is between 0 and n-1 where n is the number of texture units
11895bd8deadSopenharmony_ci    supported.
11905bd8deadSopenharmony_ci
11915bd8deadSopenharmony_ci    Accepted by the <matrix> parameter of TrackMatrixNV and by the
11925bd8deadSopenharmony_ci    <mode> parameter of MatrixMode:
11935bd8deadSopenharmony_ci    
11945bd8deadSopenharmony_ci        MATRIX0_NV                                     0x8630
11955bd8deadSopenharmony_ci        MATRIX1_NV                                     0x8631
11965bd8deadSopenharmony_ci        MATRIX2_NV                                     0x8632
11975bd8deadSopenharmony_ci        MATRIX3_NV                                     0x8633
11985bd8deadSopenharmony_ci        MATRIX4_NV                                     0x8634
11995bd8deadSopenharmony_ci        MATRIX5_NV                                     0x8635
12005bd8deadSopenharmony_ci        MATRIX6_NV                                     0x8636
12015bd8deadSopenharmony_ci        MATRIX7_NV                                     0x8637
12025bd8deadSopenharmony_ci
12035bd8deadSopenharmony_ci        (Enumerants 0x8638 through 0x863F are reserved for further matrix
12045bd8deadSopenharmony_ci        enumerants 8 through 15.)
12055bd8deadSopenharmony_ci
12065bd8deadSopenharmony_ci    Accepted by the <transform> parameter of TrackMatrixNV:
12075bd8deadSopenharmony_ci
12085bd8deadSopenharmony_ci        IDENTITY_NV                                    0x862A
12095bd8deadSopenharmony_ci        INVERSE_NV                                     0x862B
12105bd8deadSopenharmony_ci        TRANSPOSE_NV                                   0x862C
12115bd8deadSopenharmony_ci        INVERSE_TRANSPOSE_NV                           0x862D 
12125bd8deadSopenharmony_ci
12135bd8deadSopenharmony_ci    Accepted by the <array> parameter of EnableClientState and
12145bd8deadSopenharmony_ci    DisableClientState, by the <cap> parameter of IsEnabled, and by
12155bd8deadSopenharmony_ci    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
12165bd8deadSopenharmony_ci    GetDoublev:
12175bd8deadSopenharmony_ci
12185bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY0_NV                        0x8650
12195bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY1_NV                        0x8651
12205bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY2_NV                        0x8652
12215bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY3_NV                        0x8653
12225bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY4_NV                        0x8654
12235bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY5_NV                        0x8655
12245bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY6_NV                        0x8656
12255bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY7_NV                        0x8657
12265bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY8_NV                        0x8658
12275bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY9_NV                        0x8659
12285bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY10_NV                       0x865A
12295bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY11_NV                       0x865B
12305bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY12_NV                       0x865C
12315bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY13_NV                       0x865D
12325bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY14_NV                       0x865E
12335bd8deadSopenharmony_ci        VERTEX_ATTRIB_ARRAY15_NV                       0x865F
12345bd8deadSopenharmony_ci
12355bd8deadSopenharmony_ci    Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
12365bd8deadSopenharmony_ci    Map1d and Map1f and by the <cap> parameter of Enable, Disable, and
12375bd8deadSopenharmony_ci    IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
12385bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
12395bd8deadSopenharmony_ci
12405bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB0_4_NV                       0x8660
12415bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB1_4_NV                       0x8661
12425bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB2_4_NV                       0x8662
12435bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB3_4_NV                       0x8663
12445bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB4_4_NV                       0x8664
12455bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB5_4_NV                       0x8665
12465bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB6_4_NV                       0x8666
12475bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB7_4_NV                       0x8667
12485bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB8_4_NV                       0x8668
12495bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB9_4_NV                       0x8669
12505bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB10_4_NV                      0x866A
12515bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB11_4_NV                      0x866B
12525bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB12_4_NV                      0x866C
12535bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB13_4_NV                      0x866D
12545bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB14_4_NV                      0x866E
12555bd8deadSopenharmony_ci        MAP1_VERTEX_ATTRIB15_4_NV                      0x866F
12565bd8deadSopenharmony_ci
12575bd8deadSopenharmony_ci    Accepted by the <target> parameter of GetMapdv, GetMapfv, GetMapiv,
12585bd8deadSopenharmony_ci    Map2d and Map2f and by the <cap> parameter of Enable, Disable, and
12595bd8deadSopenharmony_ci    IsEnabled, and by the <pname> parameter of GetBooleanv, GetIntegerv,
12605bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
12615bd8deadSopenharmony_ci
12625bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB0_4_NV                       0x8670
12635bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB1_4_NV                       0x8671
12645bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB2_4_NV                       0x8672
12655bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB3_4_NV                       0x8673
12665bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB4_4_NV                       0x8674
12675bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB5_4_NV                       0x8675
12685bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB6_4_NV                       0x8676
12695bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB7_4_NV                       0x8677
12705bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB8_4_NV                       0x8678
12715bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB9_4_NV                       0x8679
12725bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB10_4_NV                      0x867A
12735bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB11_4_NV                      0x867B
12745bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB12_4_NV                      0x867C
12755bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB13_4_NV                      0x867D
12765bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB14_4_NV                      0x867E
12775bd8deadSopenharmony_ci        MAP2_VERTEX_ATTRIB15_4_NV                      0x867F
12785bd8deadSopenharmony_ci
12795bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
12805bd8deadSopenharmony_ci
12815bd8deadSopenharmony_ci --  Section 2.10 "Coordinate Transformations"
12825bd8deadSopenharmony_ci
12835bd8deadSopenharmony_ci    Add this initial discussion:
12845bd8deadSopenharmony_ci
12855bd8deadSopenharmony_ci    "Per-vertex parameters are transformed before the transformation
12865bd8deadSopenharmony_ci    results are used to generate primitives for rasterization, establish
12875bd8deadSopenharmony_ci    a raster position, or generate vertices for selection or feedback.
12885bd8deadSopenharmony_ci
12895bd8deadSopenharmony_ci    Each vertex's per-vertex parameters are transformed by one of
12905bd8deadSopenharmony_ci    two vertex transformation modes.  The first vertex transformation mode
12915bd8deadSopenharmony_ci    is GL's conventional vertex transformation model.  The second mode,
12925bd8deadSopenharmony_ci    known as 'vertex program' mode, transforms the vertex's per-vertex
12935bd8deadSopenharmony_ci    parameters by an application-supplied vertex program.
12945bd8deadSopenharmony_ci
12955bd8deadSopenharmony_ci    Vertex program mode is enabled and disabled, respectively, by
12965bd8deadSopenharmony_ci
12975bd8deadSopenharmony_ci      void Enable(enum target);
12985bd8deadSopenharmony_ci
12995bd8deadSopenharmony_ci    and
13005bd8deadSopenharmony_ci
13015bd8deadSopenharmony_ci      void Disable(enum target);
13025bd8deadSopenharmony_ci
13035bd8deadSopenharmony_ci    with target equal to VERTEX_PROGRAM_NV.  When vertex program mode
13045bd8deadSopenharmony_ci    is enabled, vertices are transformed by the currently bound vertex
13055bd8deadSopenharmony_ci    program as discussed in section 2.14."
13065bd8deadSopenharmony_ci
13075bd8deadSopenharmony_ci    Update the original initial paragraph in the section to read:
13085bd8deadSopenharmony_ci
13095bd8deadSopenharmony_ci    "When vertex program mode is disabled, vertices, normals, and texture
13105bd8deadSopenharmony_ci    coordinates are transformed before their coordinates are used to
13115bd8deadSopenharmony_ci    produce an image in the framebuffer.  We begin with a description
13125bd8deadSopenharmony_ci    of how vertex coordinates are transformed and how the transformation
13135bd8deadSopenharmony_ci    is controlled in the case when vertex program mode is disabled.  The
13145bd8deadSopenharmony_ci    discussion that continues through section 2.13 applies when vertex
13155bd8deadSopenharmony_ci    program mode is disabled."
13165bd8deadSopenharmony_ci
13175bd8deadSopenharmony_ci --  Section 2.10.2 "Matrices"
13185bd8deadSopenharmony_ci
13195bd8deadSopenharmony_ci    Change the first paragraph to read:
13205bd8deadSopenharmony_ci
13215bd8deadSopenharmony_ci    "The projection matrix and model-view matrix are set and modified
13225bd8deadSopenharmony_ci    with a variety of commands.  The affected matrix is determined by
13235bd8deadSopenharmony_ci    the current matrix mode.  The current matrix mode is set with
13245bd8deadSopenharmony_ci
13255bd8deadSopenharmony_ci      void MatrixMode(enum mode);
13265bd8deadSopenharmony_ci
13275bd8deadSopenharmony_ci    which takes one of the pre-defined constants TEXTURE, MODELVIEW,
13285bd8deadSopenharmony_ci    COLOR, PROJECTION, or MATRIXi_NV as the argument.  In the case
13295bd8deadSopenharmony_ci    of MATRIXi_NV, i is an integer between 0 and n-1 indicating one
13305bd8deadSopenharmony_ci    of n tracking matrices where n is the value of the implementation
13315bd8deadSopenharmony_ci    defined constant MAX_TRACK_MATRICES_NV.  TEXTURE is described
13325bd8deadSopenharmony_ci    later in section 2.10.2, and COLOR is described in section 3.6.3.
13335bd8deadSopenharmony_ci    The tracking matrices of the form MATRIXi_NV are described in
13345bd8deadSopenharmony_ci    section 2.14.5.  If the current matrix mode is MODELVIEW, then
13355bd8deadSopenharmony_ci    matrix operations apply to the model-view matrix; if PROJECTION,
13365bd8deadSopenharmony_ci    then they apply to the projection matrix."
13375bd8deadSopenharmony_ci
13385bd8deadSopenharmony_ci    Change the last paragraph to read:
13395bd8deadSopenharmony_ci
13405bd8deadSopenharmony_ci    "The state required to implement transformations consists of a n-value
13415bd8deadSopenharmony_ci    integer indicating the current matrix mode (where n is 4 + the number
13425bd8deadSopenharmony_ci    of tracking matrices supported), a stack of at least two 4x4 matrices
13435bd8deadSopenharmony_ci    for each of COLOR, PROJECTION, and TEXTURE with associated stack
13445bd8deadSopenharmony_ci    pointers, n stacks (where n is at least 8) of at least one 4x4 matrix
13455bd8deadSopenharmony_ci    for each MATRIXi_NV with associated stack pointers, and a stack of at
13465bd8deadSopenharmony_ci    least 32 4x4 matrices with an associated stack pointer for MODELVIEW.
13475bd8deadSopenharmony_ci    Initially, there is only one matrix on each stack, and all matrices
13485bd8deadSopenharmony_ci    are set to the identity.  The initial matrix mode is MODELVIEW."
13495bd8deadSopenharmony_ci
13505bd8deadSopenharmony_ci --  NEW Section 2.14 "Vertex Programs"
13515bd8deadSopenharmony_ci
13525bd8deadSopenharmony_ci    "The conventional GL vertex transformation model described
13535bd8deadSopenharmony_ci    in sections 2.10 through 2.13 is a configurable but essentially
13545bd8deadSopenharmony_ci    hard-wired sequence of per-vertex computations based on a canonical
13555bd8deadSopenharmony_ci    set of per-vertex parameters and vertex transformation related
13565bd8deadSopenharmony_ci    state such as transformation matrices, lighting parameters, and
13575bd8deadSopenharmony_ci    texture coordinate generation parameters.
13585bd8deadSopenharmony_ci
13595bd8deadSopenharmony_ci    The general success and utility of the conventional GL vertex
13605bd8deadSopenharmony_ci    transformation model reflects its basic correspondence to the
13615bd8deadSopenharmony_ci    typical vertex transformation requirements of 3D applications.
13625bd8deadSopenharmony_ci
13635bd8deadSopenharmony_ci    However when the conventional GL vertex transformation model
13645bd8deadSopenharmony_ci    is not sufficient, the vertex program mode provides a substantially
13655bd8deadSopenharmony_ci    more flexible model for vertex transformation.  The vertex program
13665bd8deadSopenharmony_ci    mode permits applications to define their own vertex programs.
13675bd8deadSopenharmony_ci
13685bd8deadSopenharmony_ci    2.14.1  The Vertex Program Execution Model
13695bd8deadSopenharmony_ci
13705bd8deadSopenharmony_ci    A vertex program is a sequence of floating-point 4-component vector
13715bd8deadSopenharmony_ci    operations that operate on per-vertex attributes and program
13725bd8deadSopenharmony_ci    parameters.  Vertex programs execute on a per-vertex basis and
13735bd8deadSopenharmony_ci    operate on each vertex completely independently from the processing
13745bd8deadSopenharmony_ci    of other vertices.  Vertex programs execute a finite fixed sequence
13755bd8deadSopenharmony_ci    of instructions with no branching or looping.  Vertex programs
13765bd8deadSopenharmony_ci    execute without data hazards so results computed in one operation can
13775bd8deadSopenharmony_ci    be used immediately afterwards.  The result of a vertex program is
13785bd8deadSopenharmony_ci    a set of vertex result vectors that becomes the transformed vertex
13795bd8deadSopenharmony_ci    parameters used by primitive assembly.
13805bd8deadSopenharmony_ci
13815bd8deadSopenharmony_ci    Vertex programs use a specific well-defined instruction set, register
13825bd8deadSopenharmony_ci    set, and operational model defined in the following sections.
13835bd8deadSopenharmony_ci
13845bd8deadSopenharmony_ci    The vertex program register set consists of five types of registers
13855bd8deadSopenharmony_ci    described in the following five sections.
13865bd8deadSopenharmony_ci
13875bd8deadSopenharmony_ci    2.14.1.1  The Vertex Attribute Registers
13885bd8deadSopenharmony_ci
13895bd8deadSopenharmony_ci    The Vertex Attribute Registers are sixteen 4-component
13905bd8deadSopenharmony_ci    vector floating-point registers containing the current vertex's
13915bd8deadSopenharmony_ci    per-vertex attributes.  These registers are numbered 0 through 15.
13925bd8deadSopenharmony_ci    These registers are private to each vertex program invocation and are
13935bd8deadSopenharmony_ci    initialized at each vertex program invocation by the current vertex
13945bd8deadSopenharmony_ci    attribute state specified with VertexAttribNV commands.  These registers
13955bd8deadSopenharmony_ci    are read-only during vertex program execution.  The VertexAttribNV
13965bd8deadSopenharmony_ci    commands used to update the vertex attribute registers can be issued
13975bd8deadSopenharmony_ci    both outside and inside of Begin/End pairs.  Vertex program execution
13985bd8deadSopenharmony_ci    is provoked by updating vertex attribute zero.  Updating vertex
13995bd8deadSopenharmony_ci    attribute zero outside of a Begin/End pair is ignored without
14005bd8deadSopenharmony_ci    generating any error (identical to the Vertex command operation).
14015bd8deadSopenharmony_ci
14025bd8deadSopenharmony_ci    The commands
14035bd8deadSopenharmony_ci
14045bd8deadSopenharmony_ci      void VertexAttrib{1234}{sfd}NV(uint index, T coords);
14055bd8deadSopenharmony_ci      void VertexAttrib{1234}{sfd}vNV(uint index, T coords);
14065bd8deadSopenharmony_ci      void VertexAttrib4ubNV(uint index, T coords);
14075bd8deadSopenharmony_ci      void VertexAttrib4ubvNV(uint index, T coords);
14085bd8deadSopenharmony_ci
14095bd8deadSopenharmony_ci    specify the particular current vertex attribute indicated by index.
14105bd8deadSopenharmony_ci    The coordinates for each vertex attribute are named x, y, z, and w.
14115bd8deadSopenharmony_ci    The VertexAttrib1NV family of commands sets the x coordinate to the
14125bd8deadSopenharmony_ci    provided single argument while setting y and z to 0 and w to 1.
14135bd8deadSopenharmony_ci    Similarly, VertexAttrib2NV sets x and y to the specified values,
14145bd8deadSopenharmony_ci    z to 0 and w to 1; VertexAttrib3NV sets x, y, and z, with w set
14155bd8deadSopenharmony_ci    to 1, and VertexAttrib4NV sets all four coordinates.  The error
14165bd8deadSopenharmony_ci    INVALID_VALUE is generated if index is greater than 15.
14175bd8deadSopenharmony_ci
14185bd8deadSopenharmony_ci    No conversions are applied to the vertex attributes specified as
14195bd8deadSopenharmony_ci    type short, float, or double.  However, vertex attributes specified
14205bd8deadSopenharmony_ci    as type ubyte are converted as described by Table 2.6.
14215bd8deadSopenharmony_ci
14225bd8deadSopenharmony_ci    The commands
14235bd8deadSopenharmony_ci
14245bd8deadSopenharmony_ci      void VertexAttribs{1234}{sfd}vNV(uint index, sizei n, T coords[]);
14255bd8deadSopenharmony_ci      void VertexAttribs4ubvNV(uint index, sizei n, GLubyte coords[]);
14265bd8deadSopenharmony_ci
14275bd8deadSopenharmony_ci    specify a contiguous set of n vertex attributes.  The effect of
14285bd8deadSopenharmony_ci
14295bd8deadSopenharmony_ci      VertexAttribs{1234}{sfd}vNV(index, n, coords)
14305bd8deadSopenharmony_ci
14315bd8deadSopenharmony_ci    is the same (assuming no errors) as the command sequence
14325bd8deadSopenharmony_ci
14335bd8deadSopenharmony_ci      #define NUM k  /* where k is 1, 2, 3, or 4 components */
14345bd8deadSopenharmony_ci      int i;
14355bd8deadSopenharmony_ci      for (i=n-1; i>=0; i--) {
14365bd8deadSopenharmony_ci        VertexAttrib{NUM}{sfd}vNV(i+index, &coords[i*NUM]);
14375bd8deadSopenharmony_ci      }
14385bd8deadSopenharmony_ci
14395bd8deadSopenharmony_ci    VertexAttribs4ubvNV behaves similarly.
14405bd8deadSopenharmony_ci
14415bd8deadSopenharmony_ci    The VertexAttribNV calls equivalent to VertexAttribsNV are issued in
14425bd8deadSopenharmony_ci    reverse order so that vertex program execution is provoked when index
14435bd8deadSopenharmony_ci    is zero only after all the other vertex attributes have first been
14445bd8deadSopenharmony_ci    specified.
14455bd8deadSopenharmony_ci
14465bd8deadSopenharmony_ci    2.14.1.2  The Program Parameter Registers
14475bd8deadSopenharmony_ci
14485bd8deadSopenharmony_ci    The Program Parameter Registers are ninety-six 4-component
14495bd8deadSopenharmony_ci    floating-point vector registers containing the vertex program
14505bd8deadSopenharmony_ci    parameters.  These registers are numbered 0 through 95.  This
14515bd8deadSopenharmony_ci    relatively large set of registers is intended to hold parameters
14525bd8deadSopenharmony_ci    such as matrices, lighting parameters, and constants required by
14535bd8deadSopenharmony_ci    vertex programs.  Vertex program parameter registers can be updated
14545bd8deadSopenharmony_ci    in one of two ways:  by the ProgramParameterNV commands outside
14555bd8deadSopenharmony_ci    of a Begin/End pair or by a vertex state program executed outside
14565bd8deadSopenharmony_ci    of a Begin/End pair (vertex state programs are discussed in section
14575bd8deadSopenharmony_ci    2.14.3).
14585bd8deadSopenharmony_ci
14595bd8deadSopenharmony_ci    The commands
14605bd8deadSopenharmony_ci     
14615bd8deadSopenharmony_ci      void ProgramParameter4fNV(enum target, uint index,
14625bd8deadSopenharmony_ci                                float x, float y, float z, float w)
14635bd8deadSopenharmony_ci      void ProgramParameter4dNV(enum target, uint index,
14645bd8deadSopenharmony_ci                                double x, double y, double z, double w)
14655bd8deadSopenharmony_ci
14665bd8deadSopenharmony_ci    specify the particular program parameter indicated by index.
14675bd8deadSopenharmony_ci    The coordinates values x, y, z, and w are assigned to the respective
14685bd8deadSopenharmony_ci    components of the particular program parameter.  target must be
14695bd8deadSopenharmony_ci    VERTEX_PROGRAM_NV.
14705bd8deadSopenharmony_ci
14715bd8deadSopenharmony_ci    The commands
14725bd8deadSopenharmony_ci
14735bd8deadSopenharmony_ci      void ProgramParameter4dvNV(enum target, uint index, double *params);
14745bd8deadSopenharmony_ci      void ProgramParameter4fvNV(enum target, uint index, float *params);
14755bd8deadSopenharmony_ci
14765bd8deadSopenharmony_ci    operate identically to ProgramParameter4fNV and ProgramParameter4dNV
14775bd8deadSopenharmony_ci    respectively except that the program parameters are passed as an
14785bd8deadSopenharmony_ci    array of four components.
14795bd8deadSopenharmony_ci
14805bd8deadSopenharmony_ci    The commands
14815bd8deadSopenharmony_ci
14825bd8deadSopenharmony_ci      void ProgramParameters4dvNV(enum target, uint index,
14835bd8deadSopenharmony_ci                                  uint num, double *params);
14845bd8deadSopenharmony_ci      void ProgramParameters4fvNV(enum target, uint index,
14855bd8deadSopenharmony_ci                                  uint num, float *params);
14865bd8deadSopenharmony_ci
14875bd8deadSopenharmony_ci    specify a contiguous set of num program parameters.  target must
14885bd8deadSopenharmony_ci    be VERTEX_PROGRAM_NV.  The effect is the same (assuming no errors) as
14895bd8deadSopenharmony_ci
14905bd8deadSopenharmony_ci      for (i=index; i<index+num; i++) {
14915bd8deadSopenharmony_ci        ProgramParameter4{fd}vNV(target, i, &params[i*4]);
14925bd8deadSopenharmony_ci      }
14935bd8deadSopenharmony_ci
14945bd8deadSopenharmony_ci    The program parameter registers are shared to all vertex program
14955bd8deadSopenharmony_ci    invocations within a rendering context.  ProgramParameterNV command
14965bd8deadSopenharmony_ci    updates and vertex state program executions are serialized with
14975bd8deadSopenharmony_ci    respect to vertex program invocations and other vertex state program
14985bd8deadSopenharmony_ci    executions.
14995bd8deadSopenharmony_ci
15005bd8deadSopenharmony_ci    Writes to the program parameter registers during vertex state program
15015bd8deadSopenharmony_ci    execution can be maskable on a per-component basis.
15025bd8deadSopenharmony_ci
15035bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if any ProgramParameterNV has
15045bd8deadSopenharmony_ci    an index is greater than 95.
15055bd8deadSopenharmony_ci
15065bd8deadSopenharmony_ci    The initial value of all ninety-six program parameter registers is
15075bd8deadSopenharmony_ci    (0,0,0,0).
15085bd8deadSopenharmony_ci
15095bd8deadSopenharmony_ci    2.14.1.3  The Address Register
15105bd8deadSopenharmony_ci
15115bd8deadSopenharmony_ci    The Address Register is a single 4-component vector signed 32-bit
15125bd8deadSopenharmony_ci    integer register though only the x component of the vector is
15135bd8deadSopenharmony_ci    accessible.  The register is private to each vertex program invocation
15145bd8deadSopenharmony_ci    and is initialized to (0,0,0,0) at every vertex program invocation.
15155bd8deadSopenharmony_ci    This register can be written during vertex program execution (but
15165bd8deadSopenharmony_ci    not read) and its value can be used for as a relative offset for
15175bd8deadSopenharmony_ci    reading vertex program parameter registers.  Only the vertex program
15185bd8deadSopenharmony_ci    parameter registers can be read using relative addressing (writes
15195bd8deadSopenharmony_ci    using relative addressing are not supported).
15205bd8deadSopenharmony_ci
15215bd8deadSopenharmony_ci    See the discussion of relative addressing of program parameters
15225bd8deadSopenharmony_ci    in section 2.14.1.9 and the discussion of the ARL instruction in
15235bd8deadSopenharmony_ci    section 2.14.1.10.1.
15245bd8deadSopenharmony_ci
15255bd8deadSopenharmony_ci    2.14.1.4  The Temporary Registers
15265bd8deadSopenharmony_ci
15275bd8deadSopenharmony_ci    The Temporary Registers are twelve 4-component floating-point vector
15285bd8deadSopenharmony_ci    registers used to hold temporary results during vertex program
15295bd8deadSopenharmony_ci    execution.  These registers are numbered 0 through 11.  These
15305bd8deadSopenharmony_ci    registers are private to each vertex program invocation and
15315bd8deadSopenharmony_ci    initialized to (0,0,0,0) at every vertex program invocation.  These
15325bd8deadSopenharmony_ci    registers can be read and written during vertex program execution.
15335bd8deadSopenharmony_ci    Writes to these registers can be maskable on a per-component basis.
15345bd8deadSopenharmony_ci
15355bd8deadSopenharmony_ci    2.14.1.5  The Vertex Result Register Set
15365bd8deadSopenharmony_ci
15375bd8deadSopenharmony_ci    The Vertex Result Registers are fifteen 4-component floating-point
15385bd8deadSopenharmony_ci    vector registers used to write the results of a vertex program.
15395bd8deadSopenharmony_ci    Each register value is initialized to (0,0,0,1) at the invocation
15405bd8deadSopenharmony_ci    of each vertex program.  Writes to the vertex result registers can
15415bd8deadSopenharmony_ci    be maskable on a per-component basis.  These registers are named in
15425bd8deadSopenharmony_ci    Table X.1 and further discussed below.
15435bd8deadSopenharmony_ci
15445bd8deadSopenharmony_ci
15455bd8deadSopenharmony_ciVertex Result                                      Component
15465bd8deadSopenharmony_ciRegister Name   Description                        Interpretation
15475bd8deadSopenharmony_ci--------------  ---------------------------------  --------------
15485bd8deadSopenharmony_ci HPOS            Homogeneous clip space position    (x,y,z,w)
15495bd8deadSopenharmony_ci COL0            Primary color (front-facing)       (r,g,b,a)
15505bd8deadSopenharmony_ci COL1            Secondary color (front-facing)     (r,g,b,a)
15515bd8deadSopenharmony_ci BFC0            Back-facing primary color          (r,g,b,a)
15525bd8deadSopenharmony_ci BFC1            Back-facing secondary color        (r,g,b,a)
15535bd8deadSopenharmony_ci FOGC            Fog coordinate                     (f,*,*,*)
15545bd8deadSopenharmony_ci PSIZ            Point size                         (p,*,*,*)
15555bd8deadSopenharmony_ci TEX0            Texture coordinate set 0           (s,t,r,q)
15565bd8deadSopenharmony_ci TEX1            Texture coordinate set 1           (s,t,r,q)
15575bd8deadSopenharmony_ci TEX2            Texture coordinate set 2           (s,t,r,q)
15585bd8deadSopenharmony_ci TEX3            Texture coordinate set 3           (s,t,r,q)
15595bd8deadSopenharmony_ci TEX4            Texture coordinate set 4           (s,t,r,q)
15605bd8deadSopenharmony_ci TEX5            Texture coordinate set 5           (s,t,r,q)
15615bd8deadSopenharmony_ci TEX6            Texture coordinate set 6           (s,t,r,q)
15625bd8deadSopenharmony_ci TEX7            Texture coordinate set 7           (s,t,r,q)
15635bd8deadSopenharmony_ci
15645bd8deadSopenharmony_ci    Table X.1:  Vertex Result Registers.
15655bd8deadSopenharmony_ci
15665bd8deadSopenharmony_ci    HPOS is the transformed vertex's homogeneous clip space position.
15675bd8deadSopenharmony_ci    The vertex's homogeneous clip space position is converted to
15685bd8deadSopenharmony_ci    normalized device coordinates and transformed to window coordinates
15695bd8deadSopenharmony_ci    as described at the end of section 2.10 and in section 2.11.
15705bd8deadSopenharmony_ci    Further processing (subsequent to vertex program termination)
15715bd8deadSopenharmony_ci    is responsible for clipping primitives assembled from vertex
15725bd8deadSopenharmony_ci    program-generated vertices as described in section 2.10 but all
15735bd8deadSopenharmony_ci    client-defined clip planes are treated as if they are disabled when
15745bd8deadSopenharmony_ci    vertex program mode is enabled.
15755bd8deadSopenharmony_ci
15765bd8deadSopenharmony_ci    Four distinct color results can be generated for each vertex.
15775bd8deadSopenharmony_ci    COL0 is the transformed vertex's front-facing primary color.
15785bd8deadSopenharmony_ci    COL1 is the transformed vertex's front-facing secondary color.
15795bd8deadSopenharmony_ci    BFC0 is the transformed vertex's back-facing primary color.  BFC1 is
15805bd8deadSopenharmony_ci    the transformed vertex's back-facing secondary color.
15815bd8deadSopenharmony_ci
15825bd8deadSopenharmony_ci    Primitive coloring may operate in two-sided color mode.  This behavior
15835bd8deadSopenharmony_ci    is enabled and disabled by calling Enable or Disable with the
15845bd8deadSopenharmony_ci    symbolic value VERTEX_PROGRAM_TWO_SIDE_NV.  The selection between
15855bd8deadSopenharmony_ci    the back-facing colors and the front-facing colors depends on the
15865bd8deadSopenharmony_ci    primitive of which the vertex is a part.  If the primitive is a
15875bd8deadSopenharmony_ci    point or a line segment, the front-facing colors are always selected.
15885bd8deadSopenharmony_ci    If the primitive is a polygon and two-sided color mode is disabled,
15895bd8deadSopenharmony_ci    the front-facing colors are selected.  If it is a polygon and
15905bd8deadSopenharmony_ci    two-sided color mode is enabled, then the selection is based on the
15915bd8deadSopenharmony_ci    sign of the (clipped or unclipped) polygon's signed area computed in
15925bd8deadSopenharmony_ci    window coordinates.  This facingness determination is identical to
15935bd8deadSopenharmony_ci    the two-sided lighting facingness determination described in section
15945bd8deadSopenharmony_ci    2.13.1.
15955bd8deadSopenharmony_ci
15965bd8deadSopenharmony_ci    The selected primary and secondary colors for each primitive are
15975bd8deadSopenharmony_ci    clamped to the range [0,1] and then interpolated across the assembled
15985bd8deadSopenharmony_ci    primitive during rasterization with at least 8-bit accuracy for each
15995bd8deadSopenharmony_ci    color component.
16005bd8deadSopenharmony_ci
16015bd8deadSopenharmony_ci    FOGC is the transformed vertex's fog coordinate.  The register's
16025bd8deadSopenharmony_ci    first floating-point component is interpolated across the assembled
16035bd8deadSopenharmony_ci    primitive during rasterization and used as the fog distance to
16045bd8deadSopenharmony_ci    compute per-fragment the fog factor when fog is enabled.  However,
16055bd8deadSopenharmony_ci    if both fog and vertex program mode are enabled, but the FOGC vertex
16065bd8deadSopenharmony_ci    result register is not written, the fog factor is overridden to 1.0.
16075bd8deadSopenharmony_ci    The register's other three components are ignored.
16085bd8deadSopenharmony_ci
16095bd8deadSopenharmony_ci    Point size determination may operate in program-specified point
16105bd8deadSopenharmony_ci    size mode.  This behavior is enabled and disabled by calling Enable
16115bd8deadSopenharmony_ci    or Disable with the symbolic value VERTEX_PROGRAM_POINT_SIZE_NV.
16125bd8deadSopenharmony_ci    If the vertex is for a point primitive and the mode is enabled
16135bd8deadSopenharmony_ci    and the PSIZ vertex result is written, the point primitive's size
16145bd8deadSopenharmony_ci    is determined by the clamped x component of the PSIZ register.
16155bd8deadSopenharmony_ci    Otherwise (because vertex program mode is disabled, program-specified
16165bd8deadSopenharmony_ci    point size mode is disabled, or because the vertex program did not
16175bd8deadSopenharmony_ci    write PSIZ), the point primitive's size is determined by the point
16185bd8deadSopenharmony_ci    size state (the state specified using the PointSize command).
16195bd8deadSopenharmony_ci
16205bd8deadSopenharmony_ci    The PSIZ register's x component is clamped to the range zero through
16215bd8deadSopenharmony_ci    either the hi value of ALIASED_POINT_SIZE_RANGE if point smoothing
16225bd8deadSopenharmony_ci    is disabled or the hi value of the SMOOTH_POINT_SIZE_RANGE if
16235bd8deadSopenharmony_ci    point smoothing is enabled.  The register's other three components
16245bd8deadSopenharmony_ci    are ignored.
16255bd8deadSopenharmony_ci
16265bd8deadSopenharmony_ci    If the vertex is not for a point primitive, the value of the
16275bd8deadSopenharmony_ci    PSIZ vertex result register is ignored.
16285bd8deadSopenharmony_ci
16295bd8deadSopenharmony_ci    TEX0 through TEX7 are the transformed vertex's texture coordinate
16305bd8deadSopenharmony_ci    sets for texture units 0 through 7.  These floating-point coordinates
16315bd8deadSopenharmony_ci    are interpolated across the assembled primitive during rasterization
16325bd8deadSopenharmony_ci    and used for accessing textures.  If the number of texture units
16335bd8deadSopenharmony_ci    supported is less than eight, the values of vertex result registers
16345bd8deadSopenharmony_ci    that do not correspond to existent texture units are ignored.
16355bd8deadSopenharmony_ci
16365bd8deadSopenharmony_ci    2.14.1.6  Semantic Meaning for Vertex Attributes and Program Parameters
16375bd8deadSopenharmony_ci
16385bd8deadSopenharmony_ci    One important distinction between the conventional GL vertex
16395bd8deadSopenharmony_ci    transformation mode and the vertex program mode is that per-vertex
16405bd8deadSopenharmony_ci    parameters and other state parameters in vertex program mode do
16415bd8deadSopenharmony_ci    not have dedicated semantic interpretations the way that they do
16425bd8deadSopenharmony_ci    with the conventional GL vertex transformation mode.
16435bd8deadSopenharmony_ci
16445bd8deadSopenharmony_ci    For example, in the conventional GL vertex transformation mode,
16455bd8deadSopenharmony_ci    the Normal command specifies a per-vertex normal.  The semantic that
16465bd8deadSopenharmony_ci    the Normal command supplies a normal for lighting is established because
16475bd8deadSopenharmony_ci    that is how the per-vertex attribute supplied by the Normal command
16485bd8deadSopenharmony_ci    is used by the conventional GL vertex transformation mode.
16495bd8deadSopenharmony_ci    Similarly, other state parameters such as a light source position have
16505bd8deadSopenharmony_ci    semantic interpretations based on how the conventional GL vertex
16515bd8deadSopenharmony_ci    transformation model uses each particular parameter.
16525bd8deadSopenharmony_ci
16535bd8deadSopenharmony_ci    In contrast, vertex attributes and program parameters for vertex
16545bd8deadSopenharmony_ci    programs have no pre-defined semantic meanings.  The meaning of
16555bd8deadSopenharmony_ci    a vertex attribute or program parameter in vertex program mode is
16565bd8deadSopenharmony_ci    defined by how the vertex attribute or program parameter is used by
16575bd8deadSopenharmony_ci    the current vertex program to compute and write values to the Vertex
16585bd8deadSopenharmony_ci    Result Registers.  This is the reason that per-vertex attributes and
16595bd8deadSopenharmony_ci    program parameters for vertex programs are numbered instead of named.
16605bd8deadSopenharmony_ci
16615bd8deadSopenharmony_ci    For convenience however, the existing per-vertex parameters for the
16625bd8deadSopenharmony_ci    conventional GL vertex transformation mode (vertices, normals,
16635bd8deadSopenharmony_ci    colors, fog coordinates, vertex weights, and texture coordinates) are
16645bd8deadSopenharmony_ci    aliased to numbered vertex attributes.  This aliasing is specified in
16655bd8deadSopenharmony_ci    Table X.2.  The table includes how the various conventional components
16665bd8deadSopenharmony_ci    map to the 4-component vertex attribute components.
16675bd8deadSopenharmony_ci
16685bd8deadSopenharmony_ciVertex
16695bd8deadSopenharmony_ciAttribute  Conventional                                           Conventional
16705bd8deadSopenharmony_ciRegister   Per-vertex        Conventional                         Component
16715bd8deadSopenharmony_ciNumber     Parameter         Per-vertex Parameter Command         Mapping
16725bd8deadSopenharmony_ci---------  ---------------   -----------------------------------  ------------
16735bd8deadSopenharmony_ci 0         vertex position   Vertex                               x,y,z,w
16745bd8deadSopenharmony_ci 1         vertex weights    VertexWeightEXT                      w,0,0,1
16755bd8deadSopenharmony_ci 2         normal            Normal                               x,y,z,1
16765bd8deadSopenharmony_ci 3         primary color     Color                                r,g,b,a
16775bd8deadSopenharmony_ci 4         secondary color   SecondaryColorEXT                    r,g,b,1
16785bd8deadSopenharmony_ci 5         fog coordinate    FogCoordEXT                          fc,0,0,1
16795bd8deadSopenharmony_ci 6         -                 -                                    -
16805bd8deadSopenharmony_ci 7         -                 -                                    -
16815bd8deadSopenharmony_ci 8         texture coord 0   MultiTexCoord(GL_TEXTURE0_ARB, ...)  s,t,r,q
16825bd8deadSopenharmony_ci 9         texture coord 1   MultiTexCoord(GL_TEXTURE1_ARB, ...)  s,t,r,q
16835bd8deadSopenharmony_ci 10        texture coord 2   MultiTexCoord(GL_TEXTURE2_ARB, ...)  s,t,r,q
16845bd8deadSopenharmony_ci 11        texture coord 3   MultiTexCoord(GL_TEXTURE3_ARB, ...)  s,t,r,q
16855bd8deadSopenharmony_ci 12        texture coord 4   MultiTexCoord(GL_TEXTURE4_ARB, ...)  s,t,r,q
16865bd8deadSopenharmony_ci 13        texture coord 5   MultiTexCoord(GL_TEXTURE5_ARB, ...)  s,t,r,q
16875bd8deadSopenharmony_ci 14        texture coord 6   MultiTexCoord(GL_TEXTURE6_ARB, ...)  s,t,r,q
16885bd8deadSopenharmony_ci 15        texture coord 7   MultiTexCoord(GL_TEXTURE7_ARB, ...)  s,t,r,q
16895bd8deadSopenharmony_ci
16905bd8deadSopenharmony_ciTable X.2:  Aliasing of vertex attributes with conventional per-vertex
16915bd8deadSopenharmony_ciparameters.
16925bd8deadSopenharmony_ci
16935bd8deadSopenharmony_ci    Only vertex attribute zero is treated specially because it is
16945bd8deadSopenharmony_ci    the attribute that provokes the execution of the vertex program;
16955bd8deadSopenharmony_ci    this is the attribute that aliases to the Vertex command's vertex
16965bd8deadSopenharmony_ci    coordinates.
16975bd8deadSopenharmony_ci
16985bd8deadSopenharmony_ci    The result of a vertex program is the set of post-transformation
16995bd8deadSopenharmony_ci    vertex parameters written to the Vertex Result Registers.
17005bd8deadSopenharmony_ci    All vertex programs must write a homogeneous clip space position, but
17015bd8deadSopenharmony_ci    the other Vertex Result Registers can be optionally written.
17025bd8deadSopenharmony_ci
17035bd8deadSopenharmony_ci    Clipping and culling are not the responsibility of vertex programs
17045bd8deadSopenharmony_ci    because these operations assume the assembly of multiple vertices
17055bd8deadSopenharmony_ci    into a primitive.  View frustum clipping is performed subsequent to
17065bd8deadSopenharmony_ci    vertex program execution.  Clip planes are not supported in vertex
17075bd8deadSopenharmony_ci    program mode.
17085bd8deadSopenharmony_ci
17095bd8deadSopenharmony_ci    2.14.1.7  Vertex Program Specification
17105bd8deadSopenharmony_ci
17115bd8deadSopenharmony_ci    Vertex programs are specified as an array of ubytes.  The array is
17125bd8deadSopenharmony_ci    a string of ASCII characters encoding the program.
17135bd8deadSopenharmony_ci
17145bd8deadSopenharmony_ci    The command
17155bd8deadSopenharmony_ci
17165bd8deadSopenharmony_ci      LoadProgramNV(enum target, uint id, sizei len,
17175bd8deadSopenharmony_ci                    const ubyte *program);
17185bd8deadSopenharmony_ci
17195bd8deadSopenharmony_ci    loads a vertex program when the target parameter is VERTEX_PROGRAM_NV.
17205bd8deadSopenharmony_ci    Multiple programs can be loaded with different names.  id names the
17215bd8deadSopenharmony_ci    program to load.  The name space for programs is the positive integers
17225bd8deadSopenharmony_ci    (zero is reserved).  The error INVALID_VALUE occurs if a program is
17235bd8deadSopenharmony_ci    loaded with an id of zero.  The error INVALID_OPERATION is generated
17245bd8deadSopenharmony_ci    if a program is loaded for an id that is currently loaded with a
17255bd8deadSopenharmony_ci    program of a different program target.  Managing the program name
17265bd8deadSopenharmony_ci    space and binding to vertex programs is discussed later in section
17275bd8deadSopenharmony_ci    2.14.1.8.
17285bd8deadSopenharmony_ci
17295bd8deadSopenharmony_ci    program is a pointer to an array of ubytes that represents the
17305bd8deadSopenharmony_ci    program being loaded.  The length of the array is indicated by len.
17315bd8deadSopenharmony_ci
17325bd8deadSopenharmony_ci    A second program target type known as vertex state programs is
17335bd8deadSopenharmony_ci    discussed in 2.14.4.
17345bd8deadSopenharmony_ci
17355bd8deadSopenharmony_ci    At program load time, the program is parsed into a set of tokens
17365bd8deadSopenharmony_ci    possibly separated by white space.  Spaces, tabs, newlines, carriage
17375bd8deadSopenharmony_ci    returns, and comments are considered whitespace.  Comments begin with
17385bd8deadSopenharmony_ci    the character "#" and are terminated by a newline, a carriage return,
17395bd8deadSopenharmony_ci    or the end of the program array.
17405bd8deadSopenharmony_ci
17415bd8deadSopenharmony_ci    The Backus-Naur Form (BNF) grammar below specifies the syntactically
17425bd8deadSopenharmony_ci    valid sequences for vertex programs.  The set of valid tokens can be
17435bd8deadSopenharmony_ci    inferred from the grammar.  The token "" represents an empty string
17445bd8deadSopenharmony_ci    and is used to indicate optional rules.  A program is invalid if it
17455bd8deadSopenharmony_ci    contains any undefined tokens or characters.
17465bd8deadSopenharmony_ci
17475bd8deadSopenharmony_ci    <program>              ::= "!!VP1.0" <instructionSequence> "END"
17485bd8deadSopenharmony_ci
17495bd8deadSopenharmony_ci    <instructionSequence>  ::= <instructionSequence> <instructionLine>
17505bd8deadSopenharmony_ci                             | <instructionLine>
17515bd8deadSopenharmony_ci
17525bd8deadSopenharmony_ci    <instructionLine>      ::= <instruction> ";"
17535bd8deadSopenharmony_ci
17545bd8deadSopenharmony_ci    <instruction>          ::= <ARL-instruction>
17555bd8deadSopenharmony_ci                             | <VECTORop-instruction>
17565bd8deadSopenharmony_ci                             | <SCALARop-instruction>
17575bd8deadSopenharmony_ci                             | <BINop-instruction>
17585bd8deadSopenharmony_ci                             | <TRIop-instruction>
17595bd8deadSopenharmony_ci
17605bd8deadSopenharmony_ci    <ARL-instruction>      ::= "ARL" <addrReg> "," <scalarSrcReg>
17615bd8deadSopenharmony_ci
17625bd8deadSopenharmony_ci    <VECTORop-instruction> ::= <VECTORop> <maskedDstReg> "," <swizzleSrcReg>
17635bd8deadSopenharmony_ci
17645bd8deadSopenharmony_ci    <SCALARop-instruction> ::= <SCALARop> <maskedDstReg> "," <scalarSrcReg>
17655bd8deadSopenharmony_ci
17665bd8deadSopenharmony_ci    <BINop-instruction>    ::= <BINop> <maskedDstReg> ","
17675bd8deadSopenharmony_ci                               <swizzleSrcReg> "," <swizzleSrcReg>
17685bd8deadSopenharmony_ci
17695bd8deadSopenharmony_ci    <TRIop-instruction>    ::= <TRIop> <maskedDstReg> ","
17705bd8deadSopenharmony_ci                               <swizzleSrcReg> "," <swizzleSrcReg> ","
17715bd8deadSopenharmony_ci                               <swizzleSrcReg>
17725bd8deadSopenharmony_ci
17735bd8deadSopenharmony_ci    <VECTORop>             ::= "MOV"
17745bd8deadSopenharmony_ci                             | "LIT"
17755bd8deadSopenharmony_ci
17765bd8deadSopenharmony_ci    <SCALARop>             ::= "RCP"
17775bd8deadSopenharmony_ci                             | "RSQ"
17785bd8deadSopenharmony_ci                             | "EXP"
17795bd8deadSopenharmony_ci                             | "LOG"
17805bd8deadSopenharmony_ci
17815bd8deadSopenharmony_ci    <BINop>                ::= "MUL"
17825bd8deadSopenharmony_ci                             | "ADD"
17835bd8deadSopenharmony_ci                             | "DP3"
17845bd8deadSopenharmony_ci                             | "DP4"
17855bd8deadSopenharmony_ci                             | "DST"
17865bd8deadSopenharmony_ci                             | "MIN"
17875bd8deadSopenharmony_ci                             | "MAX"
17885bd8deadSopenharmony_ci                             | "SLT"
17895bd8deadSopenharmony_ci                             | "SGE"
17905bd8deadSopenharmony_ci
17915bd8deadSopenharmony_ci    <TRIop>                ::= "MAD"
17925bd8deadSopenharmony_ci
17935bd8deadSopenharmony_ci    <scalarSrcReg>         ::= <optionalSign> <srcReg> <scalarSuffix>
17945bd8deadSopenharmony_ci
17955bd8deadSopenharmony_ci    <swizzleSrcReg>        ::= <optionalSign> <srcReg> <swizzleSuffix>
17965bd8deadSopenharmony_ci
17975bd8deadSopenharmony_ci    <maskedDstReg>         ::= <dstReg> <optionalMask>
17985bd8deadSopenharmony_ci
17995bd8deadSopenharmony_ci    <optionalMask>         ::= ""
18005bd8deadSopenharmony_ci                             | "." "x"
18015bd8deadSopenharmony_ci                             | "."     "y"
18025bd8deadSopenharmony_ci                             | "." "x" "y"
18035bd8deadSopenharmony_ci                             | "."         "z"
18045bd8deadSopenharmony_ci                             | "." "x"     "z"
18055bd8deadSopenharmony_ci                             | "."     "y" "z"
18065bd8deadSopenharmony_ci                             | "." "x" "y" "z"
18075bd8deadSopenharmony_ci                             | "."             "w"
18085bd8deadSopenharmony_ci                             | "." "x"         "w"
18095bd8deadSopenharmony_ci                             | "."     "y"     "w"
18105bd8deadSopenharmony_ci                             | "." "x" "y"     "w"
18115bd8deadSopenharmony_ci                             | "."         "z" "w"
18125bd8deadSopenharmony_ci                             | "." "x"     "z" "w"
18135bd8deadSopenharmony_ci                             | "."     "y" "z" "w"
18145bd8deadSopenharmony_ci                             | "." "x" "y" "z" "w"
18155bd8deadSopenharmony_ci
18165bd8deadSopenharmony_ci    <optionalSign>         ::= "-"
18175bd8deadSopenharmony_ci                             | ""
18185bd8deadSopenharmony_ci
18195bd8deadSopenharmony_ci    <srcReg>               ::= <vertexAttribReg>
18205bd8deadSopenharmony_ci                             | <progParamReg>
18215bd8deadSopenharmony_ci                             | <temporaryReg>
18225bd8deadSopenharmony_ci
18235bd8deadSopenharmony_ci    <dstReg>               ::= <temporaryReg>
18245bd8deadSopenharmony_ci                             | <vertexResultReg>
18255bd8deadSopenharmony_ci
18265bd8deadSopenharmony_ci    <vertexAttribReg>      ::= "v" "[" vertexAttribRegNum "]"
18275bd8deadSopenharmony_ci
18285bd8deadSopenharmony_ci    <vertexAttribRegNum>   ::= decimal integer from 0 to 15 inclusive
18295bd8deadSopenharmony_ci                             | "OPOS"
18305bd8deadSopenharmony_ci                             | "WGHT"
18315bd8deadSopenharmony_ci                             | "NRML"
18325bd8deadSopenharmony_ci                             | "COL0"
18335bd8deadSopenharmony_ci                             | "COL1"
18345bd8deadSopenharmony_ci                             | "FOGC"
18355bd8deadSopenharmony_ci                             | "TEX0"
18365bd8deadSopenharmony_ci                             | "TEX1"
18375bd8deadSopenharmony_ci                             | "TEX2"
18385bd8deadSopenharmony_ci                             | "TEX3"
18395bd8deadSopenharmony_ci                             | "TEX4"
18405bd8deadSopenharmony_ci                             | "TEX5"
18415bd8deadSopenharmony_ci                             | "TEX6"
18425bd8deadSopenharmony_ci                             | "TEX7"
18435bd8deadSopenharmony_ci
18445bd8deadSopenharmony_ci    <progParamReg>         ::= <absProgParamReg>
18455bd8deadSopenharmony_ci                             | <relProgParamReg>
18465bd8deadSopenharmony_ci
18475bd8deadSopenharmony_ci    <absProgParamReg>      ::= "c" "[" <progParamRegNum> "]"
18485bd8deadSopenharmony_ci
18495bd8deadSopenharmony_ci    <progParamRegNum>      ::= decimal integer from 0 to 95 inclusive
18505bd8deadSopenharmony_ci
18515bd8deadSopenharmony_ci    <relProgParamReg>      ::= "c" "[" <addrReg> "]"
18525bd8deadSopenharmony_ci                             | "c" "[" <addrReg> "+" <progParamPosOffset> "]"
18535bd8deadSopenharmony_ci                             | "c" "[" <addrReg> "-" <progParamNegOffset> "]"
18545bd8deadSopenharmony_ci
18555bd8deadSopenharmony_ci    <progParamPosOffset>   ::= decimal integer from 0 to 63 inclusive
18565bd8deadSopenharmony_ci
18575bd8deadSopenharmony_ci    <progParamNegOffset>   ::= decimal integer from 0 to 64 inclusive
18585bd8deadSopenharmony_ci
18595bd8deadSopenharmony_ci    <addrReg>              ::= "A0" "." "x"
18605bd8deadSopenharmony_ci
18615bd8deadSopenharmony_ci    <temporaryReg>         ::= "R0"
18625bd8deadSopenharmony_ci                             | "R1"
18635bd8deadSopenharmony_ci                             | "R2"
18645bd8deadSopenharmony_ci                             | "R3"
18655bd8deadSopenharmony_ci                             | "R4"
18665bd8deadSopenharmony_ci                             | "R5"
18675bd8deadSopenharmony_ci                             | "R6"
18685bd8deadSopenharmony_ci                             | "R7"
18695bd8deadSopenharmony_ci                             | "R8"
18705bd8deadSopenharmony_ci                             | "R9"
18715bd8deadSopenharmony_ci                             | "R10"
18725bd8deadSopenharmony_ci                             | "R11"
18735bd8deadSopenharmony_ci
18745bd8deadSopenharmony_ci    <vertexResultReg>      ::= "o" "[" vertexResultRegName "]"
18755bd8deadSopenharmony_ci
18765bd8deadSopenharmony_ci    <vertexResultRegName>  ::= "HPOS"
18775bd8deadSopenharmony_ci                             | "COL0"
18785bd8deadSopenharmony_ci                             | "COL1"
18795bd8deadSopenharmony_ci                             | "BFC0"
18805bd8deadSopenharmony_ci                             | "BFC1"
18815bd8deadSopenharmony_ci                             | "FOGC"
18825bd8deadSopenharmony_ci                             | "PSIZ"
18835bd8deadSopenharmony_ci                             | "TEX0"
18845bd8deadSopenharmony_ci                             | "TEX1"
18855bd8deadSopenharmony_ci                             | "TEX2"
18865bd8deadSopenharmony_ci                             | "TEX3"
18875bd8deadSopenharmony_ci                             | "TEX4"
18885bd8deadSopenharmony_ci                             | "TEX5"
18895bd8deadSopenharmony_ci                             | "TEX6"
18905bd8deadSopenharmony_ci                             | "TEX7"
18915bd8deadSopenharmony_ci
18925bd8deadSopenharmony_ci    <scalarSuffix>         ::= "." <component>
18935bd8deadSopenharmony_ci
18945bd8deadSopenharmony_ci    <swizzleSuffix>        ::= ""
18955bd8deadSopenharmony_ci                             | "." <component>
18965bd8deadSopenharmony_ci                             | "." <component> <component>
18975bd8deadSopenharmony_ci                                   <component> <component>
18985bd8deadSopenharmony_ci
18995bd8deadSopenharmony_ci    <component>            ::= "x"
19005bd8deadSopenharmony_ci                             | "y"
19015bd8deadSopenharmony_ci                             | "z"
19025bd8deadSopenharmony_ci                             | "w"
19035bd8deadSopenharmony_ci
19045bd8deadSopenharmony_ci    The <vertexAttribRegNum> rule matches both register numbers 0 through
19055bd8deadSopenharmony_ci    15 and a set of mnemonics that abbreviate the aliasing of conventional
19065bd8deadSopenharmony_ci    the per-vertex parameters to vertex attribute register numbers.
19075bd8deadSopenharmony_ci    Table X.3 shows the mapping from mnemonic to vertex attribute register
19085bd8deadSopenharmony_ci    number and what the mnemonic abbreviates.
19095bd8deadSopenharmony_ci
19105bd8deadSopenharmony_ci           Vertex Attribute
19115bd8deadSopenharmony_ciMnemonic   Register Number     Meaning
19125bd8deadSopenharmony_ci--------   ----------------    --------------------
19135bd8deadSopenharmony_ci "OPOS"     0                  object position
19145bd8deadSopenharmony_ci "WGHT"     1                  vertex weight
19155bd8deadSopenharmony_ci "NRML"     2                  normal
19165bd8deadSopenharmony_ci "COL0"     3                  primary color
19175bd8deadSopenharmony_ci "COL1"     4                  secondary color
19185bd8deadSopenharmony_ci "FOGC"     5                  fog coordinate
19195bd8deadSopenharmony_ci "TEX0"     8                  texture coordinate 0
19205bd8deadSopenharmony_ci "TEX1"     9                  texture coordinate 1
19215bd8deadSopenharmony_ci "TEX2"     10                 texture coordinate 2
19225bd8deadSopenharmony_ci "TEX3"     11                 texture coordinate 3
19235bd8deadSopenharmony_ci "TEX4"     12                 texture coordinate 4
19245bd8deadSopenharmony_ci "TEX5"     13                 texture coordinate 5
19255bd8deadSopenharmony_ci "TEX6"     14                 texture coordinate 6
19265bd8deadSopenharmony_ci "TEX7"     15                 texture coordinate 7
19275bd8deadSopenharmony_ci
19285bd8deadSopenharmony_ciTable X.3:  The mapping between vertex attribute register numbers,
19295bd8deadSopenharmony_cimnemonics, and meanings.
19305bd8deadSopenharmony_ci
19315bd8deadSopenharmony_ci    A vertex programs fails to load if it does not write at least one
19325bd8deadSopenharmony_ci    component of the HPOS register.
19335bd8deadSopenharmony_ci
19345bd8deadSopenharmony_ci    A vertex program fails to load if it contains more than 128
19355bd8deadSopenharmony_ci    instructions.
19365bd8deadSopenharmony_ci
19375bd8deadSopenharmony_ci    A vertex program fails to load if any instruction sources more than
19385bd8deadSopenharmony_ci    one unique program parameter register.
19395bd8deadSopenharmony_ci
19405bd8deadSopenharmony_ci    A vertex program fails to load if any instruction sources more than
19415bd8deadSopenharmony_ci    one unique vertex attribute register.
19425bd8deadSopenharmony_ci
19435bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if a vertex program fails
19445bd8deadSopenharmony_ci    to load because it is not syntactically correct or for one of the
19455bd8deadSopenharmony_ci    semantic restrictions listed above.
19465bd8deadSopenharmony_ci
19475bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if a program is loaded for
19485bd8deadSopenharmony_ci    id when id is currently loaded with a program of a different target.
19495bd8deadSopenharmony_ci
19505bd8deadSopenharmony_ci    A successfully loaded vertex program is parsed into a sequence of
19515bd8deadSopenharmony_ci    instructions.  Each instruction is identified by its tokenized name.
19525bd8deadSopenharmony_ci    The operation of these instructions when executed is defined in
19535bd8deadSopenharmony_ci    section 2.14.1.10.  
19545bd8deadSopenharmony_ci
19555bd8deadSopenharmony_ci    A successfully loaded program replaces the program previously assigned
19565bd8deadSopenharmony_ci    to the name specified by id.  If the OUT_OF_MEMORY error is generated
19575bd8deadSopenharmony_ci    by LoadProgramNV, no change is made to the previous contents of the
19585bd8deadSopenharmony_ci    named program.
19595bd8deadSopenharmony_ci
19605bd8deadSopenharmony_ci    Querying the value of PROGRAM_ERROR_POSITION_NV returns a ubyte
19615bd8deadSopenharmony_ci    offset into the last loaded program string indicating where the first
19625bd8deadSopenharmony_ci    error in the program.  If the program fails to load because of a
19635bd8deadSopenharmony_ci    semantic restriction that cannot be determined until the program
19645bd8deadSopenharmony_ci    is fully scanned, the error position will be len, the length of
19655bd8deadSopenharmony_ci    the program.  If the program loads successfully, the value of
19665bd8deadSopenharmony_ci    PROGRAM_ERROR_POSITION_NV is assigned the value negative one.
19675bd8deadSopenharmony_ci
19685bd8deadSopenharmony_ci    2.14.1.8  Vertex Program Binding and Program Management
19695bd8deadSopenharmony_ci
19705bd8deadSopenharmony_ci    The current vertex program is invoked whenever vertex attribute
19715bd8deadSopenharmony_ci    zero is updated (whether by a VertexAttributeNV or Vertex command).
19725bd8deadSopenharmony_ci    The current vertex program is updated by
19735bd8deadSopenharmony_ci
19745bd8deadSopenharmony_ci      BindProgramNV(enum target, uint id);
19755bd8deadSopenharmony_ci
19765bd8deadSopenharmony_ci    where target must be VERTEX_PROGRAM_NV.  This binds the vertex program
19775bd8deadSopenharmony_ci    named by id as the current vertex program. The error INVALID_OPERATION
19785bd8deadSopenharmony_ci    is generated if id names a program that is not a vertex program
19795bd8deadSopenharmony_ci    (for example, if id names a vertex state program as described in
19805bd8deadSopenharmony_ci    section 2.14.4).  
19815bd8deadSopenharmony_ci
19825bd8deadSopenharmony_ci    Binding to a nonexistent program id does not generate an error.
19835bd8deadSopenharmony_ci    In particular, binding to program id zero does not generate an error.
19845bd8deadSopenharmony_ci    However, because program zero cannot be loaded, program zero is
19855bd8deadSopenharmony_ci    always nonexistent.  If a program id is successfully loaded with a
19865bd8deadSopenharmony_ci    new vertex program and id is also the currently bound vertex program,
19875bd8deadSopenharmony_ci    the new program is considered the currently bound vertex program.
19885bd8deadSopenharmony_ci
19895bd8deadSopenharmony_ci    The INVALID_OPERATION error is generated when both vertex program
19905bd8deadSopenharmony_ci    mode is enabled and Begin is called (or when a command that performs
19915bd8deadSopenharmony_ci    an implicit Begin is called) if the current vertex program is
19925bd8deadSopenharmony_ci    nonexistent or not valid.  A vertex program may not be valid for
19935bd8deadSopenharmony_ci    reasons explained in section 2.14.5.
19945bd8deadSopenharmony_ci
19955bd8deadSopenharmony_ci    Programs are deleted by calling
19965bd8deadSopenharmony_ci
19975bd8deadSopenharmony_ci      void DeleteProgramsNV(sizei n, const uint *ids);
19985bd8deadSopenharmony_ci
19995bd8deadSopenharmony_ci    ids contains n names of programs to be deleted.  After a program
20005bd8deadSopenharmony_ci    is deleted, it becomes nonexistent, and its name is again unused.
20015bd8deadSopenharmony_ci    If a program that is currently bound is deleted, it is as though
20025bd8deadSopenharmony_ci    BindProgramNV has been executed with the same target as the deleted
20035bd8deadSopenharmony_ci    program and program zero.  Unused names in ids are silently ignored,
20045bd8deadSopenharmony_ci    as is the value zero.
20055bd8deadSopenharmony_ci
20065bd8deadSopenharmony_ci    The command
20075bd8deadSopenharmony_ci
20085bd8deadSopenharmony_ci      void GenProgramsNV(sizei n, uint *ids);
20095bd8deadSopenharmony_ci
20105bd8deadSopenharmony_ci    returns n previously unused program names in ids.  These names
20115bd8deadSopenharmony_ci    are marked as used, for the purposes of GenProgramsNV only,
20125bd8deadSopenharmony_ci    but they become existent programs only when the are first loaded
20135bd8deadSopenharmony_ci    using LoadProgramNV.  The error INVALID_VALUE is generated if n
20145bd8deadSopenharmony_ci    is negative.
20155bd8deadSopenharmony_ci
20165bd8deadSopenharmony_ci    An implementation may choose to establish a working set of programs on
20175bd8deadSopenharmony_ci    which binding and ExecuteProgramNV operations (execute programs are
20185bd8deadSopenharmony_ci    explained in section 2.14.4) are performed with higher performance.
20195bd8deadSopenharmony_ci    A program that is currently part of this working set is said to
20205bd8deadSopenharmony_ci    be resident.
20215bd8deadSopenharmony_ci
20225bd8deadSopenharmony_ci    The command
20235bd8deadSopenharmony_ci      
20245bd8deadSopenharmony_ci      boolean AreProgramsResidentNV(sizei n, const uint *ids,
20255bd8deadSopenharmony_ci                                    boolean *residences);
20265bd8deadSopenharmony_ci
20275bd8deadSopenharmony_ci    returns TRUE if all of the n programs named in ids are resident,
20285bd8deadSopenharmony_ci    or if the implementation does not distinguish a working set.  If at
20295bd8deadSopenharmony_ci    least one of the programs named in ids is not resident, then FALSE is
20305bd8deadSopenharmony_ci    returned, and the residence of each program is returned in residences.
20315bd8deadSopenharmony_ci    Otherwise the contents of residences are not changed.  If any of
20325bd8deadSopenharmony_ci    the names in ids are nonexistent or zero, FALSE is returned, the
20335bd8deadSopenharmony_ci    error INVALID_VALUE is generated, and the contents of residences
20345bd8deadSopenharmony_ci    are indeterminate.  The residence status of a single named program
20355bd8deadSopenharmony_ci    can also be queried by calling GetProgramivNV with id set to the
20365bd8deadSopenharmony_ci    name of the program and pname set to PROGRAM_RESIDENT_NV.
20375bd8deadSopenharmony_ci
20385bd8deadSopenharmony_ci    AreProgramsResidentNV indicates only whether a program is
20395bd8deadSopenharmony_ci    currently resident, not whether it could not be made resident.
20405bd8deadSopenharmony_ci    An implementation may choose to make a program resident only on
20415bd8deadSopenharmony_ci    first use, for example.  The client may guide the GL implementation
20425bd8deadSopenharmony_ci    in determining which programs should be resident by requesting a
20435bd8deadSopenharmony_ci    set of programs to make resident.
20445bd8deadSopenharmony_ci
20455bd8deadSopenharmony_ci    The command
20465bd8deadSopenharmony_ci
20475bd8deadSopenharmony_ci      void RequestResidentProgramsNV(sizei n, const uint *ids);
20485bd8deadSopenharmony_ci
20495bd8deadSopenharmony_ci    requests that the n programs named in ids should be made resident.
20505bd8deadSopenharmony_ci    While all the programs are not guaranteed to become resident,
20515bd8deadSopenharmony_ci    the implementation should make a best effort to make as many of
20525bd8deadSopenharmony_ci    the programs resident as possible.  As a result of making the
20535bd8deadSopenharmony_ci    requested programs resident, program names not among the requested
20545bd8deadSopenharmony_ci    programs may become non-resident.  Higher priority for residency
20555bd8deadSopenharmony_ci    should be given to programs listed earlier in the ids array.
20565bd8deadSopenharmony_ci    RequestResidentProgramsNV silently ignores attempts to make resident
20575bd8deadSopenharmony_ci    nonexistent program names or zero.  AreProgramsResidentNV can be
20585bd8deadSopenharmony_ci    called after RequestResidentProgramsNV to determine which programs
20595bd8deadSopenharmony_ci    actually became resident.
20605bd8deadSopenharmony_ci
20615bd8deadSopenharmony_ci    2.14.1.9  Vertex Program Register Accesses
20625bd8deadSopenharmony_ci
20635bd8deadSopenharmony_ci    There are 17 vertex program instructions.  The instructions and their
20645bd8deadSopenharmony_ci    respective input and output parameters are summarized in Table X.4.
20655bd8deadSopenharmony_ci
20665bd8deadSopenharmony_ci                             Output
20675bd8deadSopenharmony_ci         Inputs              (vector or
20685bd8deadSopenharmony_ciOpcode   (scalar or vector)  replicated scalar)   Operation
20695bd8deadSopenharmony_ci------   ------------------  ------------------   --------------------------
20705bd8deadSopenharmony_ci ARL     s                   address register     address register load
20715bd8deadSopenharmony_ci MOV     v                   v                    move
20725bd8deadSopenharmony_ci MUL     v,v                 v                    multiply
20735bd8deadSopenharmony_ci ADD     v,v                 v                    add
20745bd8deadSopenharmony_ci MAD     v,v,v               v                    multiply and add
20755bd8deadSopenharmony_ci RCP     s                   ssss                 reciprocal
20765bd8deadSopenharmony_ci RSQ     s                   ssss                 reciprocal square root
20775bd8deadSopenharmony_ci DP3     v,v                 ssss                 3-component dot product
20785bd8deadSopenharmony_ci DP4     v,v                 ssss                 4-component dot product
20795bd8deadSopenharmony_ci DST     v,v                 v                    distance vector
20805bd8deadSopenharmony_ci MIN     v,v                 v                    minimum
20815bd8deadSopenharmony_ci MAX     v,v                 v                    maximum
20825bd8deadSopenharmony_ci SLT     v,v                 v                    set on less than
20835bd8deadSopenharmony_ci SGE     v,v                 v                    set on greater equal than
20845bd8deadSopenharmony_ci EXP     s                   v                    exponential base 2
20855bd8deadSopenharmony_ci LOG     s                   v                    logarithm base 2
20865bd8deadSopenharmony_ci LIT     v                   v                    light coefficients
20875bd8deadSopenharmony_ci
20885bd8deadSopenharmony_ciTable X.4:  Summary of vertex program instructions.  "v" indicates a
20895bd8deadSopenharmony_civector input or output, "s" indicates a scalar input, and "ssss" indicates
20905bd8deadSopenharmony_cia scalar output replicated across a 4-component vector.
20915bd8deadSopenharmony_ci
20925bd8deadSopenharmony_ci    Instructions use either scalar source values or swizzled source
20935bd8deadSopenharmony_ci    values, indicated in the grammar (see section 2.14.1.7) by the rules
20945bd8deadSopenharmony_ci    <scalarSrcReg> and <swizzleSrcReg> respectively.  Either type of
20955bd8deadSopenharmony_ci    source value is negated when the <optionalSign> rule matches "-".
20965bd8deadSopenharmony_ci
20975bd8deadSopenharmony_ci    Scalar source register values select one of the source register's
20985bd8deadSopenharmony_ci    four components based on the <component> of the <scalarSuffix> rule.
20995bd8deadSopenharmony_ci    The characters "x", "y", "z", and "w" match the x, y, z, and
21005bd8deadSopenharmony_ci    w components respectively.  The indicated component is used as a
21015bd8deadSopenharmony_ci    scalar for the particular source value.
21025bd8deadSopenharmony_ci
21035bd8deadSopenharmony_ci    Swizzled source register values may arbitrarily swizzle the source
21045bd8deadSopenharmony_ci    register's components based on the <swizzleSuffix> rule.  In the case
21055bd8deadSopenharmony_ci    where the <swizzleSuffix> matches (ignoring whitespace) the pattern
21065bd8deadSopenharmony_ci    ".????" where each question mark is one of "x", "y", "z", or "w",
21075bd8deadSopenharmony_ci    this indicates the ith component of the source register value should
21085bd8deadSopenharmony_ci    come from the component named by the ith component in the sequence.
21095bd8deadSopenharmony_ci    For example, if the swizzle suffix is ".yzzx" and the source register
21105bd8deadSopenharmony_ci    contains [ 2.0, 8.0, 9.0, 0.0 ] the swizzled source register value
21115bd8deadSopenharmony_ci    used by the instruction is [ 8.0, 9.0, 9.0, 2.0 ].
21125bd8deadSopenharmony_ci
21135bd8deadSopenharmony_ci    If the <swizzleSuffix> rule matches "", this is treated the same as
21145bd8deadSopenharmony_ci    ".xyzw".  If the <swizzleSuffix> rule matches (ignoring whitespace)
21155bd8deadSopenharmony_ci    ".x", ".y", ".z", or ".w", these are treated the same as ".xxxx",
21165bd8deadSopenharmony_ci    ".yyyy", ".zzzz", and ".wwww" respectively.
21175bd8deadSopenharmony_ci
21185bd8deadSopenharmony_ci    The register sourced for either a scalar source register value or a
21195bd8deadSopenharmony_ci    swizzled source register value is indicated in the grammar by the rule
21205bd8deadSopenharmony_ci    <srcReg>.  The <vertexAttribReg>, <progParamReg>, and <temporaryReg>
21215bd8deadSopenharmony_ci    sub-rules correspond to one of the vertex attribute registers,
21225bd8deadSopenharmony_ci    program parameter registers, or temporary register respectively.
21235bd8deadSopenharmony_ci
21245bd8deadSopenharmony_ci    The vertex attribute and temporary registers are accessed absolutely
21255bd8deadSopenharmony_ci    based on the numbered register.  In the case of vertex attribute
21265bd8deadSopenharmony_ci    registers, if the <vertexAttribRegNum> corresponds to a mnemonic,
21275bd8deadSopenharmony_ci    the corresponding register number from Table X.3 is used.
21285bd8deadSopenharmony_ci
21295bd8deadSopenharmony_ci    Either absolute or relative addressing can be used to access the
21305bd8deadSopenharmony_ci    program parameter registers.  Absolute addressing is indicated by
21315bd8deadSopenharmony_ci    the grammar by the <absProgParamReg> rule.  Absolute addressing
21325bd8deadSopenharmony_ci    accesses the numbered program parameter register indicated by the
21335bd8deadSopenharmony_ci    <progParamRegNum> rule.  Relative addressing accesses the numbered
21345bd8deadSopenharmony_ci    program parameter register plus an offset.  The offset is the positive
21355bd8deadSopenharmony_ci    value of <progParamPosOffset> if the <progParamPosOffset> rule is
21365bd8deadSopenharmony_ci    matched, or the offset is the negative value of <progParamNegOffset>
21375bd8deadSopenharmony_ci    if the <progParamNegOffset> rule is matched, or otherwise the offset
21385bd8deadSopenharmony_ci    is zero.  Relative addressing is available only for program parameter
21395bd8deadSopenharmony_ci    registers and only for reads (not writes).  Relative addressing
21405bd8deadSopenharmony_ci    reads outside of the 0 to 95 inclusive range always read the value
21415bd8deadSopenharmony_ci    (0,0,0,0).
21425bd8deadSopenharmony_ci
21435bd8deadSopenharmony_ci    The result of all instructions except ARL is written back to a
21445bd8deadSopenharmony_ci    masked destination register, indicated in the grammar by the rule
21455bd8deadSopenharmony_ci    <maskedDstReg>.
21465bd8deadSopenharmony_ci
21475bd8deadSopenharmony_ci    Writes to each component of the destination register can be masked,
21485bd8deadSopenharmony_ci    indicated in the grammar by the <optionalMask> rule.  If the optional
21495bd8deadSopenharmony_ci    mask is "", all components are written.  Otherwise, the optional
21505bd8deadSopenharmony_ci    mask names particular components to write.  The characters "x",
21515bd8deadSopenharmony_ci    "y", "z", and "w" match the x, y, z, and w components respectively.
21525bd8deadSopenharmony_ci    For example, an optional mask of ".xzw" indicates that the x, z,
21535bd8deadSopenharmony_ci    and w components should be written but not the y component.
21545bd8deadSopenharmony_ci    The grammar requires that the destination register mask components
21555bd8deadSopenharmony_ci    must be listed in "xyzw" order.
21565bd8deadSopenharmony_ci
21575bd8deadSopenharmony_ci    The actual destination register is indicated in the grammar by
21585bd8deadSopenharmony_ci    the rule <dstReg>.  The <temporaryReg> and <vertexResultReg>
21595bd8deadSopenharmony_ci    sub-rules correspond to either the temporary registers or vertex
21605bd8deadSopenharmony_ci    result registers.  The temporary registers are determined and accessed
21615bd8deadSopenharmony_ci    as described earlier.
21625bd8deadSopenharmony_ci
21635bd8deadSopenharmony_ci    The vertex result registers are accessed absolutely based on the
21645bd8deadSopenharmony_ci    named register.  The <vertexResultRegName> rule corresponds to
21655bd8deadSopenharmony_ci    registers named in Table X.1.
21665bd8deadSopenharmony_ci
21675bd8deadSopenharmony_ci    2.14.1.10  Vertex Program Instruction Set Operations
21685bd8deadSopenharmony_ci
21695bd8deadSopenharmony_ci    The operation of the 17 vertex program instructions are described in
21705bd8deadSopenharmony_ci    this section.  After the textual description of each instruction's
21715bd8deadSopenharmony_ci    operation, a register transfer level description is also presented.
21725bd8deadSopenharmony_ci
21735bd8deadSopenharmony_ci    The following conventions are used in each instruction's register
21745bd8deadSopenharmony_ci    transfer level description.  The 4-component vector variables "t",
21755bd8deadSopenharmony_ci    "u", and "v" are assigned intermediate results.  The destination
21765bd8deadSopenharmony_ci    register is called "destination".  The three possible source registers
21775bd8deadSopenharmony_ci    are called "source0", "source1", and "source2" respectively.
21785bd8deadSopenharmony_ci
21795bd8deadSopenharmony_ci    The x, y, z, and w vector components are referred to with the suffixes
21805bd8deadSopenharmony_ci    ".x", ".y", ".z", and ".w" respectively.  The suffix ".c" is used for
21815bd8deadSopenharmony_ci    scalar source register values and c represents the particular source
21825bd8deadSopenharmony_ci    register's selected scalar component.  Swizzling of components is
21835bd8deadSopenharmony_ci    indicated with the suffixes ".c***", ".*c**", ".**c*", and ".***c"
21845bd8deadSopenharmony_ci    where c is meant to indicate the x, y, z, or w component selected for
21855bd8deadSopenharmony_ci    the particular source operand swizzle configuration.  For example:
21865bd8deadSopenharmony_ci
21875bd8deadSopenharmony_ci      t.x = source0.c***;
21885bd8deadSopenharmony_ci      t.y = source0.*c**;
21895bd8deadSopenharmony_ci      t.z = source0.**c*;
21905bd8deadSopenharmony_ci      t.w = source0.***c;
21915bd8deadSopenharmony_ci
21925bd8deadSopenharmony_ci    This example indicates that t should be assigned the swizzled
21935bd8deadSopenharmony_ci    version of the source0 operand based on the source0 operand's swizzle
21945bd8deadSopenharmony_ci    configuration.
21955bd8deadSopenharmony_ci
21965bd8deadSopenharmony_ci    The variables "negate0", "negate1", and "negate2" are booleans
21975bd8deadSopenharmony_ci    that are true when the respective source value should be negated.
21985bd8deadSopenharmony_ci    The variables "xmask", "ymask", "zmask", and "wmask" are booleans
21995bd8deadSopenharmony_ci    that are true when the destination write mask for the respective
22005bd8deadSopenharmony_ci    component is enabled for writing.
22015bd8deadSopenharmony_ci
22025bd8deadSopenharmony_ci    Otherwise, the register transfer level descriptions mimic ANSI C
22035bd8deadSopenharmony_ci    syntax.
22045bd8deadSopenharmony_ci
22055bd8deadSopenharmony_ci    The idiom "IEEE(expression)" represents the s23e8 single-precision
22065bd8deadSopenharmony_ci    result of the expression if evaluated using IEEE single-precision
22075bd8deadSopenharmony_ci    floating point operations.  The IEEE idiom is used to specify the
22085bd8deadSopenharmony_ci    maximum allowed deviation from IEEE single-precision floating-point
22095bd8deadSopenharmony_ci    arithmetic results.
22105bd8deadSopenharmony_ci
22115bd8deadSopenharmony_ci    The following abbreviations are also used:
22125bd8deadSopenharmony_ci
22135bd8deadSopenharmony_ci      +Inf    floating-point representation of positive infinity
22145bd8deadSopenharmony_ci      -Inf    floating-point representation of negative infinity
22155bd8deadSopenharmony_ci      +NaN    floating-point representation of positive not a number
22165bd8deadSopenharmony_ci      -NaN    floating-point representation of negative not a number
22175bd8deadSopenharmony_ci      NA      not applicable or not used
22185bd8deadSopenharmony_ci
22195bd8deadSopenharmony_ci    2.14.1.10.1  ARL: Address Register Load
22205bd8deadSopenharmony_ci
22215bd8deadSopenharmony_ci    The ARL instruction moves value of the source scalar into the address
22225bd8deadSopenharmony_ci    register.  Conceptually, the address register load instruction is
22235bd8deadSopenharmony_ci    a 4-component vector signed integer register, but the only valid
22245bd8deadSopenharmony_ci    address register component for writing and indexing is the x
22255bd8deadSopenharmony_ci    component.  The only use for A0.x is as a base address for program
22265bd8deadSopenharmony_ci    parameter reads.  The source value is a float that is truncated
22275bd8deadSopenharmony_ci    towards negative infinity into a signed integer.
22285bd8deadSopenharmony_ci
22295bd8deadSopenharmony_ci        t.x = source0.c;
22305bd8deadSopenharmony_ci        if (negate0) t.x = -t.x;
22315bd8deadSopenharmony_ci        A0.x = floor(t.x);
22325bd8deadSopenharmony_ci
22335bd8deadSopenharmony_ci    2.14.1.10.2  MOV: Move
22345bd8deadSopenharmony_ci
22355bd8deadSopenharmony_ci    The MOV instruction moves the value of the source vector into the
22365bd8deadSopenharmony_ci    destination register.
22375bd8deadSopenharmony_ci
22385bd8deadSopenharmony_ci        t.x = source0.c***;
22395bd8deadSopenharmony_ci        t.y = source0.*c**;
22405bd8deadSopenharmony_ci        t.z = source0.**c*;
22415bd8deadSopenharmony_ci        t.w = source0.***c;
22425bd8deadSopenharmony_ci        if (negate0) {
22435bd8deadSopenharmony_ci          t.x = -t.x;
22445bd8deadSopenharmony_ci          t.y = -t.y;
22455bd8deadSopenharmony_ci          t.z = -t.z;
22465bd8deadSopenharmony_ci          t.w = -t.w;
22475bd8deadSopenharmony_ci        }
22485bd8deadSopenharmony_ci        if (xmask) destination.x = t.x;
22495bd8deadSopenharmony_ci        if (ymask) destination.y = t.y;
22505bd8deadSopenharmony_ci        if (zmask) destination.z = t.z;
22515bd8deadSopenharmony_ci        if (wmask) destination.w = t.w;
22525bd8deadSopenharmony_ci
22535bd8deadSopenharmony_ci    2.14.1.10.3  MUL: Multiply
22545bd8deadSopenharmony_ci
22555bd8deadSopenharmony_ci    The MUL instruction multiplies the values of the two source vectors
22565bd8deadSopenharmony_ci    into the destination register.
22575bd8deadSopenharmony_ci
22585bd8deadSopenharmony_ci        t.x = source0.c***;
22595bd8deadSopenharmony_ci        t.y = source0.*c**;
22605bd8deadSopenharmony_ci        t.z = source0.**c*;
22615bd8deadSopenharmony_ci        t.w = source0.***c;
22625bd8deadSopenharmony_ci        if (negate0) {
22635bd8deadSopenharmony_ci          t.x = -t.x;
22645bd8deadSopenharmony_ci          t.y = -t.y;
22655bd8deadSopenharmony_ci          t.z = -t.z;
22665bd8deadSopenharmony_ci          t.w = -t.w;
22675bd8deadSopenharmony_ci        }
22685bd8deadSopenharmony_ci        u.x = source1.c***;
22695bd8deadSopenharmony_ci        u.y = source1.*c**;
22705bd8deadSopenharmony_ci        u.z = source1.**c*;
22715bd8deadSopenharmony_ci        u.w = source1.***c;
22725bd8deadSopenharmony_ci        if (negate1) {
22735bd8deadSopenharmony_ci          u.x = -u.x;
22745bd8deadSopenharmony_ci          u.y = -u.y;
22755bd8deadSopenharmony_ci          u.z = -u.z;
22765bd8deadSopenharmony_ci          u.w = -u.w;
22775bd8deadSopenharmony_ci        }
22785bd8deadSopenharmony_ci        if (xmask) destination.x = t.x * u.x;
22795bd8deadSopenharmony_ci        if (ymask) destination.y = t.y * u.y;
22805bd8deadSopenharmony_ci        if (zmask) destination.z = t.z * u.z;
22815bd8deadSopenharmony_ci        if (wmask) destination.w = t.w * u.w;
22825bd8deadSopenharmony_ci
22835bd8deadSopenharmony_ci    2.14.1.10.4  ADD: Add
22845bd8deadSopenharmony_ci
22855bd8deadSopenharmony_ci    The ADD instruction adds the values of the two source vectors into
22865bd8deadSopenharmony_ci    the destination register.
22875bd8deadSopenharmony_ci
22885bd8deadSopenharmony_ci        t.x = source0.c***;
22895bd8deadSopenharmony_ci        t.y = source0.*c**;
22905bd8deadSopenharmony_ci        t.z = source0.**c*;
22915bd8deadSopenharmony_ci        t.w = source0.***c;
22925bd8deadSopenharmony_ci        if (negate0) {
22935bd8deadSopenharmony_ci          t.x = -t.x;
22945bd8deadSopenharmony_ci          t.y = -t.y;
22955bd8deadSopenharmony_ci          t.z = -t.z;
22965bd8deadSopenharmony_ci          t.w = -t.w;
22975bd8deadSopenharmony_ci        }
22985bd8deadSopenharmony_ci        u.x = source1.c***;
22995bd8deadSopenharmony_ci        u.y = source1.*c**;
23005bd8deadSopenharmony_ci        u.z = source1.**c*;
23015bd8deadSopenharmony_ci        u.w = source1.***c;
23025bd8deadSopenharmony_ci        if (negate1) {
23035bd8deadSopenharmony_ci          u.x = -u.x;
23045bd8deadSopenharmony_ci          u.y = -u.y;
23055bd8deadSopenharmony_ci          u.z = -u.z;
23065bd8deadSopenharmony_ci          u.w = -u.w;
23075bd8deadSopenharmony_ci        }
23085bd8deadSopenharmony_ci        if (xmask) destination.x = t.x + u.x;
23095bd8deadSopenharmony_ci        if (ymask) destination.y = t.y + u.y;
23105bd8deadSopenharmony_ci        if (zmask) destination.z = t.z + u.z;
23115bd8deadSopenharmony_ci        if (wmask) destination.w = t.w + u.w;
23125bd8deadSopenharmony_ci
23135bd8deadSopenharmony_ci    2.14.1.10.5  MAD: Multiply and Add
23145bd8deadSopenharmony_ci
23155bd8deadSopenharmony_ci    The MAD instruction adds the value of the third source vector to the
23165bd8deadSopenharmony_ci    product of the values of the first and second two source vectors,
23175bd8deadSopenharmony_ci    writing the result to the destination register.
23185bd8deadSopenharmony_ci
23195bd8deadSopenharmony_ci        t.x = source0.c***;
23205bd8deadSopenharmony_ci        t.y = source0.*c**;
23215bd8deadSopenharmony_ci        t.z = source0.**c*;
23225bd8deadSopenharmony_ci        t.w = source0.***c;
23235bd8deadSopenharmony_ci        if (negate0) {
23245bd8deadSopenharmony_ci          t.x = -t.x;
23255bd8deadSopenharmony_ci          t.y = -t.y;
23265bd8deadSopenharmony_ci          t.z = -t.z;
23275bd8deadSopenharmony_ci          t.w = -t.w;
23285bd8deadSopenharmony_ci        }
23295bd8deadSopenharmony_ci        u.x = source1.c***;
23305bd8deadSopenharmony_ci        u.y = source1.*c**;
23315bd8deadSopenharmony_ci        u.z = source1.**c*;
23325bd8deadSopenharmony_ci        u.w = source1.***c;
23335bd8deadSopenharmony_ci        if (negate1) {
23345bd8deadSopenharmony_ci          u.x = -u.x;
23355bd8deadSopenharmony_ci          u.y = -u.y;
23365bd8deadSopenharmony_ci          u.z = -u.z;
23375bd8deadSopenharmony_ci          u.w = -u.w;
23385bd8deadSopenharmony_ci        }
23395bd8deadSopenharmony_ci        v.x = source2.c***;
23405bd8deadSopenharmony_ci        v.y = source2.*c**;
23415bd8deadSopenharmony_ci        v.z = source2.**c*;
23425bd8deadSopenharmony_ci        v.w = source2.***c;
23435bd8deadSopenharmony_ci        if (negate2) {
23445bd8deadSopenharmony_ci          v.x = -v.x;
23455bd8deadSopenharmony_ci          v.y = -v.y;
23465bd8deadSopenharmony_ci          v.z = -v.z;
23475bd8deadSopenharmony_ci          v.w = -v.w;
23485bd8deadSopenharmony_ci        }
23495bd8deadSopenharmony_ci        if (xmask) destination.x = t.x * u.x + v.x;
23505bd8deadSopenharmony_ci        if (ymask) destination.y = t.y * u.y + v.y;
23515bd8deadSopenharmony_ci        if (zmask) destination.z = t.z * u.z + v.z;
23525bd8deadSopenharmony_ci        if (wmask) destination.w = t.w * u.w + v.w;
23535bd8deadSopenharmony_ci
23545bd8deadSopenharmony_ci    2.14.1.10.6  RCP: Reciprocal
23555bd8deadSopenharmony_ci
23565bd8deadSopenharmony_ci    The RCP instruction inverts the value of the source scalar into
23575bd8deadSopenharmony_ci    the destination register.  The reciprocal of exactly 1.0 must be
23585bd8deadSopenharmony_ci    exactly 1.0.
23595bd8deadSopenharmony_ci
23605bd8deadSopenharmony_ci    Additionally the reciprocal of negative infinity gives [-0.0, -0.0,
23615bd8deadSopenharmony_ci    -0.0, -0.0]; the reciprocal of negative zero gives [-Inf, -Inf, -Inf,
23625bd8deadSopenharmony_ci    -Inf]; the reciprocal of positive zero gives [+Inf, +Inf, +Inf, +Inf];
23635bd8deadSopenharmony_ci    and the reciprocal of positive infinity gives [0.0, 0.0, 0.0, 0.0].
23645bd8deadSopenharmony_ci
23655bd8deadSopenharmony_ci        t.x = source0.c;
23665bd8deadSopenharmony_ci        if (negate0) {
23675bd8deadSopenharmony_ci          t.x = -t.x;
23685bd8deadSopenharmony_ci        }
23695bd8deadSopenharmony_ci        if (t.x == 1.0f) {
23705bd8deadSopenharmony_ci          u.x = 1.0f;
23715bd8deadSopenharmony_ci        } else {
23725bd8deadSopenharmony_ci          u.x = 1.0f / t.x;
23735bd8deadSopenharmony_ci        }
23745bd8deadSopenharmony_ci        if (xmask) destination.x = u.x;
23755bd8deadSopenharmony_ci        if (ymask) destination.y = u.x;
23765bd8deadSopenharmony_ci        if (zmask) destination.z = u.x;
23775bd8deadSopenharmony_ci        if (wmask) destination.w = u.x;
23785bd8deadSopenharmony_ci
23795bd8deadSopenharmony_ci    where
23805bd8deadSopenharmony_ci
23815bd8deadSopenharmony_ci        | u.x - IEEE(1.0f/t.x) | < 1.0f/(2^22)
23825bd8deadSopenharmony_ci
23835bd8deadSopenharmony_ci    for 1.0f <= t.x <= 2.0f.  The intent of this precision requirement is
23845bd8deadSopenharmony_ci    that this amount of relative precision apply over all values of t.x.
23855bd8deadSopenharmony_ci
23865bd8deadSopenharmony_ci    2.14.1.10.7  RSQ: Reciprocal Square Root
23875bd8deadSopenharmony_ci
23885bd8deadSopenharmony_ci    The RSQ instruction assigns the inverse square root of the
23895bd8deadSopenharmony_ci    absolute value of the source scalar into the destination register.
23905bd8deadSopenharmony_ci
23915bd8deadSopenharmony_ci    Additionally, RSQ(0.0) gives [+Inf, +Inf, +Inf, +Inf]; and both
23925bd8deadSopenharmony_ci    RSQ(+Inf) and RSQ(-Inf) give [0.0, 0.0, 0.0, 0.0];
23935bd8deadSopenharmony_ci
23945bd8deadSopenharmony_ci        t.x = source0.c;
23955bd8deadSopenharmony_ci        if (negate0) {
23965bd8deadSopenharmony_ci          t.x = -t.x;
23975bd8deadSopenharmony_ci        }
23985bd8deadSopenharmony_ci        u.x = 1.0f / sqrt(fabs(t.x));
23995bd8deadSopenharmony_ci        if (xmask) destination.x = u.x;
24005bd8deadSopenharmony_ci        if (ymask) destination.y = u.x;
24015bd8deadSopenharmony_ci        if (zmask) destination.z = u.x;
24025bd8deadSopenharmony_ci        if (wmask) destination.w = u.x;
24035bd8deadSopenharmony_ci
24045bd8deadSopenharmony_ci    where
24055bd8deadSopenharmony_ci
24065bd8deadSopenharmony_ci        | u.x - IEEE(1.0f/sqrt(fabs(t.x))) | < 1.0f/(2^22)
24075bd8deadSopenharmony_ci
24085bd8deadSopenharmony_ci    for 1.0f <= t.x <= 4.0f.  The intent of this precision requirement is
24095bd8deadSopenharmony_ci    that this amount of relative precision apply over all values of t.x.
24105bd8deadSopenharmony_ci
24115bd8deadSopenharmony_ci    2.14.1.10.8  DP3: Three-Component Dot Product
24125bd8deadSopenharmony_ci
24135bd8deadSopenharmony_ci    The DP3 instruction assigns the three-component dot product of the
24145bd8deadSopenharmony_ci    two source vectors into the destination register.
24155bd8deadSopenharmony_ci
24165bd8deadSopenharmony_ci        t.x = source0.c***;
24175bd8deadSopenharmony_ci        t.y = source0.*c**;
24185bd8deadSopenharmony_ci        t.z = source0.**c*;
24195bd8deadSopenharmony_ci        if (negate0) {
24205bd8deadSopenharmony_ci          t.x = -t.x;
24215bd8deadSopenharmony_ci          t.y = -t.y;
24225bd8deadSopenharmony_ci          t.z = -t.z;
24235bd8deadSopenharmony_ci        }
24245bd8deadSopenharmony_ci        u.x = source1.c***;
24255bd8deadSopenharmony_ci        u.y = source1.*c**;
24265bd8deadSopenharmony_ci        u.z = source1.**c*;
24275bd8deadSopenharmony_ci        if (negate1) {
24285bd8deadSopenharmony_ci          u.x = -u.x;
24295bd8deadSopenharmony_ci          u.y = -u.y;
24305bd8deadSopenharmony_ci          u.z = -u.z;
24315bd8deadSopenharmony_ci        }
24325bd8deadSopenharmony_ci        v.x = t.x * u.x + t.y * u.y + t.z * u.z;
24335bd8deadSopenharmony_ci        if (xmask) destination.x = v.x;
24345bd8deadSopenharmony_ci        if (ymask) destination.y = v.x;
24355bd8deadSopenharmony_ci        if (zmask) destination.z = v.x;
24365bd8deadSopenharmony_ci        if (wmask) destination.w = v.x;
24375bd8deadSopenharmony_ci
24385bd8deadSopenharmony_ci    2.14.1.10.9  DP4: Four-Component Dot Product
24395bd8deadSopenharmony_ci
24405bd8deadSopenharmony_ci    The DP4 instruction assigns the four-component dot product of the
24415bd8deadSopenharmony_ci    two source vectors into the destination register.
24425bd8deadSopenharmony_ci
24435bd8deadSopenharmony_ci        t.x = source0.c***;
24445bd8deadSopenharmony_ci        t.y = source0.*c**;
24455bd8deadSopenharmony_ci        t.z = source0.**c*;
24465bd8deadSopenharmony_ci        t.w = source0.***c;
24475bd8deadSopenharmony_ci        if (negate0) {
24485bd8deadSopenharmony_ci          t.x = -t.x;
24495bd8deadSopenharmony_ci          t.y = -t.y;
24505bd8deadSopenharmony_ci          t.z = -t.z;
24515bd8deadSopenharmony_ci          t.w = -t.w;
24525bd8deadSopenharmony_ci        }
24535bd8deadSopenharmony_ci        u.x = source1.c***;
24545bd8deadSopenharmony_ci        u.y = source1.*c**;
24555bd8deadSopenharmony_ci        u.z = source1.**c*;
24565bd8deadSopenharmony_ci        u.w = source1.***c;
24575bd8deadSopenharmony_ci        if (negate1) {
24585bd8deadSopenharmony_ci          u.x = -u.x;
24595bd8deadSopenharmony_ci          u.y = -u.y;
24605bd8deadSopenharmony_ci          u.z = -u.z;
24615bd8deadSopenharmony_ci          u.w = -u.w;
24625bd8deadSopenharmony_ci        }
24635bd8deadSopenharmony_ci        v.x = t.x * u.x + t.y * u.y + t.z * u.z + t.w * u.w;
24645bd8deadSopenharmony_ci        if (xmask) destination.x = v.x;
24655bd8deadSopenharmony_ci        if (ymask) destination.y = v.x;
24665bd8deadSopenharmony_ci        if (zmask) destination.z = v.x;
24675bd8deadSopenharmony_ci        if (wmask) destination.w = v.x;
24685bd8deadSopenharmony_ci
24695bd8deadSopenharmony_ci    2.14.1.10.10  DST: Distance Vector
24705bd8deadSopenharmony_ci
24715bd8deadSopenharmony_ci    The DST instructions calculates a distance vector for the values
24725bd8deadSopenharmony_ci    of two source vectors.  The first vector is assumed to be [NA, d*d,
24735bd8deadSopenharmony_ci    d*d, NA] and the second source vector is assumed to be [NA, 1.0/d,
24745bd8deadSopenharmony_ci    NA, 1.0/d], where the value of a component labeled NA is undefined.
24755bd8deadSopenharmony_ci    The destination vector is then assigned [1,d,d*d,1.0/d].
24765bd8deadSopenharmony_ci
24775bd8deadSopenharmony_ci        t.y = source0.*c**;
24785bd8deadSopenharmony_ci        t.z = source0.**c*;
24795bd8deadSopenharmony_ci        if (negate0) {
24805bd8deadSopenharmony_ci          t.y = -t.y;
24815bd8deadSopenharmony_ci          t.z = -t.z;
24825bd8deadSopenharmony_ci        }
24835bd8deadSopenharmony_ci        u.y = source1.*c**;
24845bd8deadSopenharmony_ci        u.w = source1.***c;
24855bd8deadSopenharmony_ci        if (negate1) {
24865bd8deadSopenharmony_ci          u.y = -u.y;
24875bd8deadSopenharmony_ci          u.w = -u.w;
24885bd8deadSopenharmony_ci        }
24895bd8deadSopenharmony_ci        if (xmask) destination.x = 1.0;
24905bd8deadSopenharmony_ci        if (ymask) destination.y = t.y*u.y;
24915bd8deadSopenharmony_ci        if (zmask) destination.z = t.z;
24925bd8deadSopenharmony_ci        if (wmask) destination.w = u.w;
24935bd8deadSopenharmony_ci
24945bd8deadSopenharmony_ci    2.14.1.10.11  MIN: Minimum
24955bd8deadSopenharmony_ci
24965bd8deadSopenharmony_ci    The MIN instruction assigns the component-wise minimum of the two
24975bd8deadSopenharmony_ci    source vectors into the destination register.
24985bd8deadSopenharmony_ci
24995bd8deadSopenharmony_ci        t.x = source0.c***;
25005bd8deadSopenharmony_ci        t.y = source0.*c**;
25015bd8deadSopenharmony_ci        t.z = source0.**c*;
25025bd8deadSopenharmony_ci        t.w = source0.***c;
25035bd8deadSopenharmony_ci        if (negate0) {
25045bd8deadSopenharmony_ci          t.x = -t.x;
25055bd8deadSopenharmony_ci          t.y = -t.y;
25065bd8deadSopenharmony_ci          t.z = -t.z;
25075bd8deadSopenharmony_ci          t.w = -t.w;
25085bd8deadSopenharmony_ci        }
25095bd8deadSopenharmony_ci        u.x = source1.c***;
25105bd8deadSopenharmony_ci        u.y = source1.*c**;
25115bd8deadSopenharmony_ci        u.z = source1.**c*;
25125bd8deadSopenharmony_ci        u.w = source1.***c;
25135bd8deadSopenharmony_ci        if (negate1) {
25145bd8deadSopenharmony_ci          u.x = -u.x;
25155bd8deadSopenharmony_ci          u.y = -u.y;
25165bd8deadSopenharmony_ci          u.z = -u.z;
25175bd8deadSopenharmony_ci          u.w = -u.w;
25185bd8deadSopenharmony_ci        }
25195bd8deadSopenharmony_ci        if (xmask) destination.x = (t.x < u.x) ? t.x : u.x;
25205bd8deadSopenharmony_ci        if (ymask) destination.y = (t.y < u.y) ? t.y : u.y;
25215bd8deadSopenharmony_ci        if (zmask) destination.z = (t.z < u.z) ? t.z : u.z;
25225bd8deadSopenharmony_ci        if (wmask) destination.w = (t.w < u.w) ? t.w : u.w;
25235bd8deadSopenharmony_ci
25245bd8deadSopenharmony_ci    2.14.1.10.12  MAX: Maximum
25255bd8deadSopenharmony_ci
25265bd8deadSopenharmony_ci    The MAX instruction assigns the component-wise maximum of the two
25275bd8deadSopenharmony_ci    source vectors into the destination register.
25285bd8deadSopenharmony_ci
25295bd8deadSopenharmony_ci        t.x = source0.c***;
25305bd8deadSopenharmony_ci        t.y = source0.*c**;
25315bd8deadSopenharmony_ci        t.z = source0.**c*;
25325bd8deadSopenharmony_ci        t.w = source0.***c;
25335bd8deadSopenharmony_ci        if (negate0) {
25345bd8deadSopenharmony_ci          t.x = -t.x;
25355bd8deadSopenharmony_ci          t.y = -t.y;
25365bd8deadSopenharmony_ci          t.z = -t.z;
25375bd8deadSopenharmony_ci          t.w = -t.w;
25385bd8deadSopenharmony_ci        }
25395bd8deadSopenharmony_ci        u.x = source1.c***;
25405bd8deadSopenharmony_ci        u.y = source1.*c**;
25415bd8deadSopenharmony_ci        u.z = source1.**c*;
25425bd8deadSopenharmony_ci        u.w = source1.***c;
25435bd8deadSopenharmony_ci        if (negate1) {
25445bd8deadSopenharmony_ci          u.x = -u.x;
25455bd8deadSopenharmony_ci          u.y = -u.y;
25465bd8deadSopenharmony_ci          u.z = -u.z;
25475bd8deadSopenharmony_ci          u.w = -u.w;
25485bd8deadSopenharmony_ci        }
25495bd8deadSopenharmony_ci        if (xmask) destination.x = (t.x >= u.x) ? t.x : u.x;
25505bd8deadSopenharmony_ci        if (ymask) destination.y = (t.y >= u.y) ? t.y : u.y;
25515bd8deadSopenharmony_ci        if (zmask) destination.z = (t.z >= u.z) ? t.z : u.z;
25525bd8deadSopenharmony_ci        if (wmask) destination.w = (t.w >= u.w) ? t.w : u.w;
25535bd8deadSopenharmony_ci
25545bd8deadSopenharmony_ci    2.14.1.10.13  SLT: Set On Less Than
25555bd8deadSopenharmony_ci
25565bd8deadSopenharmony_ci    The SLT instruction performs a component-wise assignment of either
25575bd8deadSopenharmony_ci    1.0 or 0.0 into the destination register.  1.0 is assigned if the
25585bd8deadSopenharmony_ci    value of the first source vector is less than the value of the second
25595bd8deadSopenharmony_ci    source vector; otherwise, 0.0 is assigned.
25605bd8deadSopenharmony_ci
25615bd8deadSopenharmony_ci        t.x = source0.c***;
25625bd8deadSopenharmony_ci        t.y = source0.*c**;
25635bd8deadSopenharmony_ci        t.z = source0.**c*;
25645bd8deadSopenharmony_ci        t.w = source0.***c;
25655bd8deadSopenharmony_ci        if (negate0) {
25665bd8deadSopenharmony_ci          t.x = -t.x;
25675bd8deadSopenharmony_ci          t.y = -t.y;
25685bd8deadSopenharmony_ci          t.z = -t.z;
25695bd8deadSopenharmony_ci          t.w = -t.w;
25705bd8deadSopenharmony_ci        }
25715bd8deadSopenharmony_ci        u.x = source1.c***;
25725bd8deadSopenharmony_ci        u.y = source1.*c**;
25735bd8deadSopenharmony_ci        u.z = source1.**c*;
25745bd8deadSopenharmony_ci        u.w = source1.***c;
25755bd8deadSopenharmony_ci        if (negate1) {
25765bd8deadSopenharmony_ci          u.x = -u.x;
25775bd8deadSopenharmony_ci          u.y = -u.y;
25785bd8deadSopenharmony_ci          u.z = -u.z;
25795bd8deadSopenharmony_ci          u.w = -u.w;
25805bd8deadSopenharmony_ci        }
25815bd8deadSopenharmony_ci        if (xmask) destination.x = (t.x < u.x) ? 1.0 : 0.0;
25825bd8deadSopenharmony_ci        if (ymask) destination.y = (t.y < u.y) ? 1.0 : 0.0;
25835bd8deadSopenharmony_ci        if (zmask) destination.z = (t.z < u.z) ? 1.0 : 0.0;
25845bd8deadSopenharmony_ci        if (wmask) destination.w = (t.w < u.w) ? 1.0 : 0.0;
25855bd8deadSopenharmony_ci
25865bd8deadSopenharmony_ci    2.14.1.10.14  SGE: Set On Greater or Equal Than
25875bd8deadSopenharmony_ci
25885bd8deadSopenharmony_ci    The SGE instruction performs a component-wise assignment of either
25895bd8deadSopenharmony_ci    1.0 or 0.0 into the destination register.  1.0 is assigned if the
25905bd8deadSopenharmony_ci    value of the first source vector is greater than or equal the value
25915bd8deadSopenharmony_ci    of the second source vector; otherwise, 0.0 is assigned.
25925bd8deadSopenharmony_ci
25935bd8deadSopenharmony_ci        t.x = source0.c***;
25945bd8deadSopenharmony_ci        t.y = source0.*c**;
25955bd8deadSopenharmony_ci        t.z = source0.**c*;
25965bd8deadSopenharmony_ci        t.w = source0.***c;
25975bd8deadSopenharmony_ci        if (negate0) {
25985bd8deadSopenharmony_ci          t.x = -t.x;
25995bd8deadSopenharmony_ci          t.y = -t.y;
26005bd8deadSopenharmony_ci          t.z = -t.z;
26015bd8deadSopenharmony_ci          t.w = -t.w;
26025bd8deadSopenharmony_ci        }
26035bd8deadSopenharmony_ci        u.x = source1.c***;
26045bd8deadSopenharmony_ci        u.y = source1.*c**;
26055bd8deadSopenharmony_ci        u.z = source1.**c*;
26065bd8deadSopenharmony_ci        u.w = source1.***c;
26075bd8deadSopenharmony_ci        if (negate1) {
26085bd8deadSopenharmony_ci          u.x = -u.x;
26095bd8deadSopenharmony_ci          u.y = -u.y;
26105bd8deadSopenharmony_ci          u.z = -u.z;
26115bd8deadSopenharmony_ci          u.w = -u.w;
26125bd8deadSopenharmony_ci        }
26135bd8deadSopenharmony_ci        if (xmask) destination.x = (t.x >= u.x) ? 1.0 : 0.0;
26145bd8deadSopenharmony_ci        if (ymask) destination.y = (t.y >= u.y) ? 1.0 : 0.0;
26155bd8deadSopenharmony_ci        if (zmask) destination.z = (t.z >= u.z) ? 1.0 : 0.0;
26165bd8deadSopenharmony_ci        if (wmask) destination.w = (t.w >= u.w) ? 1.0 : 0.0;
26175bd8deadSopenharmony_ci
26185bd8deadSopenharmony_ci    2.14.1.10.15  EXP: Exponential Base 2
26195bd8deadSopenharmony_ci
26205bd8deadSopenharmony_ci    The EXP instruction generates an approximation of the exponential base
26215bd8deadSopenharmony_ci    2 for the value of a source scalar.  This approximation is assigned
26225bd8deadSopenharmony_ci    to the z component of the destination register.  Additionally,
26235bd8deadSopenharmony_ci    the x and y components of the destination register are assigned
26245bd8deadSopenharmony_ci    values useful for determining a more accurate approximation.  The
26255bd8deadSopenharmony_ci    exponential base 2 of the source scalar can be better approximated
26265bd8deadSopenharmony_ci    by destination.x*FUNC(destination.y) where FUNC is some user
26275bd8deadSopenharmony_ci    approximation (presumably implemented by subsequent instructions in
26285bd8deadSopenharmony_ci    the vertex program) to 2^destination.y where 0.0 <= destination.y <
26295bd8deadSopenharmony_ci    1.0.
26305bd8deadSopenharmony_ci
26315bd8deadSopenharmony_ci    Additionally, EXP(-Inf) or if the exponential result underflows
26325bd8deadSopenharmony_ci    gives [0.0, 0.0, 0.0, 1.0]; and EXP(+Inf) or if the exponential result
26335bd8deadSopenharmony_ci    overflows gives [+Inf, 0.0, +Inf, 1.0].
26345bd8deadSopenharmony_ci
26355bd8deadSopenharmony_ci        t.x = source0.c;
26365bd8deadSopenharmony_ci        if (negate0) {
26375bd8deadSopenharmony_ci          t.x = -t.x;
26385bd8deadSopenharmony_ci        }
26395bd8deadSopenharmony_ci        q.x = 2^floor(t.x);
26405bd8deadSopenharmony_ci        q.y = t.x - floor(t.x);
26415bd8deadSopenharmony_ci        q.z = q.x * APPX(q.y);
26425bd8deadSopenharmony_ci        if (xmask) destination.x = q.x;
26435bd8deadSopenharmony_ci        if (ymask) destination.y = q.y;
26445bd8deadSopenharmony_ci        if (zmask) destination.z = q.z;
26455bd8deadSopenharmony_ci        if (wmask) destination.w = 1.0;
26465bd8deadSopenharmony_ci
26475bd8deadSopenharmony_ci    where APPX is an implementation dependent approximation of exponential
26485bd8deadSopenharmony_ci    base 2 such that
26495bd8deadSopenharmony_ci
26505bd8deadSopenharmony_ci        | exp(q.y*log(2.0))-APPX(q.y) | < 1/(2^11)
26515bd8deadSopenharmony_ci
26525bd8deadSopenharmony_ci    for all 0 <= q.y < 1.0.
26535bd8deadSopenharmony_ci
26545bd8deadSopenharmony_ci    The expression "2^floor(t.x)" should overflow to +Inf and underflow
26555bd8deadSopenharmony_ci    to zero.
26565bd8deadSopenharmony_ci
26575bd8deadSopenharmony_ci    2.14.1.10.16  LOG: Logarithm Base 2
26585bd8deadSopenharmony_ci
26595bd8deadSopenharmony_ci    The LOG instruction generates an approximation of the logarithm base
26605bd8deadSopenharmony_ci    2 for the absolute value of a source scalar.  This approximation
26615bd8deadSopenharmony_ci    is assigned to the z component of the destination register.
26625bd8deadSopenharmony_ci    Additionally, the x and y components of the destination register are
26635bd8deadSopenharmony_ci    assigned values useful for determining a more accurate approximation.
26645bd8deadSopenharmony_ci    The logarithm base 2 of the absolute value of the source scalar
26655bd8deadSopenharmony_ci    can be better approximated by destination.x+FUNC(destination.y)
26665bd8deadSopenharmony_ci    where FUNC is some user approximation (presumably implemented by
26675bd8deadSopenharmony_ci    subsequent instructions in the vertex program) of log2(destination.y)
26685bd8deadSopenharmony_ci    where 1.0 <= destination.y < 2.0.
26695bd8deadSopenharmony_ci
26705bd8deadSopenharmony_ci    Additionally, LOG(0.0) gives [-Inf, 1.0, -Inf, 1.0]; and both
26715bd8deadSopenharmony_ci    LOG(+Inf) and LOG(-Inf) give [+Inf, 1.0, +Inf, 1.0].
26725bd8deadSopenharmony_ci
26735bd8deadSopenharmony_ci        t.x = source0.c;
26745bd8deadSopenharmony_ci        if (negate0) {
26755bd8deadSopenharmony_ci          t.x = -t.x;
26765bd8deadSopenharmony_ci        }
26775bd8deadSopenharmony_ci        if (fabs(t.x) != 0.0f) {
26785bd8deadSopenharmony_ci          if (fabs(t.x) == +Inf) {
26795bd8deadSopenharmony_ci            q.x = +Inf;
26805bd8deadSopenharmony_ci            q.y = 1.0;
26815bd8deadSopenharmony_ci            q.z = +Inf;
26825bd8deadSopenharmony_ci          } else {
26835bd8deadSopenharmony_ci            q.x = Exponent(t.x);
26845bd8deadSopenharmony_ci            q.y = Mantissa(t.x);
26855bd8deadSopenharmony_ci            q.z = q.x + APPX(q.y);
26865bd8deadSopenharmony_ci          }
26875bd8deadSopenharmony_ci        } else {
26885bd8deadSopenharmony_ci          q.x = -Inf;
26895bd8deadSopenharmony_ci          q.y = 1.0;
26905bd8deadSopenharmony_ci          q.z = -Inf;
26915bd8deadSopenharmony_ci        }
26925bd8deadSopenharmony_ci        if (xmask) destination.x = q.x;
26935bd8deadSopenharmony_ci        if (ymask) destination.y = q.y;
26945bd8deadSopenharmony_ci        if (zmask) destination.z = q.z;
26955bd8deadSopenharmony_ci        if (wmask) destination.w = 1.0;
26965bd8deadSopenharmony_ci
26975bd8deadSopenharmony_ci    where APPX is an implementation dependent approximation of logarithm
26985bd8deadSopenharmony_ci    base 2 such that
26995bd8deadSopenharmony_ci    
27005bd8deadSopenharmony_ci        | log(q.y)/log(2.0) - APPX(q.y) | < 1/(2^11)
27015bd8deadSopenharmony_ci
27025bd8deadSopenharmony_ci    for all 1.0 <= q.y < 2.0.
27035bd8deadSopenharmony_ci
27045bd8deadSopenharmony_ci    The "Exponent(t.x)" function returns the unbiased exponent between
27055bd8deadSopenharmony_ci    -126 and 127.  For example, "Exponent(1.0)" equals 0.0.  (Note that
27065bd8deadSopenharmony_ci    the IEEE floating-point representation maintains the exponent as a
27075bd8deadSopenharmony_ci    biased value.) Larger or smaller exponents should generate +Inf or
27085bd8deadSopenharmony_ci    -Inf respectively.  The "Mantissa(t.x)" function returns a value
27095bd8deadSopenharmony_ci    in the range [1.0f, 2.0).  The intent of these functions is that
27105bd8deadSopenharmony_ci    fabs(t.x) is approximately "Mantissa(t.x)*2^Exponent(t.x)".
27115bd8deadSopenharmony_ci
27125bd8deadSopenharmony_ci    2.14.1.10.17  LIT: Light Coefficients
27135bd8deadSopenharmony_ci
27145bd8deadSopenharmony_ci    The LIT instruction is intended to compute ambient, diffuse,
27155bd8deadSopenharmony_ci    and specular lighting coefficients from a diffuse dot product,
27165bd8deadSopenharmony_ci    a specular dot product, and a specular power that is clamped to
27175bd8deadSopenharmony_ci    (-128,128) exclusive.  The x component of the source vector is
27185bd8deadSopenharmony_ci    assumed to contain a diffuse dot product (unit normal vector dotted
27195bd8deadSopenharmony_ci    with a unit light vector).  The y component of the source vector is
27205bd8deadSopenharmony_ci    assumed to contain a Blinn specular dot product (unit normal vector
27215bd8deadSopenharmony_ci    dotted with a unit half-angle vector).  The w component is assumed
27225bd8deadSopenharmony_ci    to contain a specular power.
27235bd8deadSopenharmony_ci
27245bd8deadSopenharmony_ci    An implementation must support at least 8 fraction bits in the
27255bd8deadSopenharmony_ci    specular power.  Note that because 0.0 times anything must be 0.0,
27265bd8deadSopenharmony_ci    taking any base to the power of 0.0 will yield 1.0.
27275bd8deadSopenharmony_ci
27285bd8deadSopenharmony_ci        t.x = source0.c***;
27295bd8deadSopenharmony_ci        t.y = source0.*c**;
27305bd8deadSopenharmony_ci        t.w = source0.***c;
27315bd8deadSopenharmony_ci        if (negate0) {
27325bd8deadSopenharmony_ci          t.x = -t.x;
27335bd8deadSopenharmony_ci          t.y = -t.y;
27345bd8deadSopenharmony_ci          t.w = -t.w;
27355bd8deadSopenharmony_ci        }
27365bd8deadSopenharmony_ci        if (t.w < -(128.0-epsilon)) t.w = -(128.0-epsilon);
27375bd8deadSopenharmony_ci        else if (t.w > 128-epsilon) t.w = 128-epsilon;
27385bd8deadSopenharmony_ci        if (t.x < 0.0) t.x = 0.0;
27395bd8deadSopenharmony_ci        if (t.y < 0.0) t.y = 0.0;
27405bd8deadSopenharmony_ci        if (xmask) destination.x = 1.0;
27415bd8deadSopenharmony_ci        if (ymask) destination.y = t.x;
27425bd8deadSopenharmony_ci        if (zmask) destination.z = (t.x > 0.0) ? EXP(t.w*LOG(t.y)) : 0.0;
27435bd8deadSopenharmony_ci        if (wmask) destination.w = 1.0;
27445bd8deadSopenharmony_ci
27455bd8deadSopenharmony_ci    where EXP and LOG are functions that approximate the exponential base
27465bd8deadSopenharmony_ci    2 and logarithm base 2 with the identical accuracy and special case
27475bd8deadSopenharmony_ci    requirements of the EXP and LOG instructions.  epsilon is 1.0/256.0
27485bd8deadSopenharmony_ci    or approximately 0.0039 which would correspond to representing the
27495bd8deadSopenharmony_ci    specular power with a s8.8 representation.
27505bd8deadSopenharmony_ci
27515bd8deadSopenharmony_ci    2.14.1.11  Vertex Program Floating Point Requirements
27525bd8deadSopenharmony_ci
27535bd8deadSopenharmony_ci    All vertex program calculations are assumed to use IEEE single
27545bd8deadSopenharmony_ci    precision floating-point math with a format of s1e8m23 (one signed
27555bd8deadSopenharmony_ci    bit, 8 bits of exponent, 23 bits of magnitude) or better and the
27565bd8deadSopenharmony_ci    round-to-zero rounding mode.  The only exceptions to this are the RCP,
27575bd8deadSopenharmony_ci    RSQ, LOG, EXP, and LIT instructions.
27585bd8deadSopenharmony_ci
27595bd8deadSopenharmony_ci    Note that (positive or negative) 0.0 times anything is (positive)
27605bd8deadSopenharmony_ci    0.0.
27615bd8deadSopenharmony_ci
27625bd8deadSopenharmony_ci    The RCP and RSQ instructions deliver results accurate to 1.0/(2^22)
27635bd8deadSopenharmony_ci    and the approximate output (the z component) of the EXP and LOG
27645bd8deadSopenharmony_ci    instructions only has to be accurate to 1.0/(2^11).  The LIT
27655bd8deadSopenharmony_ci    instruction specular output (the z component) is allowed an error
27665bd8deadSopenharmony_ci    equivalent to the combination of the EXP and LOG combination to
27675bd8deadSopenharmony_ci    implement a power function.
27685bd8deadSopenharmony_ci
27695bd8deadSopenharmony_ci    The floor operations used by the ARL and EXP instructions must
27705bd8deadSopenharmony_ci    operate identically.  Specifically, the EXP instruction's floor(t.x)
27715bd8deadSopenharmony_ci    intermediate result must exactly match the integer stored in the
27725bd8deadSopenharmony_ci    address register by the ARL instruction.
27735bd8deadSopenharmony_ci
27745bd8deadSopenharmony_ci    Since distance is calculated as (d^2)*(1/sqrt(d^2)), 0.0 multiplied
27755bd8deadSopenharmony_ci    by anything must be 0.0.  This affects the MUL, MAD, DP3, DP4, DST,
27765bd8deadSopenharmony_ci    and LIT instructions.
27775bd8deadSopenharmony_ci
27785bd8deadSopenharmony_ci    Because if/then/else conditional evaluation is done by multiplying
27795bd8deadSopenharmony_ci    by 1.0 or 0.0 and adding, the floating point computations require:
27805bd8deadSopenharmony_ci
27815bd8deadSopenharmony_ci      0.0 * x = 0.0    for all x (including +Inf, -Inf, +NaN, and -NaN)
27825bd8deadSopenharmony_ci      1.0 * x = x      for all x (including +Inf and -Inf)
27835bd8deadSopenharmony_ci      0.0 + x = x      for all x (including +Inf and -Inf)
27845bd8deadSopenharmony_ci
27855bd8deadSopenharmony_ci    Including +Inf, -Inf, +NaN, and -NaN when applying the above three
27865bd8deadSopenharmony_ci    rules is recommended but not required.  (The recommended inclusion
27875bd8deadSopenharmony_ci    of +Inf, -Inf, +NaN, and -NaN when applying the first rule is
27885bd8deadSopenharmony_ci    inconsistent with IEEE floating-point requirements.)
27895bd8deadSopenharmony_ci
27905bd8deadSopenharmony_ci    For the purpose of comparisons performed by the SGE and SLT
27915bd8deadSopenharmony_ci    instructions, -0.0 is less than +0.0, -NaN is less than -Inf,
27925bd8deadSopenharmony_ci    and +NaN is greater than +Inf.  (This is inconsistent with IEEE
27935bd8deadSopenharmony_ci    floating-point requirements).
27945bd8deadSopenharmony_ci
27955bd8deadSopenharmony_ci    No floating-point exceptions or interrupts are generated.  Denorms
27965bd8deadSopenharmony_ci    are not supported; if a denorm is input, it is treated as 0.0 (ie,
27975bd8deadSopenharmony_ci    denorms are flushed to zero).
27985bd8deadSopenharmony_ci
27995bd8deadSopenharmony_ci    Computations involving +NaN or -NaN generate +NaN, except for the
28005bd8deadSopenharmony_ci    requirement that zero times +NaN or -NaN must always be zero.  (This
28015bd8deadSopenharmony_ci    exception is inconsistent with IEEE floating-point requirements).
28025bd8deadSopenharmony_ci
28035bd8deadSopenharmony_ci    2.14.2  Vertex Program Update for the Current Raster Position
28045bd8deadSopenharmony_ci
28055bd8deadSopenharmony_ci    When vertex programs are enabled, the raster position is determined
28065bd8deadSopenharmony_ci    by the current vertex program.  The raster position specified by
28075bd8deadSopenharmony_ci    RasterPos is treated as if they were specified in a Vertex command.
28085bd8deadSopenharmony_ci    The contents of vertex result register set is used to update respective
28095bd8deadSopenharmony_ci    raster position state.
28105bd8deadSopenharmony_ci
28115bd8deadSopenharmony_ci    Assuming an existent program, the homogeneous clip-space coordinates
28125bd8deadSopenharmony_ci    are passed to clipping as if they represented a point and assuming no
28135bd8deadSopenharmony_ci    client-defined clip planes are enabled.  If the point is not culled,
28145bd8deadSopenharmony_ci    then the projection to window coordinates is computed (section 2.10)
28155bd8deadSopenharmony_ci    and saved as the current raster position and the valid bit is set.
28165bd8deadSopenharmony_ci    If the current vertex program is nonexistent or the "point" is
28175bd8deadSopenharmony_ci    culled, the current raster position and its associated data become
28185bd8deadSopenharmony_ci    indeterminate and the raster position valid bit is cleared.
28195bd8deadSopenharmony_ci
28205bd8deadSopenharmony_ci    2.14.3  Vertex Arrays for Vertex Attributes
28215bd8deadSopenharmony_ci
28225bd8deadSopenharmony_ci    Data for vertex attributes in vertex program mode may be specified
28235bd8deadSopenharmony_ci    using vertex array commands.  The client may specify and enable any
28245bd8deadSopenharmony_ci    of sixteen vertex attribute arrays.
28255bd8deadSopenharmony_ci
28265bd8deadSopenharmony_ci    The vertex attribute arrays are ignored when vertex program mode
28275bd8deadSopenharmony_ci    is disabled.  When vertex program mode is enabled, vertex attribute
28285bd8deadSopenharmony_ci    arrays are used.
28295bd8deadSopenharmony_ci
28305bd8deadSopenharmony_ci    The command
28315bd8deadSopenharmony_ci
28325bd8deadSopenharmony_ci      void VertexAttribPointerNV(uint index, int size, enum type,
28335bd8deadSopenharmony_ci                                 sizei stride, const void *pointer);
28345bd8deadSopenharmony_ci
28355bd8deadSopenharmony_ci    describes the locations and organizations of the sixteen vertex
28365bd8deadSopenharmony_ci    attribute arrays.  index specifies the particular vertex attribute
28375bd8deadSopenharmony_ci    to be described.  size indicates the number of values per vertex
28385bd8deadSopenharmony_ci    that are stored in the array; size must be one of 1, 2, 3, or 4.
28395bd8deadSopenharmony_ci    type specifies the data type of the values stored in the array.
28405bd8deadSopenharmony_ci    type must be one of SHORT, FLOAT, DOUBLE, or UNSIGNED_BYTE and these
28415bd8deadSopenharmony_ci    values correspond to the array types short, int, float, double, and
28425bd8deadSopenharmony_ci    ubyte respectively.  The INVALID_OPERATION error is generated if
28435bd8deadSopenharmony_ci    type is UNSIGNED_BYTE and size is not 4.  The INVALID_VALUE error
28445bd8deadSopenharmony_ci    is generated if index is greater than 15.  The INVALID_VALUE error
28455bd8deadSopenharmony_ci    is generated if stride is negative.
28465bd8deadSopenharmony_ci
28475bd8deadSopenharmony_ci    The one, two, three, or four values in an array that correspond to a
28485bd8deadSopenharmony_ci    single vertex attribute comprise an array element.  The values within
28495bd8deadSopenharmony_ci    each array element at stored sequentially in memory.  If the stride
28505bd8deadSopenharmony_ci    is specified as zero, then array elements are stored sequentially
28515bd8deadSopenharmony_ci    as well.  Otherwise points to the ith and (i+1)st elements of an array
28525bd8deadSopenharmony_ci    differ by stride basic machine units (typically unsigned bytes),
28535bd8deadSopenharmony_ci    the pointer to the (i+1)st element being greater.  pointer specifies
28545bd8deadSopenharmony_ci    the location in memory of the first value of the first element of
28555bd8deadSopenharmony_ci    the array being specified.
28565bd8deadSopenharmony_ci
28575bd8deadSopenharmony_ci    Vertex attribute arrays are enabled with the EnableClientState command
28585bd8deadSopenharmony_ci    and disabled with the DisableClientState command.  The value of the
28595bd8deadSopenharmony_ci    argument to either command is VERTEX_ATTRIB_ARRAYi_NV where i is an
28605bd8deadSopenharmony_ci    integer between 0 and 15; specifying a value of i enables or
28615bd8deadSopenharmony_ci    disables the vertex attribute array with index i.  The constants
28625bd8deadSopenharmony_ci    obey VERTEX_ATTRIB_ARRAYi_NV = VERTEX_ATTRIB_ARRAY0_NV + i.
28635bd8deadSopenharmony_ci
28645bd8deadSopenharmony_ci    When vertex program mode is enabled, the ArrayElement command operates
28655bd8deadSopenharmony_ci    as described in this section in contrast to the behavior described
28665bd8deadSopenharmony_ci    in section 2.8.  Likewise, any vertex array transfer commands that
28675bd8deadSopenharmony_ci    are defined in terms of ArrayElement (DrawArrays, DrawElements, and
28685bd8deadSopenharmony_ci    DrawRangeElements) assume the operation of ArrayElement described
28695bd8deadSopenharmony_ci    in this section when vertex program mode is enabled.
28705bd8deadSopenharmony_ci
28715bd8deadSopenharmony_ci    When vertex program mode is enabled, the ArrayElement command
28725bd8deadSopenharmony_ci    transfers the ith element of particular enabled vertex arrays as
28735bd8deadSopenharmony_ci    described below.  For each enabled vertex attribute array, it is
28745bd8deadSopenharmony_ci    as though the corresponding command from section 2.14.1.1 were
28755bd8deadSopenharmony_ci    called with a pointer to element i.  For each vertex attribute,
28765bd8deadSopenharmony_ci    the corresponding command is VertexAttrib[size][type]v, where size
28775bd8deadSopenharmony_ci    is one of [1,2,3,4], and type is one of [s,f,d,ub], corresponding
28785bd8deadSopenharmony_ci    to the array types short, int, float, double, and ubyte respectively.
28795bd8deadSopenharmony_ci
28805bd8deadSopenharmony_ci    However, if a given vertex attribute array is disabled, but its
28815bd8deadSopenharmony_ci    corresponding aliased conventional per-vertex parameter's vertex
28825bd8deadSopenharmony_ci    array (as described in section 2.14.1.6) is enabled, then it is
28835bd8deadSopenharmony_ci    as though the corresponding command from section 2.7 or section
28845bd8deadSopenharmony_ci    2.6.2 were called with a pointer to element i.  In this case, the
28855bd8deadSopenharmony_ci    corresponding command is determined as described in section 2.8's
28865bd8deadSopenharmony_ci    description of ArrayElement.
28875bd8deadSopenharmony_ci
28885bd8deadSopenharmony_ci    If the vertex attribute array 0 is enabled, it is as though
28895bd8deadSopenharmony_ci    VertexAttrib[size][type]v(0, ...) is executed last, after the
28905bd8deadSopenharmony_ci    executions of other corresponding commands.  If the vertex attribute
28915bd8deadSopenharmony_ci    array 0 is disabled but the vertex array is enabled, it is as though
28925bd8deadSopenharmony_ci    Vertex[size][type]v is executed last, after the executions of other
28935bd8deadSopenharmony_ci    corresponding commands.
28945bd8deadSopenharmony_ci
28955bd8deadSopenharmony_ci    2.14.4  Vertex State Programs
28965bd8deadSopenharmony_ci
28975bd8deadSopenharmony_ci    Vertex state programs share the same instruction set as and a similar
28985bd8deadSopenharmony_ci    execution model to vertex programs.  While vertex program are executed
28995bd8deadSopenharmony_ci    implicitly when a vertex transformation is provoked, vertex state
29005bd8deadSopenharmony_ci    programs are executed explicitly, independently of any vertices.
29015bd8deadSopenharmony_ci    Vertex state programs can write program parameter registers, but
29025bd8deadSopenharmony_ci    may not write vertex result registers.
29035bd8deadSopenharmony_ci
29045bd8deadSopenharmony_ci    The purpose of a vertex state program is to update program parameter
29055bd8deadSopenharmony_ci    registers by means of an application-defined program.  Typically,
29065bd8deadSopenharmony_ci    an application will load a set of program parameters and then execute
29075bd8deadSopenharmony_ci    a vertex state program that reads and updates the program parameter
29085bd8deadSopenharmony_ci    registers.  For example, a vertex state program might normalize a
29095bd8deadSopenharmony_ci    set of unnormalized vectors previously loaded as program parameters.
29105bd8deadSopenharmony_ci    The expectation is that subsequently executed vertex programs would
29115bd8deadSopenharmony_ci    use the normalized program parameters.
29125bd8deadSopenharmony_ci
29135bd8deadSopenharmony_ci    Vertex state programs are loaded with the same LoadProgramNV command
29145bd8deadSopenharmony_ci    (see section 2.14.1.7) used to load vertex programs except that the
29155bd8deadSopenharmony_ci    target must be VERTEX_STATE_PROGRAM_NV when loading a vertex state
29165bd8deadSopenharmony_ci    program.
29175bd8deadSopenharmony_ci
29185bd8deadSopenharmony_ci    Vertex state programs must conform to a more limited grammar than
29195bd8deadSopenharmony_ci    the grammar for vertex programs.  The vertex state program grammar
29205bd8deadSopenharmony_ci    for syntactically valid sequences is the same as the grammar defined
29215bd8deadSopenharmony_ci    in section 2.14.1.7 with the following modified rules:
29225bd8deadSopenharmony_ci
29235bd8deadSopenharmony_ci    <program>              ::= "!!VSP1.0" <instructionSequence> "END"
29245bd8deadSopenharmony_ci
29255bd8deadSopenharmony_ci    <dstReg>               ::= <absProgParamReg>
29265bd8deadSopenharmony_ci                             | <temporaryReg>
29275bd8deadSopenharmony_ci
29285bd8deadSopenharmony_ci    <vertexAttribReg>      ::= "v" "[" "0" "]"
29295bd8deadSopenharmony_ci
29305bd8deadSopenharmony_ci    A vertex state program fails to load if it does not write at least
29315bd8deadSopenharmony_ci    one program parameter register.
29325bd8deadSopenharmony_ci
29335bd8deadSopenharmony_ci    A vertex state program fails to load if it contains more than 128
29345bd8deadSopenharmony_ci    instructions.
29355bd8deadSopenharmony_ci
29365bd8deadSopenharmony_ci    A vertex state program fails to load if any instruction sources more
29375bd8deadSopenharmony_ci    than one unique program parameter register.
29385bd8deadSopenharmony_ci
29395bd8deadSopenharmony_ci    A vertex state program fails to load if any instruction sources
29405bd8deadSopenharmony_ci    more than one unique vertex attribute register (this is necessarily
29415bd8deadSopenharmony_ci    true because only vertex attribute 0 is available in vertex state
29425bd8deadSopenharmony_ci    programs).
29435bd8deadSopenharmony_ci
29445bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if a vertex state program
29455bd8deadSopenharmony_ci    fails to load because it is not syntactically correct or for one
29465bd8deadSopenharmony_ci    of the other reasons listed above.
29475bd8deadSopenharmony_ci
29485bd8deadSopenharmony_ci    A successfully loaded vertex state program is parsed into a sequence
29495bd8deadSopenharmony_ci    of instructions.  Each instruction is identified by its tokenized
29505bd8deadSopenharmony_ci    name.  The operation of these instructions when executed is defined
29515bd8deadSopenharmony_ci    in section 2.14.1.10.
29525bd8deadSopenharmony_ci
29535bd8deadSopenharmony_ci    Executing vertex state programs is legal only outside a Begin/End
29545bd8deadSopenharmony_ci    pair.  A vertex state program may not read any vertex attribute
29555bd8deadSopenharmony_ci    register other than register zero.  A vertex state program may not
29565bd8deadSopenharmony_ci    write any vertex result register.
29575bd8deadSopenharmony_ci
29585bd8deadSopenharmony_ci    The command
29595bd8deadSopenharmony_ci
29605bd8deadSopenharmony_ci      ExecuteProgramNV(enum target, uint id, const float *params);
29615bd8deadSopenharmony_ci
29625bd8deadSopenharmony_ci    executes the vertex state program named by id.  The target must be
29635bd8deadSopenharmony_ci    VERTEX_STATE_PROGRAM_NV and the id must be the name of program loaded
29645bd8deadSopenharmony_ci    with a target type of VERTEX_STATE_PROGRAM_NV.  params points to
29655bd8deadSopenharmony_ci    an array of four floating-point values that are loaded into vertex
29665bd8deadSopenharmony_ci    attribute register zero (the only vertex attribute readable from a
29675bd8deadSopenharmony_ci    vertex state program).
29685bd8deadSopenharmony_ci
29695bd8deadSopenharmony_ci    The INVALID_OPERATION error is generated if the named program is
29705bd8deadSopenharmony_ci    nonexistent, is invalid, or the program is not a vertex state
29715bd8deadSopenharmony_ci    program.  A vertex state program may not be valid for reasons
29725bd8deadSopenharmony_ci    explained in section 2.14.5.
29735bd8deadSopenharmony_ci
29745bd8deadSopenharmony_ci    2.14.5  Tracking Matrices 
29755bd8deadSopenharmony_ci
29765bd8deadSopenharmony_ci    As a convenience to applications, standard GL matrix state can be
29775bd8deadSopenharmony_ci    tracked into program parameter vectors.  This permits vertex programs
29785bd8deadSopenharmony_ci    to access matrices specified through GL matrix commands.
29795bd8deadSopenharmony_ci
29805bd8deadSopenharmony_ci    In addition to GL's conventional matrices, several additional matrices
29815bd8deadSopenharmony_ci    are available for tracking.  These matrices have names of the form
29825bd8deadSopenharmony_ci    MATRIXi_NV where i is between zero and n-1 where n is the value
29835bd8deadSopenharmony_ci    of the MAX_TRACK_MATRICES_NV implementation dependent constant.
29845bd8deadSopenharmony_ci    The MATRIXi_NV constants obey MATRIXi_NV = MATRIX0_NV + i.  The value
29855bd8deadSopenharmony_ci    of MAX_TRACK_MATRICES_NV must be at least eight.  The maximum
29865bd8deadSopenharmony_ci    stack depth for tracking matrices is defined by the
29875bd8deadSopenharmony_ci    MAX_TRACK_MATRIX_STACK_DEPTH_NV and must be at least 1.
29885bd8deadSopenharmony_ci
29895bd8deadSopenharmony_ci    The command
29905bd8deadSopenharmony_ci
29915bd8deadSopenharmony_ci      TrackMatrixNV(enum target, uint address, enum matrix, enum transform);
29925bd8deadSopenharmony_ci
29935bd8deadSopenharmony_ci    tracks a given transformed version of a particular matrix into
29945bd8deadSopenharmony_ci    a contiguous sequence of four vertex program parameter registers
29955bd8deadSopenharmony_ci    beginning at address.  target must be VERTEX_PROGRAM_NV (though
29965bd8deadSopenharmony_ci    tracked matrices apply to vertex state programs as well because both
29975bd8deadSopenharmony_ci    vertex state programs and vertex programs shared the same program
29985bd8deadSopenharmony_ci    parameter registers).  matrix must be one of NONE, MODELVIEW,
29995bd8deadSopenharmony_ci    PROJECTION, TEXTURE, TEXTUREi_ARB (where i is between 0 and n-1
30005bd8deadSopenharmony_ci    where n is the number of texture units supported), COLOR (if
30015bd8deadSopenharmony_ci    the ARB_imaging subset is supported), MODELVIEW_PROJECTION_NV,
30025bd8deadSopenharmony_ci    or MATRIXi_NV.  transform must be one of IDENTITY_NV, INVERSE_NV,
30035bd8deadSopenharmony_ci    TRANSPOSE_NV, or INVERSE_TRANSPOSE_NV.  The INVALID_VALUE error is
30045bd8deadSopenharmony_ci    generated if address is not a multiple of four.
30055bd8deadSopenharmony_ci
30065bd8deadSopenharmony_ci    The MODELVIEW_PROJECTION_NV matrix represents the concatenation of
30075bd8deadSopenharmony_ci    the current modelview and projection matrices.  If M is the current
30085bd8deadSopenharmony_ci    modelview matrix and P is the current projection matrix, then the
30095bd8deadSopenharmony_ci    MODELVIEW_PROJECTION_NV matrix is C and computed as
30105bd8deadSopenharmony_ci
30115bd8deadSopenharmony_ci        C = P M
30125bd8deadSopenharmony_ci
30135bd8deadSopenharmony_ci    Matrix tracking for the specified program parameter register and the
30145bd8deadSopenharmony_ci    next consecutive three registers is disabled when NONE is supplied
30155bd8deadSopenharmony_ci    for matrix.  When tracking is disabled the previously tracked program
30165bd8deadSopenharmony_ci    parameter registers retain the state of their last tracked values.
30175bd8deadSopenharmony_ci    Otherwise, the specified transformed version of matrix is tracked into
30185bd8deadSopenharmony_ci    the specified program parameter register and the next three registers.
30195bd8deadSopenharmony_ci    Whenever the matrix changes, the transformed version of the matrix
30205bd8deadSopenharmony_ci    is updated in the specified range of program parameter registers.
30215bd8deadSopenharmony_ci    If TEXTURE is specified for matrix, the texture matrix for the current
30225bd8deadSopenharmony_ci    active texture unit is tracked.  If TEXTUREi_ARB is specified for
30235bd8deadSopenharmony_ci    matrix, the <i>th texture matrix is tracked.
30245bd8deadSopenharmony_ci
30255bd8deadSopenharmony_ci    Matrices are tracked row-wise meaning that the top row of the
30265bd8deadSopenharmony_ci    transformed matrix is loaded into the program parameter address,
30275bd8deadSopenharmony_ci    the second from the top row of the transformed matrix is loaded into
30285bd8deadSopenharmony_ci    the program parameter address+1, the third from the top row of the
30295bd8deadSopenharmony_ci    transformed matrix is loaded into the program parameter address+2,
30305bd8deadSopenharmony_ci    and the bottom row of the transformed matrix is loaded into the
30315bd8deadSopenharmony_ci    program parameter address+3.  The transformed matrix may be identical
30325bd8deadSopenharmony_ci    to the specified matrix, the inverse of the specified matrix, the
30335bd8deadSopenharmony_ci    transpose of the specified matrix, or the inverse transpose of the
30345bd8deadSopenharmony_ci    specified matrix, depending on the value of transform.
30355bd8deadSopenharmony_ci
30365bd8deadSopenharmony_ci    When matrix tracking is enabled for a particular program parameter
30375bd8deadSopenharmony_ci    register sequence, updates to the program parameter using
30385bd8deadSopenharmony_ci    ProgramParameterNV commands, a vertex program, or a vertex state
30395bd8deadSopenharmony_ci    program are not possible.  The INVALID_OPERATION error is generated
30405bd8deadSopenharmony_ci    if a ProgramParameterNV command is used to update a program parameter
30415bd8deadSopenharmony_ci    register currently tracking a matrix.
30425bd8deadSopenharmony_ci
30435bd8deadSopenharmony_ci    The INVALID_OPERATION error is generated by ExecuteProgramNV when
30445bd8deadSopenharmony_ci    the vertex state program requested for execution writes to a program
30455bd8deadSopenharmony_ci    parameter register that is currently tracking a matrix because the
30465bd8deadSopenharmony_ci    program is considered invalid.
30475bd8deadSopenharmony_ci
30485bd8deadSopenharmony_ci    2.14.6  Required Vertex Program State 
30495bd8deadSopenharmony_ci
30505bd8deadSopenharmony_ci    The state required for vertex programs consists of:
30515bd8deadSopenharmony_ci
30525bd8deadSopenharmony_ci      a bit indicating whether or not program mode is enabled;
30535bd8deadSopenharmony_ci
30545bd8deadSopenharmony_ci      a bit indicating whether or not two-sided color mode is enabled;
30555bd8deadSopenharmony_ci
30565bd8deadSopenharmony_ci      a bit indicating whether or not program-specified point size mode
30575bd8deadSopenharmony_ci      is enabled;
30585bd8deadSopenharmony_ci
30595bd8deadSopenharmony_ci      96 4-component floating-point program parameter registers;
30605bd8deadSopenharmony_ci
30615bd8deadSopenharmony_ci      16 4-component vertex attribute registers (though this state is
30625bd8deadSopenharmony_ci      aliased with the current normal, primary color, secondary color,
30635bd8deadSopenharmony_ci      fog coordinate, weights, and texture coordinate sets);
30645bd8deadSopenharmony_ci
30655bd8deadSopenharmony_ci      24 sets of matrix tracking state for each set of four sequential
30665bd8deadSopenharmony_ci      program parameter registers, consisting of a n-valued integer
30675bd8deadSopenharmony_ci      indicated the tracked matrix or GL_NONE (where n is 5 + the number
30685bd8deadSopenharmony_ci      of texture units supported + the number of tracking matrices
30695bd8deadSopenharmony_ci      supported) and a four-valued integer indicating the transformation
30705bd8deadSopenharmony_ci      of the tracked matrix;
30715bd8deadSopenharmony_ci
30725bd8deadSopenharmony_ci      an unsigned integer naming the currently bound vertex program
30735bd8deadSopenharmony_ci
30745bd8deadSopenharmony_ci      and the state must be maintained to indicate which integers
30755bd8deadSopenharmony_ci      are currently in use as program names.
30765bd8deadSopenharmony_ci
30775bd8deadSopenharmony_ci   Each existent program object consists of a target, a boolean indicating
30785bd8deadSopenharmony_ci   whether the program is resident, an array of type ubyte containing the
30795bd8deadSopenharmony_ci   program string, and the length of the program string array.  Initially,
30805bd8deadSopenharmony_ci   no program objects exist.
30815bd8deadSopenharmony_ci
30825bd8deadSopenharmony_ci   Program mode, two-sided color mode, and program-specified point size
30835bd8deadSopenharmony_ci   mode are all initially disabled.
30845bd8deadSopenharmony_ci
30855bd8deadSopenharmony_ci   The initial state of all 96 program parameter registers is (0,0,0,0).
30865bd8deadSopenharmony_ci
30875bd8deadSopenharmony_ci   The initial state of the 16 vertex attribute registers is (0,0,0,1)
30885bd8deadSopenharmony_ci   except in cases where a vertex attribute register aliases to a
30895bd8deadSopenharmony_ci   conventional GL transform mode vertex parameter in which case
30905bd8deadSopenharmony_ci   the initial state is the initial state of the respective aliased
30915bd8deadSopenharmony_ci   conventional vertex parameter.
30925bd8deadSopenharmony_ci
30935bd8deadSopenharmony_ci   The initial state of the 24 sets of matrix tracking state is NONE
30945bd8deadSopenharmony_ci   for the tracked matrix and IDENTITY_NV for the transformation of the
30955bd8deadSopenharmony_ci   tracked matrix.
30965bd8deadSopenharmony_ci
30975bd8deadSopenharmony_ci   The initial currently bound program is zero.
30985bd8deadSopenharmony_ci
30995bd8deadSopenharmony_ci   The client state required to implement the 16 vertex attribute
31005bd8deadSopenharmony_ci   arrays consists of 16 boolean values, 16 memory pointers, 16 integer
31015bd8deadSopenharmony_ci   stride values, 16 symbolic constants representing array types,
31025bd8deadSopenharmony_ci   and 16 integers representing values per element.  Initially, the
31035bd8deadSopenharmony_ci   boolean values are each disabled, the memory pointers are each null,
31045bd8deadSopenharmony_ci   the strides are each zero, the array types are each FLOAT, and the
31055bd8deadSopenharmony_ci   integers representing values per element are each four."
31065bd8deadSopenharmony_ci
31075bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 
31085bd8deadSopenharmony_ci
31095bd8deadSopenharmony_ci --  Section 3.3 "Points"
31105bd8deadSopenharmony_ci
31115bd8deadSopenharmony_ci   Change the first paragraph to read:
31125bd8deadSopenharmony_ci
31135bd8deadSopenharmony_ci   "When program vertex mode is disabled, the point size for rasterizing
31145bd8deadSopenharmony_ci   points is controlled with
31155bd8deadSopenharmony_ci
31165bd8deadSopenharmony_ci     void PointSize(float size);
31175bd8deadSopenharmony_ci
31185bd8deadSopenharmony_ci   size specifies the width or diameter of a point.  The initial point size
31195bd8deadSopenharmony_ci   value is 1.0.  A value less than or equal to zero results in the error
31205bd8deadSopenharmony_ci   INVALID_VALUE.  When vertex program mode is enabled, the point size for
31215bd8deadSopenharmony_ci   rasterizing points is determined as described in section 2.14.1.5."
31225bd8deadSopenharmony_ci
31235bd8deadSopenharmony_ci --  Section 3.9 "Color Sum"
31245bd8deadSopenharmony_ci
31255bd8deadSopenharmony_ci   Change the first paragraph to read:
31265bd8deadSopenharmony_ci
31275bd8deadSopenharmony_ci   "At the beginning of color sum, a fragment has two RGBA colors:  a
31285bd8deadSopenharmony_ci   primary color cpri (which texturing, if enabled, may have modified)
31295bd8deadSopenharmony_ci   and a secondary color csec.  If vertex program mode is disabled, csec
31305bd8deadSopenharmony_ci   is defined by the lighting equations in section 2.13.1.  If vertex
31315bd8deadSopenharmony_ci   program mode is enabled, csec is the fragment's secondary color,
31325bd8deadSopenharmony_ci   obtained by interpolating the COL1 (or BFC1 if the primitive is a
31335bd8deadSopenharmony_ci   polygon, the vertex program two-sided color mode is enabled, and the
31345bd8deadSopenharmony_ci   polygon is back-facing) vertex result register RGB components for the
31355bd8deadSopenharmony_ci   vertices making up the primitive; the alpha component of csec when
31365bd8deadSopenharmony_ci   program mode is enabled is always zero.  The components of these two
31375bd8deadSopenharmony_ci   colors are summed to produce a single post-texturing RGBA color c.
31385bd8deadSopenharmony_ci   The components of c are then clamped to the range [0,1]."
31395bd8deadSopenharmony_ci
31405bd8deadSopenharmony_ci --  Section 3.10 "Fog"
31415bd8deadSopenharmony_ci
31425bd8deadSopenharmony_ci   Change the initial sentences in the second paragraph to read:
31435bd8deadSopenharmony_ci
31445bd8deadSopenharmony_ci   "This factor f may be computed according to one of three equations:
31455bd8deadSopenharmony_ci
31465bd8deadSopenharmony_ci            f = exp(-d*c)                                (3.24)
31475bd8deadSopenharmony_ci            f = exp(-(d*c)^2)                            (3.25)
31485bd8deadSopenharmony_ci            f = (e-c)/(e-s)                              (3.26)
31495bd8deadSopenharmony_ci
31505bd8deadSopenharmony_ci   If vertex program mode is enabled, then c is the fragment's fog
31515bd8deadSopenharmony_ci   coordinate, obtained by interpolating the FOGC vertex result register
31525bd8deadSopenharmony_ci   values for the vertices making up the primitive.  When vertex program
31535bd8deadSopenharmony_ci   mode is disabled, the c is the eye-coordinate distance from the eye,
31545bd8deadSopenharmony_ci   (0,0,0,1) in eye-coordinates, to the fragment center." ...
31555bd8deadSopenharmony_ci
31565bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment
31575bd8deadSopenharmony_ciOperations and the Framebuffer) 
31585bd8deadSopenharmony_ci
31595bd8deadSopenharmony_ci    None
31605bd8deadSopenharmony_ci
31615bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions) 
31625bd8deadSopenharmony_ci
31635bd8deadSopenharmony_ci --  Section 5.1 "Evaluators"
31645bd8deadSopenharmony_ci
31655bd8deadSopenharmony_ci    Add the following lines to the end of table 5.1 (page 165):
31665bd8deadSopenharmony_ci
31675bd8deadSopenharmony_ci    target                      k   values
31685bd8deadSopenharmony_ci    -------------------------  ---  ------------------------------
31695bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB0_4_NV    4   x, y, z, w vertex attribute 0
31705bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB1_4_NV    4   x, y, z, w vertex attribute 1
31715bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB2_4_NV    4   x, y, z, w vertex attribute 2
31725bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB3_4_NV    4   x, y, z, w vertex attribute 3
31735bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB4_4_NV    4   x, y, z, w vertex attribute 4
31745bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB5_4_NV    4   x, y, z, w vertex attribute 5
31755bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB6_4_NV    4   x, y, z, w vertex attribute 6
31765bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB7_4_NV    4   x, y, z, w vertex attribute 7
31775bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB8_4_NV    4   x, y, z, w vertex attribute 8
31785bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB9_4_NV    4   x, y, z, w vertex attribute 9
31795bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB10_4_NV   4   x, y, z, w vertex attribute 10
31805bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB11_4_NV   4   x, y, z, w vertex attribute 11
31815bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB12_4_NV   4   x, y, z, w vertex attribute 12
31825bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB13_4_NV   4   x, y, z, w vertex attribute 13
31835bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB14_4_NV   4   x, y, z, w vertex attribute 14
31845bd8deadSopenharmony_ci    MAP1_VERTEX_ATTRIB15_4_NV   4   x, y, z, w vertex attribute 15
31855bd8deadSopenharmony_ci
31865bd8deadSopenharmony_ci    Replace the four paragraphs on pages 167-168 that explain the
31875bd8deadSopenharmony_ci    operation of EvalCoord:
31885bd8deadSopenharmony_ci
31895bd8deadSopenharmony_ci    "EvalCoord operates differently depending on whether vertex program
31905bd8deadSopenharmony_ci    mode is enabled or not.  We first discuss how EvalCoord operates when
31915bd8deadSopenharmony_ci    vertex program mode is disabled.
31925bd8deadSopenharmony_ci
31935bd8deadSopenharmony_ci    When one of the EvalCoord commands is issued and vertex program
31945bd8deadSopenharmony_ci    mode is disabled, all currently enabled maps (excluding the
31955bd8deadSopenharmony_ci    maps that correspond to vertex attributes, i.e. maps of the form
31965bd8deadSopenharmony_ci    MAPx_VERTEX_ATTRIBn_4_NV).  ..."
31975bd8deadSopenharmony_ci
31985bd8deadSopenharmony_ci    Add a paragraph before the initial paragraph discussing AUTO_NORMAL:
31995bd8deadSopenharmony_ci
32005bd8deadSopenharmony_ci    "When one of the EvalCoord commands is issued and vertex program mode
32015bd8deadSopenharmony_ci    is enabled, the evaluation and the issuing of per-vertex parameter commands
32025bd8deadSopenharmony_ci    matches the discussion above, except that if any vertex attribute
32035bd8deadSopenharmony_ci    maps are enabled, the corresponding VertexAttribNV call for each enabled
32045bd8deadSopenharmony_ci    vertex attribute map is issued with the map's evaluated coordinates
32055bd8deadSopenharmony_ci    and the corresponding aliased per-vertex parameter map is ignored
32065bd8deadSopenharmony_ci    if it is also enabled, with one important difference.  As is the case when
32075bd8deadSopenharmony_ci    vertex program mode is disabled, the GL uses evaluated values
32085bd8deadSopenharmony_ci    instead of current values for those evaluations that are enabled
32095bd8deadSopenharmony_ci    (otherwise the current values are used).  The order of the effective
32105bd8deadSopenharmony_ci    commands is immaterial, except that Vertex or VertexAttribNV(0,
32115bd8deadSopenharmony_ci    ...) (the commands that issue provoke vertex program execution)
32125bd8deadSopenharmony_ci    must be issued last.  Use of evaluators has no effect on the current
32135bd8deadSopenharmony_ci    vertex attributes or conventional per-vertex parameters.  If a
32145bd8deadSopenharmony_ci    vertex attribute map is disabled, but its corresponding conventional
32155bd8deadSopenharmony_ci    per-vertex parameter map is enabled, the conventional per-vertex
32165bd8deadSopenharmony_ci    parameter map is evaluated and issued as when vertex program mode
32175bd8deadSopenharmony_ci    is not enabled."
32185bd8deadSopenharmony_ci
32195bd8deadSopenharmony_ci    Replace the two paragraphs discussing AUTO_NORMAL with:
32205bd8deadSopenharmony_ci
32215bd8deadSopenharmony_ci    "Finally, if either MAP2_VERTEX_3 or MAP2_VERTEX_4 is enabled or if
32225bd8deadSopenharmony_ci    both MAP2_VERTEX_ATTRIB0_4_NV and vertex program mode are enabled,
32235bd8deadSopenharmony_ci    then the normal to the surface is computed.  Analytic computation,
32245bd8deadSopenharmony_ci    which sometimes yields normals of length zero, is one method which
32255bd8deadSopenharmony_ci    may be used.  If automatic normal generation is enabled, then this
32265bd8deadSopenharmony_ci    computed normal is used as the normal associated with a generated
32275bd8deadSopenharmony_ci    vertex (when program mode is disabled) or as vertex attribute 2
32285bd8deadSopenharmony_ci    (when vertex program mode is enabled).  Automatic normal generation
32295bd8deadSopenharmony_ci    is controlled with Enable and Disable with the symbolic constant
32305bd8deadSopenharmony_ci    AUTO_NORMAL.  If automatic normal generation is disabled and vertex
32315bd8deadSopenharmony_ci    program mode is enabled, then vertex attribute 2 is evaluated
32325bd8deadSopenharmony_ci    as usual.  If automatic normal generation and vertex program mode
32335bd8deadSopenharmony_ci    are disabled, then a corresponding normal map, if enabled, is used
32345bd8deadSopenharmony_ci    to produce a normal.  If neither automatic normal generation nor
32355bd8deadSopenharmony_ci    a map corresponding to the normal per-vertex parameter (or vertex
32365bd8deadSopenharmony_ci    attribute 2 in program mode) are enabled, then no normal is sent with
32375bd8deadSopenharmony_ci    a vertex resulting from an evaluation (the effect is that the current
32385bd8deadSopenharmony_ci    normal is used).  For MAP_VERTEX3, let q=p.  For MAP_VERTEX_4 or
32395bd8deadSopenharmony_ci    MAP2_VERTEX_ATTRBI0_4_NV, let q = (x/w, y/w, z/w) where (x,y,z,w)=p.
32405bd8deadSopenharmony_ci    Then let
32415bd8deadSopenharmony_ci
32425bd8deadSopenharmony_ci       m = (partial q / partial u) cross (partial q / partial v)
32435bd8deadSopenharmony_ci
32445bd8deadSopenharmony_ci    Then when vertex program mode is disabled, the generated analytic
32455bd8deadSopenharmony_ci    normal, n, is given by n=m/||m||.  However, when vertex program mode
32465bd8deadSopenharmony_ci    is enabled, the generated analytic normal used for vertex attribute
32475bd8deadSopenharmony_ci    2 is simply (mx,my,mz,1).  In vertex program mode, the normalization
32485bd8deadSopenharmony_ci    of the generated analytic normal can be performed by the current
32495bd8deadSopenharmony_ci    vertex program."
32505bd8deadSopenharmony_ci
32515bd8deadSopenharmony_ci    Change the respective sentences of the last paragraph discussing
32525bd8deadSopenharmony_ci    required evaluator state to read:
32535bd8deadSopenharmony_ci
32545bd8deadSopenharmony_ci    "The state required for evaluators potentially consists of 9
32555bd8deadSopenharmony_ci    conventional one-dimensional map specifications, 16 vertex attribute
32565bd8deadSopenharmony_ci    one-dimensional map specifications, 9 conventional two-dimensional
32575bd8deadSopenharmony_ci    map specifications, and 16 vertex attribute two-dimensional map
32585bd8deadSopenharmony_ci    specifications indicating which are enabled.  ...  All vertex
32595bd8deadSopenharmony_ci    coordinate maps produce the coordinates (0,0,0,1) (or the appropriate
32605bd8deadSopenharmony_ci    subset); all normal coordinate maps produce (0,0,1); RGBA maps produce
32615bd8deadSopenharmony_ci    (1,1,1,1); color index maps produce 1.0; texture coordinate maps
32625bd8deadSopenharmony_ci    produce (0,0,0,1); and vertex attribute maps produce (0,0,0,1).  ...
32635bd8deadSopenharmony_ci    If any evaluation command is issued when none of MAPn_VERTEX_3,
32645bd8deadSopenharmony_ci    MAPn_VERTEX_4, or MAPn_VERTEX_ATTRIB0_NV (where n is the map dimension
32655bd8deadSopenharmony_ci    being evaluated) are enabled, nothing happens."
32665bd8deadSopenharmony_ci
32675bd8deadSopenharmony_ci --  Section 5.4 "Display Lists"
32685bd8deadSopenharmony_ci
32695bd8deadSopenharmony_ci    Add to the list of commands not compiled into display lists in the
32705bd8deadSopenharmony_ci    third to the last paragraph:
32715bd8deadSopenharmony_ci
32725bd8deadSopenharmony_ci    "AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
32735bd8deadSopenharmony_ci    VertexAttribPointerNV"
32745bd8deadSopenharmony_ci
32755bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.2.1 Specification (State and
32765bd8deadSopenharmony_ciState Requests)
32775bd8deadSopenharmony_ci
32785bd8deadSopenharmony_ci --  Section 6.1.12 "Saving and Restoring State"
32795bd8deadSopenharmony_ci
32805bd8deadSopenharmony_ci    Only the enables and vertex array state introduced by this extension
32815bd8deadSopenharmony_ci    can be pushed and popped.
32825bd8deadSopenharmony_ci
32835bd8deadSopenharmony_ci    See the attribute column in table X.5 for determining what vertex
32845bd8deadSopenharmony_ci    program state can be pushed and popped with PushAttrib, PopAttrib,
32855bd8deadSopenharmony_ci    PushClientAttrib, and PopClientAttrib.
32865bd8deadSopenharmony_ci
32875bd8deadSopenharmony_ci    The new evaluator enables in table 6.22 can also be pushed and
32885bd8deadSopenharmony_ci    popped.
32895bd8deadSopenharmony_ci
32905bd8deadSopenharmony_ci --  NEW Section 6.1.13 "Vertex Program Queries"
32915bd8deadSopenharmony_ci
32925bd8deadSopenharmony_ci    "The commands
32935bd8deadSopenharmony_ci
32945bd8deadSopenharmony_ci      void GetProgramParameterfvNV(enum target, uint index,
32955bd8deadSopenharmony_ci                                   enum pname, float *params);
32965bd8deadSopenharmony_ci      void GetProgramParameterdvNV(enum target, uint index,
32975bd8deadSopenharmony_ci                                   enum pname, double *params);
32985bd8deadSopenharmony_ci
32995bd8deadSopenharmony_ci    obtain the current program parameters for the given program
33005bd8deadSopenharmony_ci    target and parameter index into the array params.  target must
33015bd8deadSopenharmony_ci    be VERTEX_PROGRAM_NV.  pname must be PROGRAM_PARAMETER_NV.
33025bd8deadSopenharmony_ci    The INVALID_VALUE error is generated if index is greater than 95.
33035bd8deadSopenharmony_ci    Each program parameter is an array of four values.
33045bd8deadSopenharmony_ci
33055bd8deadSopenharmony_ci    The command
33065bd8deadSopenharmony_ci
33075bd8deadSopenharmony_ci      void GetProgramivNV(uint id, enum pname, int *params);
33085bd8deadSopenharmony_ci
33095bd8deadSopenharmony_ci    obtains program state named by pname for the program named id
33105bd8deadSopenharmony_ci    in the array params.  pname must be one of PROGRAM_TARGET_NV,
33115bd8deadSopenharmony_ci    PROGRAM_LENGTH_NV, or PROGRAM_RESIDENT_NV.  The INVALID_OPERATION
33125bd8deadSopenharmony_ci    error is generated if the program named id does not exist.
33135bd8deadSopenharmony_ci
33145bd8deadSopenharmony_ci    The command
33155bd8deadSopenharmony_ci
33165bd8deadSopenharmony_ci      void GetProgramStringNV(uint id, enum pname,
33175bd8deadSopenharmony_ci                              ubyte *program);
33185bd8deadSopenharmony_ci
33195bd8deadSopenharmony_ci    obtains the program string for program id.  pname must be
33205bd8deadSopenharmony_ci    PROGRAM_STRING_NV.  n ubytes are returned into the array program
33215bd8deadSopenharmony_ci    where n is the length of the program in ubytes.  GetProgramivNV with
33225bd8deadSopenharmony_ci    PROGRAM_LENGTH_NV can be used to query the length of a program's
33235bd8deadSopenharmony_ci    string.  The INVALID_OPERATION error is generated if the program
33245bd8deadSopenharmony_ci    named id does not exist.
33255bd8deadSopenharmony_ci
33265bd8deadSopenharmony_ci    The command
33275bd8deadSopenharmony_ci
33285bd8deadSopenharmony_ci      void GetTrackMatrixivNV(enum target, uint address,
33295bd8deadSopenharmony_ci                              enum pname, int *params);
33305bd8deadSopenharmony_ci
33315bd8deadSopenharmony_ci    obtains the matrix tracking state named by pname for the specified
33325bd8deadSopenharmony_ci    address in the array params.  target must be VERTEX_PROGRAM_NV. pname
33335bd8deadSopenharmony_ci    must be either TRACK_MATRIX_NV or TRACK_MATRIX_TRANSFORM_NV.  If the
33345bd8deadSopenharmony_ci    matrix tracked is a texture matrix, TEXTUREi_ARB is returned (never
33355bd8deadSopenharmony_ci    TEXTURE) where i indicates the texture unit of the particular tracked
33365bd8deadSopenharmony_ci    texture matrix.  The INVALID_VALUE error is generated if address is
33375bd8deadSopenharmony_ci    not divisible by four and is not less than 96.
33385bd8deadSopenharmony_ci
33395bd8deadSopenharmony_ci    The commands
33405bd8deadSopenharmony_ci
33415bd8deadSopenharmony_ci      void GetVertexAttribdvNV(uint index, enum pname, double *params);
33425bd8deadSopenharmony_ci      void GetVertexAttribfvNV(uint index, enum pname, float *params);
33435bd8deadSopenharmony_ci      void GetVertexAttribivNV(uint index, enum pname, int *params);
33445bd8deadSopenharmony_ci
33455bd8deadSopenharmony_ci    obtain the vertex attribute state named by pname for the vertex
33465bd8deadSopenharmony_ci    attribute numbered index.  pname must be one of ATTRIB_ARRAY_SIZE_NV,
33475bd8deadSopenharmony_ci    ATTRIB_ARRAY_STRIDE_NV, ATTRIB_ARRAY_TYPE_NV, or CURRENT_ATTRIB_NV.
33485bd8deadSopenharmony_ci    Note that all the queries except CURRENT_ATTRIB_NV return client
33495bd8deadSopenharmony_ci    state.  The INVALID_VALUE error is generated if index is greater than
33505bd8deadSopenharmony_ci    15, or if index is zero and pname is CURRENT_ATTRIB_NV.
33515bd8deadSopenharmony_ci
33525bd8deadSopenharmony_ci    The command
33535bd8deadSopenharmony_ci
33545bd8deadSopenharmony_ci      void GetVertexAttribPointervNV(uint index,
33555bd8deadSopenharmony_ci                                     enum pname, void **pointer);
33565bd8deadSopenharmony_ci    
33575bd8deadSopenharmony_ci    obtains the pointer named pname in the array params for vertex
33585bd8deadSopenharmony_ci    attribute numbered index.  pname must be ATTRIB_ARRAY_POINTER_NV.
33595bd8deadSopenharmony_ci    The INVALID_VALUE error is generated if index greater than 15.
33605bd8deadSopenharmony_ci
33615bd8deadSopenharmony_ci    The command
33625bd8deadSopenharmony_ci
33635bd8deadSopenharmony_ci      boolean IsProgramNV(uint id);
33645bd8deadSopenharmony_ci
33655bd8deadSopenharmony_ci    returns TRUE if program is the name of a program object.  If program
33665bd8deadSopenharmony_ci    is zero or is a non-zero value that is not the name of a program
33675bd8deadSopenharmony_ci    object, or if an error condition occurs, IsProgramNV returns FALSE.
33685bd8deadSopenharmony_ci    A name returned by GenProgramsNV but not yet loaded with a program
33695bd8deadSopenharmony_ci    is not the name of a program object."
33705bd8deadSopenharmony_ci
33715bd8deadSopenharmony_ci --  NEW Section 6.1.14 "Querying Current Matrix State"
33725bd8deadSopenharmony_ci
33735bd8deadSopenharmony_ci    "Instead of providing distinct symbolic tokens for querying each
33745bd8deadSopenharmony_ci    matrix and matrix stack depth, the symbolic tokens CURRENT_MATRIX_NV
33755bd8deadSopenharmony_ci    and CURRENT_MATRIX_STACK_DEPTH_NV in conjunction with the GetBooleanv,
33765bd8deadSopenharmony_ci    GetIntegerv, GetFloatv, and GetDoublev return the respective state
33775bd8deadSopenharmony_ci    of the current matrix given the current matrix mode.
33785bd8deadSopenharmony_ci
33795bd8deadSopenharmony_ci    Querying CURRENT_MATRIX_NV  and CURRENT_MATRIX_STACK_DEPTH_NV is
33805bd8deadSopenharmony_ci    the only means for querying the matrix and matrix stack depth of
33815bd8deadSopenharmony_ci    the tracking matrices described in section 2.14.5."
33825bd8deadSopenharmony_ci
33835bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
33845bd8deadSopenharmony_ci
33855bd8deadSopenharmony_ci    Add the following rule:
33865bd8deadSopenharmony_ci
33875bd8deadSopenharmony_ci    "Rule X  Vertex program and vertex state program instructions not
33885bd8deadSopenharmony_ci    relevant to the calculation of any result must have no effect on
33895bd8deadSopenharmony_ci    that result.
33905bd8deadSopenharmony_ci
33915bd8deadSopenharmony_ci    Rules X+1  Vertex program and vertex state program instructions
33925bd8deadSopenharmony_ci    relevant to the calculation of any result must always produce the
33935bd8deadSopenharmony_ci    identical result.  In particular, the same instruction with the same
33945bd8deadSopenharmony_ci    source inputs must produce the identical result whether executed by
33955bd8deadSopenharmony_ci    a vertex program or a vertex state program.
33965bd8deadSopenharmony_ci
33975bd8deadSopenharmony_ci    Instructions relevant to the calculation of a result are any
33985bd8deadSopenharmony_ci    instructions in a sequence of instructions that eventually determine
33995bd8deadSopenharmony_ci    the source values for the calculation under consideration.
34005bd8deadSopenharmony_ci
34015bd8deadSopenharmony_ci    There is no guaranteed invariance between vertices transformed by
34025bd8deadSopenharmony_ci    conventional GL vertex transform mode and vertices transformed by
34035bd8deadSopenharmony_ci    vertex program mode.  Multi-pass rendering algorithms that require
34045bd8deadSopenharmony_ci    rendering invariances to operate correctly should not mix conventional
34055bd8deadSopenharmony_ci    GL vertex transform mode with vertex program mode for different
34065bd8deadSopenharmony_ci    rendering passes.  However such algorithms will operate correctly
34075bd8deadSopenharmony_ci    if the algorithms limit themselves to a single mode of vertex
34085bd8deadSopenharmony_ci    transformation."
34095bd8deadSopenharmony_ci
34105bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
34115bd8deadSopenharmony_ci
34125bd8deadSopenharmony_ci    Program objects are shared between AGL/GLX/WGL rendering contexts if
34135bd8deadSopenharmony_ci    and only if the rendering contexts share display lists.  No change
34145bd8deadSopenharmony_ci    is made to the AGL/GLX/WGL API.
34155bd8deadSopenharmony_ci
34165bd8deadSopenharmony_ciDependencies on EXT_vertex_weighting
34175bd8deadSopenharmony_ci
34185bd8deadSopenharmony_ci    If the EXT_vertex_weighting extension is not supported, there is no
34195bd8deadSopenharmony_ci    aliasing between vertex attribute 1 and the current vertex weight.
34205bd8deadSopenharmony_ci    Replace the contents of the last three columns in row 5 of table
34215bd8deadSopenharmony_ci    X.2 with dashes.
34225bd8deadSopenharmony_ci
34235bd8deadSopenharmony_ciDependencies on EXT_point_parameters
34245bd8deadSopenharmony_ci
34255bd8deadSopenharmony_ci    When EXT_point_parameters is supported, the amended discussion
34265bd8deadSopenharmony_ci    of point size determination should be further amended with the
34275bd8deadSopenharmony_ci    language from the EXT_point_parameters specification though the point
34285bd8deadSopenharmony_ci    parameters functionality only applies when vertex program mode is
34295bd8deadSopenharmony_ci    disabled.
34305bd8deadSopenharmony_ci
34315bd8deadSopenharmony_ci    Even if the EXT_point_parameters extension is not supported, the
34325bd8deadSopenharmony_ci    PSIZ vertex result register must operate as specified.
34335bd8deadSopenharmony_ci
34345bd8deadSopenharmony_ciDependencies on ARB_multitexture
34355bd8deadSopenharmony_ci
34365bd8deadSopenharmony_ci    ARB_multitexture is required to support NV_vertex_program and the
34375bd8deadSopenharmony_ci    value of MAX_TEXTURE_UNITS_ARB must be at least 2.  If more than 8
34385bd8deadSopenharmony_ci    texture units are supported, only the first 8 texture units can be
34395bd8deadSopenharmony_ci    assigned texture coordinates when vertex program mode is enabled.
34405bd8deadSopenharmony_ci    Texture units beyond 8 are implicitly disabled when vertex program
34415bd8deadSopenharmony_ci    mode is enabled.
34425bd8deadSopenharmony_ci
34435bd8deadSopenharmony_ciDependencies on EXT_fog_coord
34445bd8deadSopenharmony_ci
34455bd8deadSopenharmony_ci    If the EXT_fog_coord extension is not supported, there is no
34465bd8deadSopenharmony_ci    aliasing between vertex attribute 5 and the current fog coordinate.
34475bd8deadSopenharmony_ci    Replace the contents of the last three columns in row 5 of table
34485bd8deadSopenharmony_ci    X.2 with dashes.
34495bd8deadSopenharmony_ci
34505bd8deadSopenharmony_ci    Even if the EXT_fog_coord extension is not supported, the FOGC
34515bd8deadSopenharmony_ci    vertex result register must operate as specified.  Note that the
34525bd8deadSopenharmony_ci    FOGC vertex result register behaves identically to the EXT_fog_coord
34535bd8deadSopenharmony_ci    extension's FOG_COORDINATE_SOURCE_EXT being FOG_COORDINATE_EXT.
34545bd8deadSopenharmony_ci    This means that the functionality of EXT_fog_coord is required to
34555bd8deadSopenharmony_ci    implement NV_vertex_program even if the EXT_fog_coord extension is
34565bd8deadSopenharmony_ci    not supported.
34575bd8deadSopenharmony_ci
34585bd8deadSopenharmony_ci    If the EXT_fog_coord extension is supported, the state of
34595bd8deadSopenharmony_ci    FOG_COORDINATE_SOURCE_EXT only applies when vertex program mode is
34605bd8deadSopenharmony_ci    disabled and the discussion in section 3.10 is further amended by
34615bd8deadSopenharmony_ci    the discussion of FOG_COORDINATE_SOURCE_EXT in the EXT_fog_coord
34625bd8deadSopenharmony_ci    specification.
34635bd8deadSopenharmony_ci
34645bd8deadSopenharmony_ciDependencies on EXT_secondary_color
34655bd8deadSopenharmony_ci
34665bd8deadSopenharmony_ci    If the EXT_secondary_color extension is not supported, there is no
34675bd8deadSopenharmony_ci    aliasing between vertex attribute 4 and the current secondary color.
34685bd8deadSopenharmony_ci    Replace the contents of the last three columns in row 4 of table
34695bd8deadSopenharmony_ci    X.2 with dashes.
34705bd8deadSopenharmony_ci
34715bd8deadSopenharmony_ci    Even if the EXT_secondary_color extension is not supported, the COL1
34725bd8deadSopenharmony_ci    and BFC1 vertex result registers must operate as specified.
34735bd8deadSopenharmony_ci    These vertex result registers are required to implement OpenGL 1.2's
34745bd8deadSopenharmony_ci    separate specular mode within a vertex program.
34755bd8deadSopenharmony_ci
34765bd8deadSopenharmony_ciGLX Protocol
34775bd8deadSopenharmony_ci
34785bd8deadSopenharmony_ci    Forty-five new GL commands are added.
34795bd8deadSopenharmony_ci
34805bd8deadSopenharmony_ci    The following thirty-five rendering commands are sent to the sever
34815bd8deadSopenharmony_ci    as part of a glXRender request:
34825bd8deadSopenharmony_ci
34835bd8deadSopenharmony_ci        BindProgramNV
34845bd8deadSopenharmony_ci            2           12              rendering command length
34855bd8deadSopenharmony_ci            2           4180            rendering command opcode
34865bd8deadSopenharmony_ci            4           ENUM            target
34875bd8deadSopenharmony_ci            4           CARD32          id
34885bd8deadSopenharmony_ci
34895bd8deadSopenharmony_ci        ExecuteProgramNV
34905bd8deadSopenharmony_ci            2           12+4*n          rendering command length
34915bd8deadSopenharmony_ci            2           4181            rendering command opcode
34925bd8deadSopenharmony_ci            4           ENUM            target
34935bd8deadSopenharmony_ci                        0x8621  n=4     GL_VERTEX_STATE_PROGRAM_NV
34945bd8deadSopenharmony_ci                        else    n=0     command is erroneous
34955bd8deadSopenharmony_ci            4           CARD32          id
34965bd8deadSopenharmony_ci            4*n         LISTofFLOAT32   params
34975bd8deadSopenharmony_ci
34985bd8deadSopenharmony_ci        RequestResidentProgramsNV
34995bd8deadSopenharmony_ci            2           8+4*n           rendering command length
35005bd8deadSopenharmony_ci            2           4182            rendering command opcode
35015bd8deadSopenharmony_ci            4           INT32           n
35025bd8deadSopenharmony_ci            n*4         CARD32          programs
35035bd8deadSopenharmony_ci
35045bd8deadSopenharmony_ci        LoadProgramNV
35055bd8deadSopenharmony_ci            2           16+n+p          rendering command length
35065bd8deadSopenharmony_ci            2           4183            rendering command opcode
35075bd8deadSopenharmony_ci            4           ENUM            target
35085bd8deadSopenharmony_ci            4           CARD32          id
35095bd8deadSopenharmony_ci            4           INT32           len
35105bd8deadSopenharmony_ci            n           LISTofCARD8     n
35115bd8deadSopenharmony_ci            p                           unused, p=pad(n)
35125bd8deadSopenharmony_ci
35135bd8deadSopenharmony_ci        ProgramParameter4fvNV
35145bd8deadSopenharmony_ci            2           32              rendering command length
35155bd8deadSopenharmony_ci            2           4184            rendering command opcode
35165bd8deadSopenharmony_ci            4           ENUM            target
35175bd8deadSopenharmony_ci            4           CARD32          index
35185bd8deadSopenharmony_ci            4           FLOAT32         params[0]
35195bd8deadSopenharmony_ci            4           FLOAT32         params[1]
35205bd8deadSopenharmony_ci            4           FLOAT32         params[2]
35215bd8deadSopenharmony_ci            4           FLOAT32         params[3]
35225bd8deadSopenharmony_ci
35235bd8deadSopenharmony_ci        ProgramParameter4dvNV
35245bd8deadSopenharmony_ci            2           44              rendering command length
35255bd8deadSopenharmony_ci            2           4185            rendering command opcode
35265bd8deadSopenharmony_ci            4           ENUM            target
35275bd8deadSopenharmony_ci            4           CARD32          index
35285bd8deadSopenharmony_ci            8           FLOAT64         params[0]
35295bd8deadSopenharmony_ci            8           FLOAT64         params[1]
35305bd8deadSopenharmony_ci            8           FLOAT64         params[2]
35315bd8deadSopenharmony_ci            8           FLOAT64         params[3]
35325bd8deadSopenharmony_ci
35335bd8deadSopenharmony_ci        ProgramParameters4fvNV
35345bd8deadSopenharmony_ci            2           16+16*n         rendering command length
35355bd8deadSopenharmony_ci            2           4186            rendering command opcode
35365bd8deadSopenharmony_ci            4           ENUM            target
35375bd8deadSopenharmony_ci            4           CARD32          index
35385bd8deadSopenharmony_ci            4           CARD32          n
35395bd8deadSopenharmony_ci            16*n        FLOAT32         params
35405bd8deadSopenharmony_ci
35415bd8deadSopenharmony_ci        ProgramParameters4dvNV
35425bd8deadSopenharmony_ci            2           16+32*n         rendering command length
35435bd8deadSopenharmony_ci            2           4187            rendering command opcode
35445bd8deadSopenharmony_ci            4           ENUM            target
35455bd8deadSopenharmony_ci            4           CARD32          index
35465bd8deadSopenharmony_ci            4           CARD32          n
35475bd8deadSopenharmony_ci            32*n        FLOAT64         params
35485bd8deadSopenharmony_ci
35495bd8deadSopenharmony_ci        TrackMatrixNV
35505bd8deadSopenharmony_ci            2           20              rendering command length
35515bd8deadSopenharmony_ci            2           4188            rendering command opcode
35525bd8deadSopenharmony_ci            4           ENUM            target
35535bd8deadSopenharmony_ci            4           CARD32          address
35545bd8deadSopenharmony_ci            4           ENUM            matrix
35555bd8deadSopenharmony_ci            4           ENUM            transform
35565bd8deadSopenharmony_ci
35575bd8deadSopenharmony_ci        VertexAttribPointerNV is an entirely client-side command
35585bd8deadSopenharmony_ci
35595bd8deadSopenharmony_ci        VertexAttrib1svNV
35605bd8deadSopenharmony_ci            2           12              rendering command length
35615bd8deadSopenharmony_ci            2           4265            rendering command opcode
35625bd8deadSopenharmony_ci            4           CARD32          index
35635bd8deadSopenharmony_ci            2           INT16           v[0]
35645bd8deadSopenharmony_ci            2                           unused
35655bd8deadSopenharmony_ci
35665bd8deadSopenharmony_ci        VertexAttrib2svNV
35675bd8deadSopenharmony_ci            2           12              rendering command length
35685bd8deadSopenharmony_ci            2           4266            rendering command opcode
35695bd8deadSopenharmony_ci            4           CARD32          index
35705bd8deadSopenharmony_ci            2           INT16           v[0]
35715bd8deadSopenharmony_ci            2           INT16           v[1]
35725bd8deadSopenharmony_ci
35735bd8deadSopenharmony_ci        VertexAttrib3svNV
35745bd8deadSopenharmony_ci            2           12              rendering command length
35755bd8deadSopenharmony_ci            2           4267            rendering command opcode
35765bd8deadSopenharmony_ci            4           CARD32          index
35775bd8deadSopenharmony_ci            2           INT16           v[0]
35785bd8deadSopenharmony_ci            2           INT16           v[1]
35795bd8deadSopenharmony_ci            2           INT16           v[2]
35805bd8deadSopenharmony_ci            2                           unused
35815bd8deadSopenharmony_ci
35825bd8deadSopenharmony_ci        VertexAttrib4svNV
35835bd8deadSopenharmony_ci            2           12              rendering command length
35845bd8deadSopenharmony_ci            2           4268            rendering command opcode
35855bd8deadSopenharmony_ci            4           CARD32          index
35865bd8deadSopenharmony_ci            2           INT16           v[0]
35875bd8deadSopenharmony_ci            2           INT16           v[1]
35885bd8deadSopenharmony_ci            2           INT16           v[2]
35895bd8deadSopenharmony_ci            2           INT16           v[3]
35905bd8deadSopenharmony_ci
35915bd8deadSopenharmony_ci        VertexAttrib1fvNV
35925bd8deadSopenharmony_ci            2           12              rendering command length
35935bd8deadSopenharmony_ci            2           4269            rendering command opcode
35945bd8deadSopenharmony_ci            4           CARD32          index
35955bd8deadSopenharmony_ci            4           FLOAT32         v[0]
35965bd8deadSopenharmony_ci
35975bd8deadSopenharmony_ci        VertexAttrib2fvNV
35985bd8deadSopenharmony_ci            2           16              rendering command length
35995bd8deadSopenharmony_ci            2           4270            rendering command opcode
36005bd8deadSopenharmony_ci            4           CARD32          index
36015bd8deadSopenharmony_ci            4           FLOAT32         v[0]
36025bd8deadSopenharmony_ci            4           FLOAT32         v[1]
36035bd8deadSopenharmony_ci
36045bd8deadSopenharmony_ci        VertexAttrib3fvNV
36055bd8deadSopenharmony_ci            2           20              rendering command length
36065bd8deadSopenharmony_ci            2           4271            rendering command opcode
36075bd8deadSopenharmony_ci            4           CARD32          index
36085bd8deadSopenharmony_ci            4           FLOAT32         v[0]
36095bd8deadSopenharmony_ci            4           FLOAT32         v[1]
36105bd8deadSopenharmony_ci            4           FLOAT32         v[2]
36115bd8deadSopenharmony_ci
36125bd8deadSopenharmony_ci        VertexAttrib4fvNV
36135bd8deadSopenharmony_ci            2           24              rendering command length
36145bd8deadSopenharmony_ci            2           4272            rendering command opcode
36155bd8deadSopenharmony_ci            4           CARD32          index
36165bd8deadSopenharmony_ci            4           FLOAT32         v[0]
36175bd8deadSopenharmony_ci            4           FLOAT32         v[1]
36185bd8deadSopenharmony_ci            4           FLOAT32         v[2]
36195bd8deadSopenharmony_ci            4           FLOAT32         v[3]
36205bd8deadSopenharmony_ci
36215bd8deadSopenharmony_ci        VertexAttrib1dvNV
36225bd8deadSopenharmony_ci            2           16              rendering command length
36235bd8deadSopenharmony_ci            2           4273            rendering command opcode
36245bd8deadSopenharmony_ci            4           CARD32          index
36255bd8deadSopenharmony_ci            8           FLOAT64         v[0]
36265bd8deadSopenharmony_ci
36275bd8deadSopenharmony_ci        VertexAttrib2dvNV
36285bd8deadSopenharmony_ci            2           24              rendering command length
36295bd8deadSopenharmony_ci            2           4274            rendering command opcode
36305bd8deadSopenharmony_ci            4           CARD32          index
36315bd8deadSopenharmony_ci            8           FLOAT64         v[0]
36325bd8deadSopenharmony_ci            8           FLOAT64         v[1]
36335bd8deadSopenharmony_ci
36345bd8deadSopenharmony_ci        VertexAttrib3dvNV
36355bd8deadSopenharmony_ci            2           32              rendering command length
36365bd8deadSopenharmony_ci            2           4275            rendering command opcode
36375bd8deadSopenharmony_ci            4           CARD32          index
36385bd8deadSopenharmony_ci            8           FLOAT64         v[0]
36395bd8deadSopenharmony_ci            8           FLOAT64         v[1]
36405bd8deadSopenharmony_ci            8           FLOAT64         v[2]
36415bd8deadSopenharmony_ci
36425bd8deadSopenharmony_ci        VertexAttrib4dvNV
36435bd8deadSopenharmony_ci            2           40              rendering command length
36445bd8deadSopenharmony_ci            2           4276            rendering command opcode
36455bd8deadSopenharmony_ci            4           CARD32          index
36465bd8deadSopenharmony_ci            8           FLOAT64         v[0]
36475bd8deadSopenharmony_ci            8           FLOAT64         v[1]
36485bd8deadSopenharmony_ci            8           FLOAT64         v[2]
36495bd8deadSopenharmony_ci            8           FLOAT64         v[3]
36505bd8deadSopenharmony_ci
36515bd8deadSopenharmony_ci        VertexAttrib4ubvNV
36525bd8deadSopenharmony_ci            2           12              rendering command length
36535bd8deadSopenharmony_ci            2           4277            rendering command opcode
36545bd8deadSopenharmony_ci            4           CARD32          index
36555bd8deadSopenharmony_ci            1           CARD8           v[0]
36565bd8deadSopenharmony_ci            1           CARD8           v[1]
36575bd8deadSopenharmony_ci            1           CARD8           v[2]
36585bd8deadSopenharmony_ci            1           CARD8           v[3]
36595bd8deadSopenharmony_ci
36605bd8deadSopenharmony_ci        VertexAttribs1svNV
36615bd8deadSopenharmony_ci            2           12+2*n+p        rendering command length
36625bd8deadSopenharmony_ci            2           4202            rendering command opcode
36635bd8deadSopenharmony_ci            4           CARD32          index
36645bd8deadSopenharmony_ci            4           CARD32          n
36655bd8deadSopenharmony_ci            2*n         INT16           v
36665bd8deadSopenharmony_ci            p                           unused, p=pad(2*n)
36675bd8deadSopenharmony_ci
36685bd8deadSopenharmony_ci        VertexAttribs2svNV
36695bd8deadSopenharmony_ci            2           12+4*n          rendering command length
36705bd8deadSopenharmony_ci            2           4203            rendering command opcode
36715bd8deadSopenharmony_ci            4           CARD32          index
36725bd8deadSopenharmony_ci            4           CARD32          n
36735bd8deadSopenharmony_ci            4*n         INT16           v
36745bd8deadSopenharmony_ci
36755bd8deadSopenharmony_ci        VertexAttribs3svNV
36765bd8deadSopenharmony_ci            2           12+6*n+p        rendering command length
36775bd8deadSopenharmony_ci            2           4204            rendering command opcode
36785bd8deadSopenharmony_ci            4           CARD32          index
36795bd8deadSopenharmony_ci            4           CARD32          n
36805bd8deadSopenharmony_ci            6*n         INT16           v
36815bd8deadSopenharmony_ci            p                           unused, p=pad(6*n)
36825bd8deadSopenharmony_ci
36835bd8deadSopenharmony_ci        VertexAttribs4svNV
36845bd8deadSopenharmony_ci            2           12+8*n          rendering command length
36855bd8deadSopenharmony_ci            2           4205            rendering command opcode
36865bd8deadSopenharmony_ci            4           CARD32          index
36875bd8deadSopenharmony_ci            4           CARD32          n
36885bd8deadSopenharmony_ci            8*n         INT16           v
36895bd8deadSopenharmony_ci
36905bd8deadSopenharmony_ci        VertexAttribs1fvNV
36915bd8deadSopenharmony_ci            2           12+4*n          rendering command length
36925bd8deadSopenharmony_ci            2           4206            rendering command opcode
36935bd8deadSopenharmony_ci            4           CARD32          index
36945bd8deadSopenharmony_ci            4           CARD32          n
36955bd8deadSopenharmony_ci            4*n         FLOAT32         v
36965bd8deadSopenharmony_ci
36975bd8deadSopenharmony_ci        VertexAttribs2fvNV
36985bd8deadSopenharmony_ci            2           12+8*n          rendering command length
36995bd8deadSopenharmony_ci            2           4207            rendering command opcode
37005bd8deadSopenharmony_ci            4           CARD32          index
37015bd8deadSopenharmony_ci            4           CARD32          n
37025bd8deadSopenharmony_ci            8*n         FLOAT32         v
37035bd8deadSopenharmony_ci
37045bd8deadSopenharmony_ci        VertexAttribs3fvNV
37055bd8deadSopenharmony_ci            2           12+12*n         rendering command length
37065bd8deadSopenharmony_ci            2           4208            rendering command opcode
37075bd8deadSopenharmony_ci            4           CARD32          index
37085bd8deadSopenharmony_ci            4           CARD32          n
37095bd8deadSopenharmony_ci            12*n        FLOAT32         v
37105bd8deadSopenharmony_ci
37115bd8deadSopenharmony_ci        VertexAttribs4fvNV
37125bd8deadSopenharmony_ci            2           12+16*n         rendering command length
37135bd8deadSopenharmony_ci            2           4209            rendering command opcode
37145bd8deadSopenharmony_ci            4           CARD32          index
37155bd8deadSopenharmony_ci            4           CARD32          n
37165bd8deadSopenharmony_ci            16*n        FLOAT32         v
37175bd8deadSopenharmony_ci
37185bd8deadSopenharmony_ci        VertexAttribs1dvNV
37195bd8deadSopenharmony_ci            2           12+8*n          rendering command length
37205bd8deadSopenharmony_ci            2           4210            rendering command opcode
37215bd8deadSopenharmony_ci            4           CARD32          index
37225bd8deadSopenharmony_ci            4           CARD32          n
37235bd8deadSopenharmony_ci            8*n         FLOAT64         v
37245bd8deadSopenharmony_ci
37255bd8deadSopenharmony_ci        VertexAttribs2dvNV
37265bd8deadSopenharmony_ci            2           12+16*n         rendering command length
37275bd8deadSopenharmony_ci            2           4211            rendering command opcode
37285bd8deadSopenharmony_ci            4           CARD32          index
37295bd8deadSopenharmony_ci            4           CARD32          n
37305bd8deadSopenharmony_ci            16*n        FLOAT64         v
37315bd8deadSopenharmony_ci
37325bd8deadSopenharmony_ci        VertexAttribs3dvNV
37335bd8deadSopenharmony_ci            2           12+24*n         rendering command length
37345bd8deadSopenharmony_ci            2           4212            rendering command opcode
37355bd8deadSopenharmony_ci            4           CARD32          index
37365bd8deadSopenharmony_ci            4           CARD32          n
37375bd8deadSopenharmony_ci            24*n        FLOAT64         v
37385bd8deadSopenharmony_ci
37395bd8deadSopenharmony_ci        VertexAttribs4dvNV
37405bd8deadSopenharmony_ci            2           12+32*n         rendering command length
37415bd8deadSopenharmony_ci            2           4213            rendering command opcode
37425bd8deadSopenharmony_ci            4           CARD32          index
37435bd8deadSopenharmony_ci            4           CARD32          n
37445bd8deadSopenharmony_ci            32*n        FLOAT64         v
37455bd8deadSopenharmony_ci
37465bd8deadSopenharmony_ci        VertexAttribs4ubvNV
37475bd8deadSopenharmony_ci            2           12+4*n          rendering command length
37485bd8deadSopenharmony_ci            2           4214            rendering command opcode
37495bd8deadSopenharmony_ci            4           CARD32          index
37505bd8deadSopenharmony_ci            4           CARD32          n
37515bd8deadSopenharmony_ci            4*n         CARD8           v
37525bd8deadSopenharmony_ci
37535bd8deadSopenharmony_ci    The remaining twelve commands are non-rendering commands.  These commands
37545bd8deadSopenharmony_ci    are sent separately (i.e., not as part of a glXRender or glXRenderLarge
37555bd8deadSopenharmony_ci    request), using the glXVendorPrivateWithReply request:
37565bd8deadSopenharmony_ci
37575bd8deadSopenharmony_ci        AreProgramsResidentNV
37585bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
37595bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
37605bd8deadSopenharmony_ci            2           4+n             request length
37615bd8deadSopenharmony_ci            4           1293            vendor specific opcode
37625bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
37635bd8deadSopenharmony_ci            4           INT32           n
37645bd8deadSopenharmony_ci            n*4         LISTofCARD32    programs
37655bd8deadSopenharmony_ci          =>
37665bd8deadSopenharmony_ci            1           1               reply
37675bd8deadSopenharmony_ci            1                           unused
37685bd8deadSopenharmony_ci            2           CARD16          sequence number
37695bd8deadSopenharmony_ci            4           (n+p)/4         reply length
37705bd8deadSopenharmony_ci            4           BOOL32          return value
37715bd8deadSopenharmony_ci            20                          unused
37725bd8deadSopenharmony_ci            n           LISTofBOOL      programs
37735bd8deadSopenharmony_ci            p                           unused, p=pad(n)
37745bd8deadSopenharmony_ci
37755bd8deadSopenharmony_ci        DeleteProgramsNV
37765bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
37775bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
37785bd8deadSopenharmony_ci            2           4+n             request length
37795bd8deadSopenharmony_ci            4           1294            vendor specific opcode
37805bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
37815bd8deadSopenharmony_ci            4           INT32           n
37825bd8deadSopenharmony_ci            n*4         LISTofCARD32    programs
37835bd8deadSopenharmony_ci
37845bd8deadSopenharmony_ci        GenProgramsNV
37855bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
37865bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
37875bd8deadSopenharmony_ci            2           4               request length
37885bd8deadSopenharmony_ci            4           1295            vendor specific opcode
37895bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
37905bd8deadSopenharmony_ci            4           INT32           n
37915bd8deadSopenharmony_ci          =>
37925bd8deadSopenharmony_ci            1           1               reply
37935bd8deadSopenharmony_ci            1                           unused
37945bd8deadSopenharmony_ci            2           CARD16          sequence number
37955bd8deadSopenharmony_ci            4           n               reply length
37965bd8deadSopenharmony_ci            24                          unused
37975bd8deadSopenharmony_ci            n*4         LISTofCARD322   programs
37985bd8deadSopenharmony_ci
37995bd8deadSopenharmony_ci        GetProgramParameterfvNV
38005bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
38015bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
38025bd8deadSopenharmony_ci            2           6               request length
38035bd8deadSopenharmony_ci            4           1319            vendor specific opcode
38045bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
38055bd8deadSopenharmony_ci            4           ENUM            target
38065bd8deadSopenharmony_ci            4           CARD32          index
38075bd8deadSopenharmony_ci            4           ENUM            pname
38085bd8deadSopenharmony_ci          =>
38095bd8deadSopenharmony_ci            1           1               reply
38105bd8deadSopenharmony_ci            1                           unused
38115bd8deadSopenharmony_ci            2           CARD16          sequence number
38125bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
38135bd8deadSopenharmony_ci            4                           unused
38145bd8deadSopenharmony_ci            4           CARD32          n
38155bd8deadSopenharmony_ci
38165bd8deadSopenharmony_ci            if (n=1) this follows:
38175bd8deadSopenharmony_ci
38185bd8deadSopenharmony_ci            4           FLOAT32         params
38195bd8deadSopenharmony_ci            12                          unused
38205bd8deadSopenharmony_ci
38215bd8deadSopenharmony_ci            otherwise this follows:
38225bd8deadSopenharmony_ci
38235bd8deadSopenharmony_ci            16                          unused
38245bd8deadSopenharmony_ci            n*4         LISTofFLOAT32   params
38255bd8deadSopenharmony_ci
38265bd8deadSopenharmony_ci        GetProgramParameterdvNV
38275bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
38285bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
38295bd8deadSopenharmony_ci            2           6               request length
38305bd8deadSopenharmony_ci            4           1320            vendor specific opcode
38315bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
38325bd8deadSopenharmony_ci            4           ENUM            target
38335bd8deadSopenharmony_ci            4           CARD32          index
38345bd8deadSopenharmony_ci            4           ENUM            pname
38355bd8deadSopenharmony_ci          =>
38365bd8deadSopenharmony_ci            1           1               reply
38375bd8deadSopenharmony_ci            1                           unused
38385bd8deadSopenharmony_ci            2           CARD16          sequence number
38395bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n*2)
38405bd8deadSopenharmony_ci            4                           unused
38415bd8deadSopenharmony_ci            4           CARD32          n
38425bd8deadSopenharmony_ci
38435bd8deadSopenharmony_ci            if (n=1) this follows:
38445bd8deadSopenharmony_ci
38455bd8deadSopenharmony_ci            8           FLOAT64         params
38465bd8deadSopenharmony_ci            8                           unused
38475bd8deadSopenharmony_ci
38485bd8deadSopenharmony_ci            otherwise this follows:
38495bd8deadSopenharmony_ci
38505bd8deadSopenharmony_ci            16                          unused
38515bd8deadSopenharmony_ci            n*8         LISTofFLOAT64   params
38525bd8deadSopenharmony_ci
38535bd8deadSopenharmony_ci        GetProgramivNV
38545bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
38555bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
38565bd8deadSopenharmony_ci            2           5               request length
38575bd8deadSopenharmony_ci            4           1298            vendor specific opcode
38585bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
38595bd8deadSopenharmony_ci            4           CARD32          id
38605bd8deadSopenharmony_ci            4           ENUM            pname
38615bd8deadSopenharmony_ci          =>
38625bd8deadSopenharmony_ci            1           1               reply
38635bd8deadSopenharmony_ci            1                           unused
38645bd8deadSopenharmony_ci            2           CARD16          sequence number
38655bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
38665bd8deadSopenharmony_ci            4                           unused
38675bd8deadSopenharmony_ci            4           CARD32          n
38685bd8deadSopenharmony_ci
38695bd8deadSopenharmony_ci            if (n=1) this follows:
38705bd8deadSopenharmony_ci
38715bd8deadSopenharmony_ci            4           INT32           params
38725bd8deadSopenharmony_ci            12                          unused
38735bd8deadSopenharmony_ci
38745bd8deadSopenharmony_ci            otherwise this follows:
38755bd8deadSopenharmony_ci
38765bd8deadSopenharmony_ci            16                          unused
38775bd8deadSopenharmony_ci            n*4         LISTofINT32     params
38785bd8deadSopenharmony_ci
38795bd8deadSopenharmony_ci        GetProgramStringNV
38805bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
38815bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
38825bd8deadSopenharmony_ci            2           5               request length
38835bd8deadSopenharmony_ci            4           1299            vendor specific opcode
38845bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
38855bd8deadSopenharmony_ci            4           CARD32          id
38865bd8deadSopenharmony_ci            4           ENUM            pname
38875bd8deadSopenharmony_ci          =>
38885bd8deadSopenharmony_ci            1           1               reply
38895bd8deadSopenharmony_ci            1                           unused
38905bd8deadSopenharmony_ci            2           CARD16          sequence number
38915bd8deadSopenharmony_ci            4           (n+p)/4         reply length
38925bd8deadSopenharmony_ci            4                           unused
38935bd8deadSopenharmony_ci            4           CARD32          n
38945bd8deadSopenharmony_ci            16                          unused
38955bd8deadSopenharmony_ci            n           STRING          program
38965bd8deadSopenharmony_ci            p                           unused, p=pad(n)
38975bd8deadSopenharmony_ci
38985bd8deadSopenharmony_ci        GetTrackMatrixivNV
38995bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
39005bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
39015bd8deadSopenharmony_ci            2           6               request length
39025bd8deadSopenharmony_ci            4           1300            vendor specific opcode
39035bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
39045bd8deadSopenharmony_ci            4           ENUM            target
39055bd8deadSopenharmony_ci            4           CARD32          address
39065bd8deadSopenharmony_ci            4           ENUM            pname
39075bd8deadSopenharmony_ci          =>
39085bd8deadSopenharmony_ci            1           1               reply
39095bd8deadSopenharmony_ci            1                           unused
39105bd8deadSopenharmony_ci            2           CARD16          sequence number
39115bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
39125bd8deadSopenharmony_ci            4                           unused
39135bd8deadSopenharmony_ci            4           CARD32          n
39145bd8deadSopenharmony_ci
39155bd8deadSopenharmony_ci            if (n=1) this follows:
39165bd8deadSopenharmony_ci
39175bd8deadSopenharmony_ci            4           INT32           params
39185bd8deadSopenharmony_ci            12                          unused
39195bd8deadSopenharmony_ci
39205bd8deadSopenharmony_ci            otherwise this follows:
39215bd8deadSopenharmony_ci
39225bd8deadSopenharmony_ci            16                          unused
39235bd8deadSopenharmony_ci            n*4         LISTofINT32     params
39245bd8deadSopenharmony_ci
39255bd8deadSopenharmony_ci        Note that ATTRIB_ARRAY_SIZE_NV, ATTRIB_ARRAY_STRIDE_NV, and
39265bd8deadSopenharmony_ci        ATTRIB_ARRAY_TYPE_NV may be queried by GetVertexAttribNV but generate
39275bd8deadSopenharmony_ci        no protocol and return client-side state.
39285bd8deadSopenharmony_ci
39295bd8deadSopenharmony_ci        GetVertexAttribdvNV
39305bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
39315bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
39325bd8deadSopenharmony_ci            2           5               request length
39335bd8deadSopenharmony_ci            4           1301            vendor specific opcode
39345bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
39355bd8deadSopenharmony_ci            4           INT32           index
39365bd8deadSopenharmony_ci            4           ENUM            pname
39375bd8deadSopenharmony_ci          =>
39385bd8deadSopenharmony_ci            1           1               reply
39395bd8deadSopenharmony_ci            1                           unused
39405bd8deadSopenharmony_ci            2           CARD16          sequence number
39415bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n*2)
39425bd8deadSopenharmony_ci            4                           unused
39435bd8deadSopenharmony_ci            4           CARD32          n
39445bd8deadSopenharmony_ci
39455bd8deadSopenharmony_ci            if (n=1) this follows:
39465bd8deadSopenharmony_ci
39475bd8deadSopenharmony_ci            8           FLOAT64         params
39485bd8deadSopenharmony_ci            8                           unused
39495bd8deadSopenharmony_ci
39505bd8deadSopenharmony_ci            otherwise this follows:
39515bd8deadSopenharmony_ci
39525bd8deadSopenharmony_ci            16                          unused
39535bd8deadSopenharmony_ci            n*8         LISTofFLOAT64   params
39545bd8deadSopenharmony_ci
39555bd8deadSopenharmony_ci        GetVertexAttribfvNV
39565bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
39575bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
39585bd8deadSopenharmony_ci            2           5               request length
39595bd8deadSopenharmony_ci            4           1302            vendor specific opcode
39605bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
39615bd8deadSopenharmony_ci            4           INT32           index
39625bd8deadSopenharmony_ci            4           ENUM            pname
39635bd8deadSopenharmony_ci          =>
39645bd8deadSopenharmony_ci            1           1               reply
39655bd8deadSopenharmony_ci            1                           unused
39665bd8deadSopenharmony_ci            2           CARD16          sequence number
39675bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
39685bd8deadSopenharmony_ci            4                           unused
39695bd8deadSopenharmony_ci            4           CARD32          n
39705bd8deadSopenharmony_ci
39715bd8deadSopenharmony_ci            if (n=1) this follows:
39725bd8deadSopenharmony_ci
39735bd8deadSopenharmony_ci            4           FLOAT32         params
39745bd8deadSopenharmony_ci            12                          unused
39755bd8deadSopenharmony_ci
39765bd8deadSopenharmony_ci            otherwise this follows:
39775bd8deadSopenharmony_ci
39785bd8deadSopenharmony_ci            16                          unused
39795bd8deadSopenharmony_ci            n*4         LISTofFLOAT32   params
39805bd8deadSopenharmony_ci
39815bd8deadSopenharmony_ci        GetVertexAttribivNV
39825bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
39835bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
39845bd8deadSopenharmony_ci            2           5               request length
39855bd8deadSopenharmony_ci            4           1303            vendor specific opcode
39865bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
39875bd8deadSopenharmony_ci            4           INT32           index
39885bd8deadSopenharmony_ci            4           ENUM            pname
39895bd8deadSopenharmony_ci          =>
39905bd8deadSopenharmony_ci            1           1               reply
39915bd8deadSopenharmony_ci            1                           unused
39925bd8deadSopenharmony_ci            2           CARD16          sequence number
39935bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
39945bd8deadSopenharmony_ci            4                           unused
39955bd8deadSopenharmony_ci            4           CARD32          n
39965bd8deadSopenharmony_ci
39975bd8deadSopenharmony_ci            if (n=1) this follows:
39985bd8deadSopenharmony_ci
39995bd8deadSopenharmony_ci            4           INT32           params
40005bd8deadSopenharmony_ci            12                          unused
40015bd8deadSopenharmony_ci
40025bd8deadSopenharmony_ci            otherwise this follows:
40035bd8deadSopenharmony_ci
40045bd8deadSopenharmony_ci            16                          unused
40055bd8deadSopenharmony_ci            n*4         LISTofINT32     params
40065bd8deadSopenharmony_ci
40075bd8deadSopenharmony_ci        GetVertexAttribPointervNV is an entirely client-side command
40085bd8deadSopenharmony_ci
40095bd8deadSopenharmony_ci        IsProgramNV
40105bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
40115bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
40125bd8deadSopenharmony_ci            2           4               request length
40135bd8deadSopenharmony_ci            4           1304            vendor specific opcode
40145bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
40155bd8deadSopenharmony_ci            4           INT32           n
40165bd8deadSopenharmony_ci          =>
40175bd8deadSopenharmony_ci            1           1               reply
40185bd8deadSopenharmony_ci            1                           unused
40195bd8deadSopenharmony_ci            2           CARD16          sequence number
40205bd8deadSopenharmony_ci            4           0               reply length
40215bd8deadSopenharmony_ci            4           BOOL32          return value
40225bd8deadSopenharmony_ci            20                          unused
40235bd8deadSopenharmony_ci
40245bd8deadSopenharmony_ciErrors 
40255bd8deadSopenharmony_ci
40265bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if VertexAttribNV is called
40275bd8deadSopenharmony_ci    where index is greater than 15.
40285bd8deadSopenharmony_ci
40295bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if any ProgramParameterNV has
40305bd8deadSopenharmony_ci    an index is greater than 95.
40315bd8deadSopenharmony_ci
40325bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if VertexAttribPointerNV
40335bd8deadSopenharmony_ci    is called where index is greater than 15.
40345bd8deadSopenharmony_ci
40355bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if VertexAttribPointerNV
40365bd8deadSopenharmony_ci    is called where size is not one of 1, 2, 3, or 4.
40375bd8deadSopenharmony_ci
40385bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if VertexAttribPointerNV
40395bd8deadSopenharmony_ci    is called where stride is negative.
40405bd8deadSopenharmony_ci
40415bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if VertexAttribPointerNV
40425bd8deadSopenharmony_ci    is called where type is UNSIGNED_BYTE and size is not 4.
40435bd8deadSopenharmony_ci
40445bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if LoadProgramNV is used to load a
40455bd8deadSopenharmony_ci    program with an id of zero.
40465bd8deadSopenharmony_ci
40475bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if LoadProgramNV is used
40485bd8deadSopenharmony_ci    to load an id that is currently loaded with a program of a different
40495bd8deadSopenharmony_ci    program target.
40505bd8deadSopenharmony_ci
40515bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if the program passed to
40525bd8deadSopenharmony_ci    LoadProgramNV fails to load because it is not syntactically correct
40535bd8deadSopenharmony_ci    based on the specified target.  The value of PROGRAM_ERROR_POSITION_NV
40545bd8deadSopenharmony_ci    is still updated when this error is generated.
40555bd8deadSopenharmony_ci
40565bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if LoadProgramNV has a
40575bd8deadSopenharmony_ci    target of VERTEX_PROGRAM_NV and the specified program fails to
40585bd8deadSopenharmony_ci    load because it does not write the HPOS register at least once.
40595bd8deadSopenharmony_ci    The value of PROGRAM_ERROR_POSITION_NV is still updated when this
40605bd8deadSopenharmony_ci    error is generated.
40615bd8deadSopenharmony_ci
40625bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if LoadProgramNV has a target
40635bd8deadSopenharmony_ci    of VERTEX_STATE_PROGRAM_NV and the specified program fails to load
40645bd8deadSopenharmony_ci    because it does not write at least one program parameter register.
40655bd8deadSopenharmony_ci    The value of PROGRAM_ERROR_POSITION_NV is still updated when this
40665bd8deadSopenharmony_ci    error is generated.
40675bd8deadSopenharmony_ci
40685bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if the vertex program
40695bd8deadSopenharmony_ci    or vertex state program passed to LoadProgramNV fails to load
40705bd8deadSopenharmony_ci    because it contains more than 128 instructions.  The value of
40715bd8deadSopenharmony_ci    PROGRAM_ERROR_POSITION_NV is still updated when this error is
40725bd8deadSopenharmony_ci    generated.
40735bd8deadSopenharmony_ci
40745bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if a program is loaded with
40755bd8deadSopenharmony_ci    LoadProgramNV for id when id is currently loaded with a program of
40765bd8deadSopenharmony_ci    a different target.
40775bd8deadSopenharmony_ci
40785bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BindProgramNV attempts
40795bd8deadSopenharmony_ci    to bind to a program name that is not a vertex program (for example,
40805bd8deadSopenharmony_ci    if the program is a vertex state program).
40815bd8deadSopenharmony_ci
40825bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GenProgramsNV is called
40835bd8deadSopenharmony_ci    where n is negative.
40845bd8deadSopenharmony_ci
40855bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if AreProgramsResidentNV is
40865bd8deadSopenharmony_ci    called and any of the queried programs are zero or do not exist.
40875bd8deadSopenharmony_ci
40885bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if ExecuteProgramNV executes
40895bd8deadSopenharmony_ci    a program that does not exist.
40905bd8deadSopenharmony_ci
40915bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if ExecuteProgramNV executes
40925bd8deadSopenharmony_ci    a program that is not a vertex state program.
40935bd8deadSopenharmony_ci
40945bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if ExecuteProgramNV is called
40955bd8deadSopenharmony_ci    and the vertex state program to execute writes program parameters
40965bd8deadSopenharmony_ci    that are currently being tracked.  
40975bd8deadSopenharmony_ci
40985bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if TrackMatrixNV has a target
40995bd8deadSopenharmony_ci    of VERTEX_PROGRAM_NV and attempts to track an address is not a
41005bd8deadSopenharmony_ci    multiple of four.
41015bd8deadSopenharmony_ci
41025bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GetProgramParameterNV is
41035bd8deadSopenharmony_ci    called to query an index greater than 95.
41045bd8deadSopenharmony_ci
41055bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GetVertexAttribNV is called
41065bd8deadSopenharmony_ci    to query an <index> greater than 15, or if <index> is zero and <pname>
41075bd8deadSopenharmony_ci    is CURRENT_ATTRIB_NV.
41085bd8deadSopenharmony_ci
41095bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GetVertexAttribPointervNV
41105bd8deadSopenharmony_ci    is called to query an index greater than 15.
41115bd8deadSopenharmony_ci
41125bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetProgramivNV is called
41135bd8deadSopenharmony_ci    and the program named id does not exist.
41145bd8deadSopenharmony_ci
41155bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetProgramStringNV is called
41165bd8deadSopenharmony_ci    and the program named <program> does not exist.
41175bd8deadSopenharmony_ci
41185bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GetTrackMatrixivNV is called
41195bd8deadSopenharmony_ci    with an <address> that is not divisible by four and not less than 96.
41205bd8deadSopenharmony_ci
41215bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if AreProgramsResidentNV,
41225bd8deadSopenharmony_ci    DeleteProgramsNV, GenProgramsNV, or RequestResidentProgramsNV are
41235bd8deadSopenharmony_ci    called where <n> is negative.
41245bd8deadSopenharmony_ci
41255bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if LoadProgramNV is called
41265bd8deadSopenharmony_ci    where <len> is negative.
41275bd8deadSopenharmony_ci
41285bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if ProgramParameters4dvNV or
41295bd8deadSopenharmony_ci    ProgramParameters4fvNV are called where <num> is negative.
41305bd8deadSopenharmony_ci
41315bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if
41325bd8deadSopenharmony_ci    VertexAttribs{1,2,3,4}{d,f,s}vNV is called where <n> is negative.
41335bd8deadSopenharmony_ci
41345bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if BindProgramNV,
41355bd8deadSopenharmony_ci    GetProgramParameterfvNV, GetProgramParameterdvNV, GetTrackMatrixivNV,
41365bd8deadSopenharmony_ci    ProgramParameter4fNV, ProgramParameter4dNV, ProgramParameter4fvNV,
41375bd8deadSopenharmony_ci    ProgramParameter4dvNV, ProgramParameters4fvNV, ProgramParameters4dvNV,
41385bd8deadSopenharmony_ci    or TrackMatrixNV are called where <target> is not VERTEX_PROGRAM_NV.
41395bd8deadSopenharmony_ci
41405bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if LoadProgramNV or
41415bd8deadSopenharmony_ci    ExecuteProgramNV are called where <target> is not either
41425bd8deadSopenharmony_ci    VERTEX_PROGRAM_NV or VERTEX_STATE_PROGRAM_NV.
41435bd8deadSopenharmony_ci
41445bd8deadSopenharmony_ciNew State
41455bd8deadSopenharmony_ci
41465bd8deadSopenharmony_ciupdate table 6.22 (page 212) so that all the "9"s are "25"s because there
41475bd8deadSopenharmony_ciare 9 conventional map targets and 16 vertex attribute map targets making
41485bd8deadSopenharmony_cia total of 25.
41495bd8deadSopenharmony_ci
41505bd8deadSopenharmony_ciGet Value                     Type    Get Command                  Initial Value  Description         Sec       Attribute
41515bd8deadSopenharmony_ci----------------------------  ------  ---------------------------  -------------  ------------------  --------  ------------
41525bd8deadSopenharmony_ciVERTEX_PROGRAM_NV             B       IsEnabled                    False          vertex program      2.10      enable
41535bd8deadSopenharmony_ci                                                                                  enable
41545bd8deadSopenharmony_ciVERTEX_PROGRAM_POINT_SIZE_NV  B       IsEnabled                    False          program-specified   2.14.1.5  enable
41555bd8deadSopenharmony_ci                                                                                  point size mode
41565bd8deadSopenharmony_ciVERTEX_PROGRAM_TWO_SIDE_NV    B       IsEnabled                    False          two-sided color     2.14.1.5  enable
41575bd8deadSopenharmony_ci                                                                                  mode
41585bd8deadSopenharmony_ciPROGRAM_ERROR_POSITION_NV     Z       GetIntegerv                  -1             last program        2.14.1.7  -
41595bd8deadSopenharmony_ci                                                                                  error position
41605bd8deadSopenharmony_ciPROGRAM_PARAMETER_NV          96xR4   GetProgramParameterNV        (0,0,0,0)      program parameters  2.14.1.2  -
41615bd8deadSopenharmony_ciCURRENT_ATTRIB_NV             16xR4   GetVertexAttribNV            see 2.14.6     vertex attributes   2.14.1.1  current
41625bd8deadSopenharmony_ci                                      but zero cannot be queried,
41635bd8deadSopenharmony_ci                                      aliased with per-vertex
41645bd8deadSopenharmony_ci                                      parameters
41655bd8deadSopenharmony_ciTRACK_MATRIX_NV               24xZ8+  GetTrackMatrixivNV           NONE           track matrix        2.14.5    -
41665bd8deadSopenharmony_ciTRACK_MATRIX_TRANSFORM_NV     24xZ8+  GetTrackMatrixivNV           IDENTITY_NV    track matrix        2.14.5    -
41675bd8deadSopenharmony_ci                                                                                  transform
41685bd8deadSopenharmony_ciVERTEX_PROGRAM_BINDING_NV     Z+      GetIntegerv                  0              bound vertex        2.14.1.8  -
41695bd8deadSopenharmony_ci                                                                                  program
41705bd8deadSopenharmony_ciVERTEX_ATTRIB_ARRAYn_NV       16xB    IsEnabled                    False          vertex attrib       2.14.3    vertex-array
41715bd8deadSopenharmony_ci                                                                                  array enable
41725bd8deadSopenharmony_ciATTRIB_ARRAY_SIZE_NV          16xZ    GetVertexAttribNV            4              vertex attrib       2.14.3    vertex-array
41735bd8deadSopenharmony_ci                                                                                  array size
41745bd8deadSopenharmony_ciATTRIB_ARRAY_STRIDE_NV        16xZ+   GetVertexAttribNV            0              vertex attrib       2.14.3    vertex-array
41755bd8deadSopenharmony_ci                                                                                  array stride
41765bd8deadSopenharmony_ciATTRIB_ARRAY_TYPE_NV          16xZ4   GetVertexAttribNV            FLOAT          vertex attrib       2.14.3    vertex-array
41775bd8deadSopenharmony_ci                                                                                  array type
41785bd8deadSopenharmony_ci
41795bd8deadSopenharmony_ciTable X.5.  New State Introduced by NV_vertex_program.
41805bd8deadSopenharmony_ci
41815bd8deadSopenharmony_ci
41825bd8deadSopenharmony_ciGet Value            Type    Get Command          Initial Value  Description         Sec       Attribute
41835bd8deadSopenharmony_ci-------------------  ------  ------------------   -------------  ------------------  --------  ---------
41845bd8deadSopenharmony_ciPROGRAM_TARGET_NV    Z2      GetProgramivNV       0              program target      6.1.13    -
41855bd8deadSopenharmony_ciPROGRAM_LENGTH_NV    Z+      GetProgramivNV       0              program length      6.1.13    -
41865bd8deadSopenharmony_ciPROGRAM_RESIDENT_NV  Z2      GetProgramivNV       False          program residency   6.1.13    -
41875bd8deadSopenharmony_ciPROGRAM_STRING_NV    ubxn    GetProgramStringNV   ""             program string      6.1.13    -
41885bd8deadSopenharmony_ci
41895bd8deadSopenharmony_ciTable X.6.  Program Object State.
41905bd8deadSopenharmony_ci
41915bd8deadSopenharmony_ci
41925bd8deadSopenharmony_ciGet Value    Type    Get Command   Initial Value  Description              Sec       Attribute
41935bd8deadSopenharmony_ci---------    ------  -----------   -------------  -----------------------  --------  ---------
41945bd8deadSopenharmony_ci-            12xR4   -             (0,0,0,0)      temporary registers      2.14.1.4  -
41955bd8deadSopenharmony_ci-            15xR4   -             (0,0,0,1)      vertex result registers  2.14.1.4  -
41965bd8deadSopenharmony_ci             Z4      -             (0,0,0,0)      vertex program           2.14.1.3  -
41975bd8deadSopenharmony_ci                                                  address register
41985bd8deadSopenharmony_ci
41995bd8deadSopenharmony_ciTable X.7.  Vertex Program Per-vertex Execution State.
42005bd8deadSopenharmony_ci
42015bd8deadSopenharmony_ci
42025bd8deadSopenharmony_ciGet Value                         Type      Get Command      Initial Value  Description          Sec      Attribute
42035bd8deadSopenharmony_ci-----------------------------     --------  --------------   -------------  -------------------  -------  ---------
42045bd8deadSopenharmony_ciCURRENT_MATRIX_STACK_DEPTH_NV     m*Z+      GetIntegerv      1              current stack depth  6.1.14   -
42055bd8deadSopenharmony_ciCURRENT_MATRIX_NV                 m*n*xM^4  GetFloatv        Identity       current matrix       6.1.14   -
42065bd8deadSopenharmony_ci
42075bd8deadSopenharmony_ciTable X.8.  Current matrix state where m is the total number of matrices
42085bd8deadSopenharmony_ciincluding texture matrices and tracking matrices and n is the number of
42095bd8deadSopenharmony_cimatrices on each particular matrix stack.  Note that this state is
42105bd8deadSopenharmony_cialiased with existing matrix state.
42115bd8deadSopenharmony_ci
42125bd8deadSopenharmony_ci
42135bd8deadSopenharmony_ciNew Implementation Dependent State
42145bd8deadSopenharmony_ci                                                        Minimum
42155bd8deadSopenharmony_ciGet Value                         Type    Get Command   Value       Description         Sec     Attribute
42165bd8deadSopenharmony_ci--------------------------------  ----    -----------   ----------  ------------------  ------  ---------
42175bd8deadSopenharmony_ciMAX_TRACK_MATRIX_STACK_DEPTH_NV   Z+      GetIntegerv   1           maximum tracking    2.14.5  -
42185bd8deadSopenharmony_ci                                                                    matrix stack depth
42195bd8deadSopenharmony_ciMAX_TRACK_MATRICES_NV             Z+      GetIntegerv   8 (not to   maximum number of   2.14.5  -
42205bd8deadSopenharmony_ci                                                        exceed 32)  tracking matrices
42215bd8deadSopenharmony_ci
42225bd8deadSopenharmony_ciTable X.9.  New Implementation-Dependent Values Introduced by NV_vertex_program.
42235bd8deadSopenharmony_ci
42245bd8deadSopenharmony_ci
42255bd8deadSopenharmony_ciRevision History
42265bd8deadSopenharmony_ci
42275bd8deadSopenharmony_ci    Version 1.1:
42285bd8deadSopenharmony_ci
42295bd8deadSopenharmony_ci      Added normalization example to Issues.
42305bd8deadSopenharmony_ci
42315bd8deadSopenharmony_ci      Fix explanation of EXP and ARL floor equivalence.
42325bd8deadSopenharmony_ci
42335bd8deadSopenharmony_ci      Clarify that vertex state programs fail if they load more than
42345bd8deadSopenharmony_ci      one vertex attribute (though only one is possible).
42355bd8deadSopenharmony_ci
42365bd8deadSopenharmony_ci    Version 1.2
42375bd8deadSopenharmony_ci
42385bd8deadSopenharmony_ci      Add GLX protocol for VertexAttrib4ubvNV and VertexAttribs4ubvNV
42395bd8deadSopenharmony_ci
42405bd8deadSopenharmony_ci      Add issue about TrackMatrixNV transform behavior with example
42415bd8deadSopenharmony_ci
42425bd8deadSopenharmony_ci      Fix the C code specifying VertexAttribsvNV
42435bd8deadSopenharmony_ci
42445bd8deadSopenharmony_ci    Version 1.3
42455bd8deadSopenharmony_ci
42465bd8deadSopenharmony_ci      Dropped support for INT typed vertex attrib arrays.
42475bd8deadSopenharmony_ci
42485bd8deadSopenharmony_ci      Clarify that when ArrayElement is executed and vertex program
42495bd8deadSopenharmony_ci      mode is enabled and the vertex attrib 0 array is enabled, the
42505bd8deadSopenharmony_ci      vertex attrib 0 array command is executed last.  However when
42515bd8deadSopenharmony_ci      ArrayElement is executed and vertex program mode is enabled and the
42525bd8deadSopenharmony_ci      vertex attrib 0 array is disabled and the vertex array is enabled,
42535bd8deadSopenharmony_ci      the vertex array command is executed last.
42545bd8deadSopenharmony_ci
42555bd8deadSopenharmony_ci    Version 1.4
42565bd8deadSopenharmony_ci
42575bd8deadSopenharmony_ci      Allow TEXTUREi_ARB for the track matrix.  This allows matrix
42585bd8deadSopenharmony_ci      tracking of a particular texture matrix without reference to active
42595bd8deadSopenharmony_ci      texture (set by glActiveTextureARB) state.
42605bd8deadSopenharmony_ci
42615bd8deadSopenharmony_ci      Early NVIDIA drivers (prior to October 5, 2001) have a bug
42625bd8deadSopenharmony_ci      in their handling of tracking matrices specified with TEXTURE.
42635bd8deadSopenharmony_ci      Rather than tracking the particular texture matrix indicated
42645bd8deadSopenharmony_ci      by the active texture state when TrackMatrixNV is called, these
42655bd8deadSopenharmony_ci      early drivers incorrectly track matrix the active texture's texture
42665bd8deadSopenharmony_ci      matrix _at track matrix validation time_.  In practice this means,
42675bd8deadSopenharmony_ci      every tracked matrix defined with TEXTURE tracks the same matrix
42685bd8deadSopenharmony_ci      values; you cannot track distinct texture matrices at the same
42695bd8deadSopenharmony_ci      time and the texture matrix you actually track depends on the
42705bd8deadSopenharmony_ci      active texture matrix at validation time.  This is a driver bug.
42715bd8deadSopenharmony_ci
42725bd8deadSopenharmony_ci      Drivers after October 5, 2001 properly track the texture matrix
42735bd8deadSopenharmony_ci      specified by active texture when TrackMatrix is called.
42745bd8deadSopenharmony_ci
42755bd8deadSopenharmony_ci      The new correct drivers can be distinguished from the old drivers
42765bd8deadSopenharmony_ci      at run time with the following code:
42775bd8deadSopenharmony_ci
42785bd8deadSopenharmony_ci         while (glGetError() != GL_NO_ERROR);  // Clear any pre-existing OpenGL errors.
42795bd8deadSopenharmony_ci         glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 8, GL_TEXTURE0_ARB, GL_IDENTITY_NV);
42805bd8deadSopenharmony_ci         if (glGetError() != GL_NO_ERROR) {
42815bd8deadSopenharmony_ci           // Old buggy pre-version 1.4 drivers with GL_TEXTURE
42825bd8deadSopenharmony_ci           // glTrackMatrixNV bug.
42835bd8deadSopenharmony_ci         } else {
42845bd8deadSopenharmony_ci           // Correct new version 1.4 drivers (or later) with GL_TEXTURE
42855bd8deadSopenharmony_ci           // glTrackMatrixNV bug fixed and GL_TEXTUREi_NV support.
42865bd8deadSopenharmony_ci
42875bd8deadSopenharmony_ci           // Note: you may want to untrack the matrix at this point.
42885bd8deadSopenharmony_ci         }
42895bd8deadSopenharmony_ci
42905bd8deadSopenharmony_ci    Version 1.5
42915bd8deadSopenharmony_ci
42925bd8deadSopenharmony_ci      Earlier versions of this specification claimed for
42935bd8deadSopenharmony_ci      GetVertexAttribARB that it is an error to query any vertex attrib
42945bd8deadSopenharmony_ci      state for vertex attrib array zero.  In fact, it should only be
42955bd8deadSopenharmony_ci      an error to query the CURRENT_ATTRIB_ARB state for vertex attrib
42965bd8deadSopenharmony_ci      zero; the size, stride, and type of vertex attrib array zero may
42975bd8deadSopenharmony_ci      be queried.  Version 1.5 specifies the correct behavior.
42985bd8deadSopenharmony_ci
42995bd8deadSopenharmony_ci      Early NVIDIA drivers (prior to January 11, 2002) did not implement
43005bd8deadSopenharmony_ci      generate error when querying vertex attrib array zero state (ie,
43015bd8deadSopenharmony_ci      did the right thing for size, stride, and type) but not create an
43025bd8deadSopenharmony_ci      error when querying the current attribute values for vertex attrib
43035bd8deadSopenharmony_ci      array zero either.
43045bd8deadSopenharmony_ci
43055bd8deadSopenharmony_ci    Version 1.6
43065bd8deadSopenharmony_ci
43075bd8deadSopenharmony_ci      GLX opcodes and vendorpriv values assigned.
43085bd8deadSopenharmony_ci
43095bd8deadSopenharmony_ci    Version 1.7
43105bd8deadSopenharmony_ci
43115bd8deadSopenharmony_ci      Corrected matrix tracking example in the issues list to properly
43125bd8deadSopenharmony_ci      document row vs. column-major differences.
43135bd8deadSopenharmony_ci
43145bd8deadSopenharmony_ci    Version 1.8
43155bd8deadSopenharmony_ci
43165bd8deadSopenharmony_ci      Corrected EXP instruction; W component of result is always 1.0.
43175bd8deadSopenharmony_ci
43185bd8deadSopenharmony_ci    Version 1.9
43195bd8deadSopenharmony_ci
43205bd8deadSopenharmony_ci      Added language that for SGE and SLT, -NaN < -Inf and +NaN > +Inf.
43215bd8deadSopenharmony_ci
43225bd8deadSopenharmony_ci    Version 1.10
43235bd8deadSopenharmony_ci
43245bd8deadSopenharmony_ci      Fixed GLX protocol conflicts between ARB_vertex_program and
43255bd8deadSopenharmony_ci      NV_vertex_program.  VertexAttrib* functions shared the same opcodes, but
43265bd8deadSopenharmony_ci      had different attribute aliasing behavior.  In particular, setting
43275bd8deadSopenharmony_ci      attribute 3 changes the current color in NV_vertex program, may or may
43285bd8deadSopenharmony_ci      not change current color in ARB_vertex program, and may not change the
43295bd8deadSopenharmony_ci      current color with ARB_vertex_program as extended by ARB_vertex_shader.
43305bd8deadSopenharmony_ci      Renumbered the NV_vertex_program opcodes since they were not currently
43315bd8deadSopenharmony_ci      used by shipping GLX implementations.  Also, fixed the aliasing between
43325bd8deadSopenharmony_ci      GetProgramParameter*NV and GetProgramEnvParameter*ARB, which have
43335bd8deadSopenharmony_ci      different prototypes -- the ARB functions do not use the <pname>
43345bd8deadSopenharmony_ci      parameter.  Again, fixed by renumbering NV protocol.
4335