15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_vertex_program2_option
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_vertex_program2_option
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciStatus
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Shipping.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciVersion
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Last Modified:      06/23/2004
205bd8deadSopenharmony_ci    NVIDIA Revision:    3
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciNumber
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    305
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciDependencies
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    ARB_vertex_program is required.
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciOverview
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    This extension provides additional vertex program functionality
335bd8deadSopenharmony_ci    to extend the standard ARB_vertex_program language and execution
345bd8deadSopenharmony_ci    environment.  ARB programs wishing to use this added functionality
355bd8deadSopenharmony_ci    need only add:
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci        OPTION NV_vertex_program2;
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    to the beginning of their vertex programs.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    The functionality provided by this extension, which is roughly
425bd8deadSopenharmony_ci    equivalent to that provided by the NV_vertex_program2 extension,
435bd8deadSopenharmony_ci    includes:
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci      * general purpose dynamic branching,
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci      * subroutine calls,
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci      * data-dependent conditional write masks,
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci      * programmable user clip distances,
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci      * address registers with four components (instead of just one),
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci      * absolute value operator on scalar and swizzled operand loads,
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci      * rudimentary address register math,
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci      * SIN and COS trigonometry instructions, and
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci      * fully orthogonal "set on" instructions, including a "set sign"
625bd8deadSopenharmony_ci        instruction.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciIssues
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    Why is this a separate extension, rather than just an additional
675bd8deadSopenharmony_ci    feature of NV_vertex_program2?
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci      RESOLVED:  The NV_vertex_program2 specification was completed
705bd8deadSopenharmony_ci      (with a published implementation) prior to the completion of
715bd8deadSopenharmony_ci      ARB_vertex_program.  Future NVIDIA vertex program extensions should
725bd8deadSopenharmony_ci      contain extensions to the ARB_vertex_program execution environment
735bd8deadSopenharmony_ci      as a standard feature.
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    NV_vertex_program1_1 contains one feature not found in
765bd8deadSopenharmony_ci    ARB_vertex_program: the "RCC" (reciprocal clamped) instruction.
775bd8deadSopenharmony_ci    Should a "NV_vertex_program1_1" program option be provided to expose
785bd8deadSopenharmony_ci    this small amount of missing functionality?
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci      RESOLVED:  No.  By itself, that functionality is not all that
815bd8deadSopenharmony_ci      interesting.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Should this extension provide a mechanism to specify an "ARB"
845bd8deadSopenharmony_ci    version of NV_vertex_program state programs (!!VSP1.0)?
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci      RESOLVED:  No.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    Should a similar option be provided to expose ARB_vertex_program
895bd8deadSopenharmony_ci    features not found in NV_vertex_program (e.g., local parameters, state
905bd8deadSopenharmony_ci    bindings, certain "macro" instructions) under the NV_vertex_program
915bd8deadSopenharmony_ci    interface?
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci      RESOLVED:  No.  Why not just write an ARB program in that case?
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    The ARB_vertex_program spec has a minor grammar bug that requires
965bd8deadSopenharmony_ci    that inline scalar constants used as scalar operands include a
975bd8deadSopenharmony_ci    component selector.  In other words, you have to say "11.0.x" to
985bd8deadSopenharmony_ci    use the constant "11.0".  What should we do here?
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci      RESOLVED:  The NV_vertex_program2_option grammar will correct
1015bd8deadSopenharmony_ci      this problem, which should be fixed in future revisions to the
1025bd8deadSopenharmony_ci      ARB language.
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ciNew Procedures and Functions
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    None.
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ciNew Tokens
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetProgramivARB:
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci        MAX_PROGRAM_EXEC_INSTRUCTIONS_NV                0x88F4
1135bd8deadSopenharmony_ci        MAX_PROGRAM_CALL_DEPTH_NV                       0x88F5
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation)
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    Modify Section 2.11, Clipping (p. 42)
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    (insert before the second paragraph, p. 43) In vertex program mode,
1205bd8deadSopenharmony_ci    conventional user clipping is performed if the vertex program is
1215bd8deadSopenharmony_ci    position-invariant (section 2.14.4.5.1).  When the vertex program
1225bd8deadSopenharmony_ci    is not position-invariant, it can write a single floating-point clip
1235bd8deadSopenharmony_ci    distance for each supported clip plane.  The half-space corresponding
1245bd8deadSopenharmony_ci    to clip plane <n> is given by the set of points that satisfy the
1255bd8deadSopenharmony_ci    inequality
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci      c_n(P) >=0,
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    where c_n(P) is the value of clip distance <n> at point P.  For point
1305bd8deadSopenharmony_ci    primitives, c_n(P) is simply the clip distance for the vertex in
1315bd8deadSopenharmony_ci    question.  For line and triangle primitives, per-vertex clip distances
1325bd8deadSopenharmony_ci    are interpolated using a weighted mean, with weights derived according
1335bd8deadSopenharmony_ci    to the algorithms described in sections 3.4 and 3.5.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    Modify Section 2.14.2, Vertex Program Grammar and Restrictions
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    (mostly add to existing grammar rules, modify a few existing grammar
1385bd8deadSopenharmony_ci    rules -- changes marked with "***")
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    <optionName>            ::= "NV_vertex_program2"
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ci    <statement>             ::= <branchLabel> ":"
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    <instruction>           ::= <FlowInstruction>
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    <ALUInstruction>        ::= <ARAop_instruction>
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    <FlowInstruction>       ::= <BRAop_instruction>
1495bd8deadSopenharmony_ci                              | <FLOWCCop_instruction>
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    <VECTORop>              ::= "SSG"
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    <SCALARop>              ::= "COS"
1545bd8deadSopenharmony_ci                              | "RCC"
1555bd8deadSopenharmony_ci                              | "SIN"
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci    <BINop>                 ::= "SEQ"
1585bd8deadSopenharmony_ci                              | "SFL"
1595bd8deadSopenharmony_ci                              | "SGT"
1605bd8deadSopenharmony_ci                              | "SLE"
1615bd8deadSopenharmony_ci                              | "SNE"
1625bd8deadSopenharmony_ci                              | "STR"
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    <ARLop>                 ::= "ARR"
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    <ARLop_src>             ::= <instOperandV>  
1675bd8deadSopenharmony_ci                                  (*** instead of <instOperandS>)
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    <ARAop_instruction>     ::= <ARAop> <instResultAddr> "," 
1705bd8deadSopenharmony_ci                                <instOperandAddrVNS>
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    <ARAop>                 ::= "ARA"
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    <BRAop_instruction>     ::= <BRAop> <branchLabel> <optBranchCond>
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci    <BRAop>                 ::= "BRA"
1775bd8deadSopenharmony_ci                              | "CAL"
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    <FLOWCCop_instruction>  ::= <FLOWCCop> <optBranchCond>
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    <FLOWCCop>              ::= "RET"
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    <optBranchCond>         ::= /* empty */
1845bd8deadSopenharmony_ci                              | <ccMask>
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci    <instOperandV>          ::= <instOperandAbsV>
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    <instOperandAbsV>       ::= <optSign> "|" <instOperandBaseV> "|"
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    <instOperandS>          ::= <instOperandAbsS>
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    <instOperandAbsS>       ::= <optSign> "|" <instOperandBaseS> "|"
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    <instOperandAddrVNS>    ::= <addrUseVNS>
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    <instResult>            ::= <instResultCC>
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    <instResultCC>          ::= <instResultBase> <ccMask>
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    <instResultAddr>        ::= <instResultAddrCC>
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    <instResultAddrCC>      ::= <instResultAddrBase> <ccMask>
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    <branchLabel>           ::= <identifier>
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    <paramUseV>             ::= <constantScalar> 
2085bd8deadSopenharmony_ci                                  (*** instead of <constantScalar>
2095bd8deadSopenharmony_ci                                       <swizzleSuffix>)
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    <paramUseS>             ::= <constantScalar> 
2125bd8deadSopenharmony_ci                                  (*** instead of <constantScalar>
2135bd8deadSopenharmony_ci                                       <scalarSuffix>)
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    <resultVtxBasic>        ::= "clip" "[" <clipPlaneNum> "]"
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci    <addrUseVNS>            ::= <addrVarName>
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    <addrUseW>              ::= <addrVarName> <optAddrWriteMask>
2205bd8deadSopenharmony_ci                                  (*** instead of <addrVarName> 
2215bd8deadSopenharmony_ci                                       <addrWriteMask>)
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    <ccMask>                ::= "(" <ccTest> ")"
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci    <ccTest>                ::= <ccMaskRule> <swizzleSuffix>
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci    <ccMaskRule>            ::= "EQ"
2285bd8deadSopenharmony_ci                              | "GE"
2295bd8deadSopenharmony_ci                              | "GT"
2305bd8deadSopenharmony_ci                              | "LE"
2315bd8deadSopenharmony_ci                              | "LT"
2325bd8deadSopenharmony_ci                              | "NE"
2335bd8deadSopenharmony_ci                              | "TR"
2345bd8deadSopenharmony_ci                              | "FL"
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    <optAddrWriteMask>      ::= <optWriteMask> 
2375bd8deadSopenharmony_ci                                  (*** instead of "." "x")
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    <addrComponent>         ::= <xyzwComponent> 
2405bd8deadSopenharmony_ci                                  (*** instead of "x")
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    (modify description of reserved identifiers)
2435bd8deadSopenharmony_ci    
2445bd8deadSopenharmony_ci    ... The following strings are reserved keywords and may not be used
2455bd8deadSopenharmony_ci    as identifiers:
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci        ABS, ADD, ADDRESS, ALIAS, ARA, ARL, ARR, ATTRIB, BRA, CAL, COS,
2485bd8deadSopenharmony_ci        DP3, DP4, DPH, DST, END, EX2, EXP, FLR, FRC, LG2, LIT, LOG, MAD,
2495bd8deadSopenharmony_ci        MAX, MIN, MOV, MUL, OPTION, OUTPUT, PARAM, POW, RCC, RCP, RET,
2505bd8deadSopenharmony_ci        RSQ, SEQ, SFL, SGE, SGT, SIN, SLE, SLT, SNE, SUB, SSG, STR, SWZ,
2515bd8deadSopenharmony_ci        TEMP, XPD, program, result, state, and vertex.
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci    Add to Section 2.14.3.4, Vertex Program Results
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    (add to binding table)
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci      Binding                        Components  Description
2585bd8deadSopenharmony_ci      -----------------------------  ----------  ----------------------------
2595bd8deadSopenharmony_ci      result.clip[n]                 (d,*,*,*)   clip plane distance
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    (add a paragraph before the last one) If a result variable binding
2625bd8deadSopenharmony_ci    matches "result.clip[n]", updates to the "x" component of the result
2635bd8deadSopenharmony_ci    variable set the clip distance for clip plane <n>.
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    (modify last paragraph) When in vertex program mode, all attributes
2665bd8deadSopenharmony_ci    of a transformed vertex, except for clip distances, are undefined
2675bd8deadSopenharmony_ci    at each vertex program invocation.  Any results, or even individual
2685bd8deadSopenharmony_ci    components of results, that are not written to during vertex program
2695bd8deadSopenharmony_ci    execution remain undefined.  All clip distances are initially zero,
2705bd8deadSopenharmony_ci    and remain zero if not written by the vertex program.
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    Modify Section 2.14.3.5, Vertex Program Address Registers
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    (modify first paragraph) Vertex program address register variables are
2755bd8deadSopenharmony_ci    a set of four-component signed integer vectors.  Address registers
2765bd8deadSopenharmony_ci    are used as indices when performing relative addressing in program
2775bd8deadSopenharmony_ci    parameter arrays (section 2.14.4.2).
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci    (modify third paragraph) Vertex program address register variables are
2805bd8deadSopenharmony_ci    undefined at each vertex program invocation.  Address registers can
2815bd8deadSopenharmony_ci    be written by the ARA, ARL, and ARL instructions (section 2.14.5),
2825bd8deadSopenharmony_ci    and will be read by the ARA instruction and when a program uses
2835bd8deadSopenharmony_ci    relative addressing in program parameter arrays.
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    Add New Section 2.14.3.X, Condition Code Register (insert after
2865bd8deadSopenharmony_ci    Section 2.14.3.5, Vertex Program Address Registers)
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    The vertex program condition code register is a single four-component
2895bd8deadSopenharmony_ci    vector.  Each component of this register is one of four enumerated
2905bd8deadSopenharmony_ci    values: GT (greater than), EQ (equal), LT (less than), or UN
2915bd8deadSopenharmony_ci    (unordered).  The condition code register can be used to mask writes
2925bd8deadSopenharmony_ci    to registers and to evaluate conditional branches.
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    Most vertex program instructions can optionally update the condition
2955bd8deadSopenharmony_ci    code register.  When a vertex program instruction updates the
2965bd8deadSopenharmony_ci    condition code register, a condition code component is set to LT if
2975bd8deadSopenharmony_ci    the corresponding component of the result is less than zero, EQ if it
2985bd8deadSopenharmony_ci    is equal to zero, GT if it is greater than zero, and UN if it is NaN
2995bd8deadSopenharmony_ci    (not a number).
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    The condition code register is initialized to a vector of EQ values
3025bd8deadSopenharmony_ci    each time a vertex program executes.
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    Modify Section 2.14.4, Vertex Program Execution Environment
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    (modify 3rd paragraph) Vertex programs execute a sequence of
3075bd8deadSopenharmony_ci    instructions, with support for conditional and unconditional branches,
3085bd8deadSopenharmony_ci    subroutine calls, and returns.  Vertex programs begin by executing
3095bd8deadSopenharmony_ci    the instruction following the label "main".  If no label "main" is
3105bd8deadSopenharmony_ci    defined, execution begins at the first instruction in the program.
3115bd8deadSopenharmony_ci    Instructions are executed in the order specified in the program,
3125bd8deadSopenharmony_ci    jumping when specified in branch instructions, until the end of the
3135bd8deadSopenharmony_ci    program is reached.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    (modify instruction table) There are forty-two vertex program
3165bd8deadSopenharmony_ci    instructions.  Vertex program instructions may have an optional
3175bd8deadSopenharmony_ci    suffix of "C" to allow an update of the condition code register
3185bd8deadSopenharmony_ci    (section 2.14.3.X).  For example, there are two instructions to
3195bd8deadSopenharmony_ci    perform vector addition, "ADD" and "ADDC".  The instructions and their
3205bd8deadSopenharmony_ci    respective input and output parameters are summarized in Table X.5.
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci      Instruction    Inputs  Output   Description
3235bd8deadSopenharmony_ci      -----------    ------  ------   --------------------------------
3245bd8deadSopenharmony_ci      ABS[C]         v       v        absolute value
3255bd8deadSopenharmony_ci      ADD[C]         v,v     v        add
3265bd8deadSopenharmony_ci      ARA[C]         a       a        address register add
3275bd8deadSopenharmony_ci      ARL[C]         s       a        address register load
3285bd8deadSopenharmony_ci      ARR[C]         v       a        address register load (round)
3295bd8deadSopenharmony_ci      BRA            c       -        branch
3305bd8deadSopenharmony_ci      CAL            c       -        subroutine call
3315bd8deadSopenharmony_ci      COS[C]         s       ssss     cosine
3325bd8deadSopenharmony_ci      DP3[C]         v,v     ssss     3-component dot product
3335bd8deadSopenharmony_ci      DP4[C]         v,v     ssss     4-component dot product
3345bd8deadSopenharmony_ci      DPH[C]         v,v     ssss     homogeneous dot product
3355bd8deadSopenharmony_ci      DST[C]         v,v     v        distance vector
3365bd8deadSopenharmony_ci      EX2[C]         s       ssss     exponential base 2
3375bd8deadSopenharmony_ci      EXP[C]         s       v        exponential base 2 (approximate)
3385bd8deadSopenharmony_ci      FLR[C]         v       v        floor
3395bd8deadSopenharmony_ci      FRC[C]         v       v        fraction
3405bd8deadSopenharmony_ci      LG2[C]         s       ssss     logarithm base 2
3415bd8deadSopenharmony_ci      LIT[C]         v       v        compute light coefficients
3425bd8deadSopenharmony_ci      LOG[C]         s       v        logarithm base 2 (approximate)
3435bd8deadSopenharmony_ci      MAD[C]         v,v,v   v        multiply and add
3445bd8deadSopenharmony_ci      MAX[C]         v,v     v        maximum
3455bd8deadSopenharmony_ci      MIN[C]         v,v     v        minimum
3465bd8deadSopenharmony_ci      MOV[C]         v       v        move
3475bd8deadSopenharmony_ci      MUL[C]         v,v     v        multiply
3485bd8deadSopenharmony_ci      POW[C]         s,s     ssss     exponentiate
3495bd8deadSopenharmony_ci      RCC[C]         s       ssss     reciprocal (clamped)
3505bd8deadSopenharmony_ci      RCP[C]         s       ssss     reciprocal
3515bd8deadSopenharmony_ci      RET            c       -        subroutine return
3525bd8deadSopenharmony_ci      RSQ[C]         s       ssss     reciprocal square root
3535bd8deadSopenharmony_ci      SEQ[C]         v,v     v        set on equal
3545bd8deadSopenharmony_ci      SFL[C]         v,v     v        set on false
3555bd8deadSopenharmony_ci      SGE[C]         v,v     v        set on greater than or equal
3565bd8deadSopenharmony_ci      SGT[C]         v,v     v        set on greater than
3575bd8deadSopenharmony_ci      SIN[C]         s       ssss     sine
3585bd8deadSopenharmony_ci      SLE[C]         v,v     v        set on less than or equal
3595bd8deadSopenharmony_ci      SLT[C]         v,v     v        set on less than
3605bd8deadSopenharmony_ci      SNE[C]         v,v     v        set on not equal
3615bd8deadSopenharmony_ci      SSG[C]         v       v        set sign
3625bd8deadSopenharmony_ci      STR[C]         v,v     v        set on true
3635bd8deadSopenharmony_ci      SUB[C]         v,v     v        subtract
3645bd8deadSopenharmony_ci      SWZ[C]         v       v        extended swizzle
3655bd8deadSopenharmony_ci      XPD[C]         v,v     v        cross product
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci      Table X.5:  Summary of vertex program instructions.  "[C]" indicates
3685bd8deadSopenharmony_ci      that the opcode supports the condition code update modifier. "v"
3695bd8deadSopenharmony_ci      indicates a floating-point vector input or output, "s" indicates
3705bd8deadSopenharmony_ci      a floating-point scalar input, "ssss" indicates a scalar output
3715bd8deadSopenharmony_ci      replicated across a 4-component result vector, "a" indicates a
3725bd8deadSopenharmony_ci      vector address register, and "c" indicates a condition code test.
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci    Modify Section 2.14.4.1, Vertex Program Operands
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ci    (add prior to the discussion of negation) A component-wise absolute
3775bd8deadSopenharmony_ci    value operation can optionally performed on the operand if the operand
3785bd8deadSopenharmony_ci    is surrounded with two "|" characters.  For example, "|src|" indicates
3795bd8deadSopenharmony_ci    that a component-wise absolute value operation should be performed on
3805bd8deadSopenharmony_ci    the variable named "src".  In terms of the grammar, this operation
3815bd8deadSopenharmony_ci    is performed if the <instOperandV> or <instOperandS> grammar rules
3825bd8deadSopenharmony_ci    match <instOperandAbsV> or <instOperandAbsS>, respectively.
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    (modify operand load pseudo-code) The following pseudo-code spells
3855bd8deadSopenharmony_ci    out the operand generation process.  In the example, "float" is a
3865bd8deadSopenharmony_ci    floating-point scalar type, while "floatVec" is a four-component
3875bd8deadSopenharmony_ci    vector.  "source" refers to the register used for the operand,
3885bd8deadSopenharmony_ci    matching the <srcReg> rule.  "abs" is TRUE if an absolute value
3895bd8deadSopenharmony_ci    operation should be performed on the operand (<instOperandAbsV> or
3905bd8deadSopenharmony_ci    <instOperandAbsS> rules) "negate" is TRUE if the <optionalSign> rule
3915bd8deadSopenharmony_ci    in <scalarSrcReg> or <swizzleSrcReg> matches "-" and FALSE otherwise.
3925bd8deadSopenharmony_ci    The ".c***", ".*c**", ".**c*", ".***c" modifiers refer to the x,
3935bd8deadSopenharmony_ci    y, z, and w components obtained by the swizzle operation; the ".c"
3945bd8deadSopenharmony_ci    modifier refers to the single component selected for a scalar load.
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci      floatVec VectorLoad(floatVec source)
3975bd8deadSopenharmony_ci      {
3985bd8deadSopenharmony_ci          floatVec operand;
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci          operand.x = source.c***;
4015bd8deadSopenharmony_ci          operand.y = source.*c**;
4025bd8deadSopenharmony_ci          operand.z = source.**c*;
4035bd8deadSopenharmony_ci          operand.w = source.***c;
4045bd8deadSopenharmony_ci          if (abs) {
4055bd8deadSopenharmony_ci             operand.x = abs(operand.x);
4065bd8deadSopenharmony_ci             operand.y = abs(operand.y);
4075bd8deadSopenharmony_ci             operand.z = abs(operand.z);
4085bd8deadSopenharmony_ci             operand.w = abs(operand.w);
4095bd8deadSopenharmony_ci          }
4105bd8deadSopenharmony_ci          if (negate) {
4115bd8deadSopenharmony_ci             operand.x = -operand.x;
4125bd8deadSopenharmony_ci             operand.y = -operand.y;
4135bd8deadSopenharmony_ci             operand.z = -operand.z;
4145bd8deadSopenharmony_ci             operand.w = -operand.w;
4155bd8deadSopenharmony_ci          }
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci          return operand;
4185bd8deadSopenharmony_ci      }
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci      float ScalarLoad(floatVec source) 
4215bd8deadSopenharmony_ci      {
4225bd8deadSopenharmony_ci          float operand;
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci          operand = source.c;
4255bd8deadSopenharmony_ci          if (abs) {
4265bd8deadSopenharmony_ci            operand = abs(operand);
4275bd8deadSopenharmony_ci          if (negate) {
4285bd8deadSopenharmony_ci            operand = -operand;
4295bd8deadSopenharmony_ci          }
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci          return operand;
4325bd8deadSopenharmony_ci      }
4335bd8deadSopenharmony_ci
4345bd8deadSopenharmony_ci    Rewrite Section 2.14.4.3,  Vertex Program Destination Register Update
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci    Most vertex program instructions write a 4-component result vector to
4375bd8deadSopenharmony_ci    a single temporary or vertex result register.  Writes to individual
4385bd8deadSopenharmony_ci    components of the destination register are controlled by individual
4395bd8deadSopenharmony_ci    component write masks specified as part of the instruction.
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    The component write mask is specified by the <optionalMask> rule
4425bd8deadSopenharmony_ci    found in the <maskedDstReg> rule.  If the optional mask is "",
4435bd8deadSopenharmony_ci    all components are enabled.  Otherwise, the optional mask names
4445bd8deadSopenharmony_ci    the individual components to enable.  The characters "x", "y",
4455bd8deadSopenharmony_ci    "z", and "w" match the x, y, z, and w components respectively.
4465bd8deadSopenharmony_ci    For example, an optional mask of ".xzw" indicates that the x, z,
4475bd8deadSopenharmony_ci    and w components should be enabled for writing but the y component
4485bd8deadSopenharmony_ci    should not.  The grammar requires that the destination register mask
4495bd8deadSopenharmony_ci    components must be listed in "xyzw" order.
4505bd8deadSopenharmony_ci
4515bd8deadSopenharmony_ci    The condition code write mask is specified by the <ccMask> rule found
4525bd8deadSopenharmony_ci    in the <instResultCC> and <instResultAddrCC> rules.  The condition
4535bd8deadSopenharmony_ci    code register is loaded and swizzled according to the swizzle
4545bd8deadSopenharmony_ci    codes specified by <swizzleSuffix>.  Each component of the swizzled
4555bd8deadSopenharmony_ci    condition code is tested according to the rule given by <ccMaskRule>.
4565bd8deadSopenharmony_ci    <ccMaskRule> may have the values "EQ", "NE", "LT", "GE", LE", or "GT",
4575bd8deadSopenharmony_ci    which mean to enable writes if the corresponding condition code field
4585bd8deadSopenharmony_ci    evaluates to equal, not equal, less than, greater than or equal, less
4595bd8deadSopenharmony_ci    than or equal, or greater than, respectively.  Comparisons involving
4605bd8deadSopenharmony_ci    condition codes of "UN" (unordered) evaluate to true for "NE" and
4615bd8deadSopenharmony_ci    false otherwise.  For example, if the condition code is (GT,LT,EQ,GT)
4625bd8deadSopenharmony_ci    and the condition code mask is "(NE.zyxw)", the swizzle operation
4635bd8deadSopenharmony_ci    will load (EQ,LT,GT,GT) and the mask will thus will enable writes on
4645bd8deadSopenharmony_ci    the y, z, and w components.  In addition, "TR" always enables writes
4655bd8deadSopenharmony_ci    and "FL" always disables writes, regardless of the condition code.
4665bd8deadSopenharmony_ci    If the condition code mask is empty, it is treated as "(TR)".
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci    Each component of the destination register is updated with the result
4695bd8deadSopenharmony_ci    of the vertex program instruction if and only if the component is
4705bd8deadSopenharmony_ci    enabled for writes by both the component write mask and the condition
4715bd8deadSopenharmony_ci    code write mask.  Otherwise, the component of the destination register
4725bd8deadSopenharmony_ci    remains unchanged.
4735bd8deadSopenharmony_ci
4745bd8deadSopenharmony_ci    A vertex program instruction can also optionally update the condition
4755bd8deadSopenharmony_ci    code register.  The condition code is updated if the condition
4765bd8deadSopenharmony_ci    code register update suffix "C" is present in the instruction.
4775bd8deadSopenharmony_ci    The instruction "ADDC" will update the condition code; the otherwise
4785bd8deadSopenharmony_ci    equivalent instruction "ADD" will not.  If condition code updates
4795bd8deadSopenharmony_ci    are enabled, each component of the destination register enabled
4805bd8deadSopenharmony_ci    for writes is compared to zero.  The corresponding component of
4815bd8deadSopenharmony_ci    the condition code is set to "LT", "EQ", or "GT", if the written
4825bd8deadSopenharmony_ci    component is less than, equal to, or greater than zero, respectively.
4835bd8deadSopenharmony_ci    Condition code components are set to "UN" if the written component is
4845bd8deadSopenharmony_ci    NaN (not a number).  Values of -0.0 and +0.0 both evaluate to "EQ".
4855bd8deadSopenharmony_ci    If a component of the destination register is not enabled for writes,
4865bd8deadSopenharmony_ci    the corresponding condition code component is also unchanged.
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ci    In the following example code,
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci        # R1=(-2, 0, 2, NaN)              R0                  CC
4915bd8deadSopenharmony_ci        MOVC R0, R1;               # ( -2,  0,   2, NaN) (LT,EQ,GT,UN)
4925bd8deadSopenharmony_ci        MOVC R0.xyz, R1.yzwx;      # (  0,  2, NaN, NaN) (EQ,GT,UN,UN)
4935bd8deadSopenharmony_ci        MOVC R0 (NE), R1.zywx;     # (  0,  0, NaN,  -2) (EQ,EQ,UN,LT)
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci    the first instruction writes (-2,0,2,NaN) to R0 and updates the
4965bd8deadSopenharmony_ci    condition code to (LT,EQ,GT,UN).  The second instruction, only the
4975bd8deadSopenharmony_ci    "x", "y", and "z" components of R0 and the condition code are updated,
4985bd8deadSopenharmony_ci    so R0 ends up with (0,2,NaN,NaN) and the condition code ends up with
4995bd8deadSopenharmony_ci    (EQ,GT,UN,UN).  In the third instruction, the condition code mask
5005bd8deadSopenharmony_ci    disables writes to the x component (its condition code field is "EQ"),
5015bd8deadSopenharmony_ci    so R0 ends up with (0,0,NaN,-2) and the condition code ends up with
5025bd8deadSopenharmony_ci    (EQ,EQ,UN,LT).
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci    The following pseudocode illustrates the process of writing a result
5055bd8deadSopenharmony_ci    vector to the destination register.  In the pseudocode, "instrmask"
5065bd8deadSopenharmony_ci    refers to the component write mask given by the <optWriteMask>
5075bd8deadSopenharmony_ci    rule.  "ccMaskRule" refers to the condition code mask rule given
5085bd8deadSopenharmony_ci    by <ccMask> and "updatecc" is TRUE if and only if condition code
5095bd8deadSopenharmony_ci    updates are enabled.  "result", "destination", and "cc" refer to
5105bd8deadSopenharmony_ci    the result vector, the register selected by <dstRegister> and the
5115bd8deadSopenharmony_ci    condition code, respectively.  Condition codes do not exist in the
5125bd8deadSopenharmony_ci    VP1 execution environment.
5135bd8deadSopenharmony_ci
5145bd8deadSopenharmony_ci      boolean TestCC(CondCode field) {
5155bd8deadSopenharmony_ci          switch (ccMaskRule) {
5165bd8deadSopenharmony_ci          case "EQ":  return (field == "EQ");
5175bd8deadSopenharmony_ci          case "NE":  return (field != "EQ");
5185bd8deadSopenharmony_ci          case "LT":  return (field == "LT");
5195bd8deadSopenharmony_ci          case "GE":  return (field == "GT" || field == "EQ");
5205bd8deadSopenharmony_ci          case "LE":  return (field == "LT" || field == "EQ");
5215bd8deadSopenharmony_ci          case "GT":  return (field == "GT");
5225bd8deadSopenharmony_ci          case "TR":  return TRUE;
5235bd8deadSopenharmony_ci          case "FL":  return FALSE;
5245bd8deadSopenharmony_ci          case "":    return TRUE;
5255bd8deadSopenharmony_ci          }
5265bd8deadSopenharmony_ci      }
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci      enum GenerateCC(float value) {
5295bd8deadSopenharmony_ci        if (value == NaN) {
5305bd8deadSopenharmony_ci          return UN;
5315bd8deadSopenharmony_ci        } else if (value < 0) {
5325bd8deadSopenharmony_ci          return LT;
5335bd8deadSopenharmony_ci        } else if (value == 0) {
5345bd8deadSopenharmony_ci          return EQ;
5355bd8deadSopenharmony_ci        } else {
5365bd8deadSopenharmony_ci          return GT;
5375bd8deadSopenharmony_ci        }
5385bd8deadSopenharmony_ci      }
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci      void UpdateDestination(floatVec destination, floatVec result)
5415bd8deadSopenharmony_ci      {
5425bd8deadSopenharmony_ci          floatVec merged;
5435bd8deadSopenharmony_ci          ccVec    mergedCC;
5445bd8deadSopenharmony_ci
5455bd8deadSopenharmony_ci          // Merge the converted result into the destination register, under
5465bd8deadSopenharmony_ci          // control of the compile- and run-time write masks.
5475bd8deadSopenharmony_ci          merged = destination;
5485bd8deadSopenharmony_ci          mergedCC = cc;
5495bd8deadSopenharmony_ci          if (instrMask.x && TestCC(cc.c***)) {
5505bd8deadSopenharmony_ci              merged.x = result.x;
5515bd8deadSopenharmony_ci              if (updatecc) mergedCC.x = GenerateCC(result.x);
5525bd8deadSopenharmony_ci          }
5535bd8deadSopenharmony_ci          if (instrMask.y && TestCC(cc.*c**)) {
5545bd8deadSopenharmony_ci              merged.y = result.y;
5555bd8deadSopenharmony_ci              if (updatecc) mergedCC.y = GenerateCC(result.y);
5565bd8deadSopenharmony_ci          }
5575bd8deadSopenharmony_ci          if (instrMask.z && TestCC(cc.**c*)) {
5585bd8deadSopenharmony_ci              merged.z = result.z;
5595bd8deadSopenharmony_ci              if (updatecc) mergedCC.z = GenerateCC(result.z);
5605bd8deadSopenharmony_ci          }
5615bd8deadSopenharmony_ci          if (instrMask.w && TestCC(cc.***c)) {
5625bd8deadSopenharmony_ci              merged.w = result.w;
5635bd8deadSopenharmony_ci              if (updatecc) mergedCC.w = GenerateCC(result.w);
5645bd8deadSopenharmony_ci          }
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ci          // Write out the new destination register and condition code.
5675bd8deadSopenharmony_ci          destination = merged;
5685bd8deadSopenharmony_ci          cc = mergedCC;
5695bd8deadSopenharmony_ci      }
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci    While this rule describes floating-point results, the same logic
5725bd8deadSopenharmony_ci    applies to the integer results generated by the ARA, ARL, and ARR
5735bd8deadSopenharmony_ci    instructions.
5745bd8deadSopenharmony_ci
5755bd8deadSopenharmony_ci    Add Section 2.14.4.X, Vertex Program Branching (before Section
5765bd8deadSopenharmony_ci    2.14.4.4, Vertex Program Result Processing)
5775bd8deadSopenharmony_ci
5785bd8deadSopenharmony_ci    Vertex programs can contain one or more instruction labels, matching
5795bd8deadSopenharmony_ci    the grammar rule <branchLabel>.  An instruction label can be referred
5805bd8deadSopenharmony_ci    to explicitly in branch (BRA) or subroutine call (CAL) instructions.
5815bd8deadSopenharmony_ci    Instruction labels can be defined or used at any point in the body
5825bd8deadSopenharmony_ci    of a program, and can be used in instructions before being defined
5835bd8deadSopenharmony_ci    in the program string.
5845bd8deadSopenharmony_ci
5855bd8deadSopenharmony_ci    Branching instructions can be conditional.  The branch condition
5865bd8deadSopenharmony_ci    is specified by the <optBranchCond> grammar rule and may depend on
5875bd8deadSopenharmony_ci    the contents of the condition code register.  Branch conditions are
5885bd8deadSopenharmony_ci    evaluated by evaluating a condition code write mask in exactly the
5895bd8deadSopenharmony_ci    same manner as done for register writes (section 2.14.2.2).  If any
5905bd8deadSopenharmony_ci    of the four components of the condition code write mask are enabled,
5915bd8deadSopenharmony_ci    the branch is taken and execution continues with the instruction
5925bd8deadSopenharmony_ci    following the label specified in the instruction.  Otherwise, the
5935bd8deadSopenharmony_ci    instruction is ignored and vertex program execution continues with
5945bd8deadSopenharmony_ci    the next instruction.  In the following example code,
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ci        MOVC CC, c[0];         # c[0]=(-2, 0, 2, NaN), CC gets (LT,EQ,GT,UN)
5975bd8deadSopenharmony_ci        BRA label1 (LT.xyzw);
5985bd8deadSopenharmony_ci        MOV R0,R1;             # not executed
5995bd8deadSopenharmony_ci      label1:
6005bd8deadSopenharmony_ci        BRA label2 (LT.wyzw);
6015bd8deadSopenharmony_ci        MOV R0,R2;             # executed
6025bd8deadSopenharmony_ci      label2:
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci    the first BRA instruction loads a condition code of (LT,EQ,GT,UN)
6055bd8deadSopenharmony_ci    while the second BRA instruction loads a condition code of
6065bd8deadSopenharmony_ci    (UN,EQ,GT,UN).  The first branch will be taken because the "x"
6075bd8deadSopenharmony_ci    component evaluates to LT; the second branch will not be taken
6085bd8deadSopenharmony_ci    because no component evaluates to LT.
6095bd8deadSopenharmony_ci
6105bd8deadSopenharmony_ci    Vertex programs can specify subroutine calls.  When a subroutine
6115bd8deadSopenharmony_ci    call (CAL) instruction is executed, a reference to the instruction
6125bd8deadSopenharmony_ci    immediately following the CAL instruction is pushed onto the
6135bd8deadSopenharmony_ci    call stack.  When a subroutine return (RET) instruction is
6145bd8deadSopenharmony_ci    executed, an instruction reference is popped off the call stack
6155bd8deadSopenharmony_ci    and program execution continues with the popped instruction.
6165bd8deadSopenharmony_ci    A vertex program will terminate if a CAL instruction is executed
6175bd8deadSopenharmony_ci    with MAX_PROGRAM_CALL_DEPTH_NV entries already in the call stack or
6185bd8deadSopenharmony_ci    if a RET instruction is executed with an empty call stack.
6195bd8deadSopenharmony_ci
6205bd8deadSopenharmony_ci    If a vertex program has an instruction label "main", program
6215bd8deadSopenharmony_ci    execution begins with the instruction immediately following the
6225bd8deadSopenharmony_ci    instruction label.  Otherwise, program execution begins with the
6235bd8deadSopenharmony_ci    first instruction of the program.  Instructions will be executed
6245bd8deadSopenharmony_ci    sequentially in the order specified in the program, although
6255bd8deadSopenharmony_ci    branch instructions will affect the instruction execution order,
6265bd8deadSopenharmony_ci    as described above.  A vertex program will terminate after executing
6275bd8deadSopenharmony_ci    a RET instruction with an empty call stack.  A vertex program will
6285bd8deadSopenharmony_ci    also terminate after executing the last instruction in the program,
6295bd8deadSopenharmony_ci    unless that instruction was a taken branch.
6305bd8deadSopenharmony_ci
6315bd8deadSopenharmony_ci    A vertex program will fail to load if an instruction refers to a
6325bd8deadSopenharmony_ci    label that is not defined in the program string.
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ci    A vertex program will terminate abnormally if a subroutine call
6355bd8deadSopenharmony_ci    instruction produces a call stack overflow.  Additionally,
6365bd8deadSopenharmony_ci    a vertex program will terminate abnormally after executing
6375bd8deadSopenharmony_ci    MAX_PROGRAM_EXEC_INSTRUCTIONS instructions to prevent hangs caused
6385bd8deadSopenharmony_ci    by infinite loops in the program.
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ci    When a vertex program terminates, normally or abnormally, it will
6415bd8deadSopenharmony_ci    emit a vertex whose attributes are taken from the final values of
6425bd8deadSopenharmony_ci    the vertex result registers (section 2.14.1.5).
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ci    Modify Section 2.14.4.4,  Vertex Program Result Processing
6455bd8deadSopenharmony_ci
6465bd8deadSopenharmony_ci    (modify 3rd paragraph) Transformed vertices are then assembled into
6475bd8deadSopenharmony_ci    primitives and clipped as described in section 2.11.  Clip distance
6485bd8deadSopenharmony_ci    results are used to control user clip planes.
6495bd8deadSopenharmony_ci    
6505bd8deadSopenharmony_ci    Add to Section 2.14.4.5, Vertex Program Options:
6515bd8deadSopenharmony_ci
6525bd8deadSopenharmony_ci    Section 2.14.4.5.2, NV_vertex_program2 Option
6535bd8deadSopenharmony_ci
6545bd8deadSopenharmony_ci    If a vertex program specifies the "NV_vertex_program2" program option,
6555bd8deadSopenharmony_ci    the grammar will be extended to support the features found in the
6565bd8deadSopenharmony_ci    NV_vertex_program2 extension not present in the ARB_vertex_program
6575bd8deadSopenharmony_ci    extension, including:
6585bd8deadSopenharmony_ci
6595bd8deadSopenharmony_ci      * the availability of the following instructions:  
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci          - ARA (address register add, useful for looping), 
6625bd8deadSopenharmony_ci          - ARR (address register load with round), 
6635bd8deadSopenharmony_ci          - BRA (branch), 
6645bd8deadSopenharmony_ci          - CAL (subroutine call), 
6655bd8deadSopenharmony_ci          - COS (cosine), 
6665bd8deadSopenharmony_ci          - RET (subroutine return), 
6675bd8deadSopenharmony_ci          - SEQ (set on equal), 
6685bd8deadSopenharmony_ci          - SFL (set on false), 
6695bd8deadSopenharmony_ci          - SGT (set on greater than), 
6705bd8deadSopenharmony_ci          - SIN (sine), 
6715bd8deadSopenharmony_ci          - SLE (set on less than or equal), 
6725bd8deadSopenharmony_ci          - SNE (set on not equal), 
6735bd8deadSopenharmony_ci          - SSG (set sign), and
6745bd8deadSopenharmony_ci          - STR (set on true).
6755bd8deadSopenharmony_ci
6765bd8deadSopenharmony_ci      * up to MAX_CALL_DEPTH_NV levels of subroutine calls/returns,
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci      * a four-component condition code register to hold the sign of
6795bd8deadSopenharmony_ci        result vector components (useful for comparisons),
6805bd8deadSopenharmony_ci
6815bd8deadSopenharmony_ci      * a condition code update opcode suffix "C", where the results of
6825bd8deadSopenharmony_ci        the instruction are used to update the condition code register,
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci      * a condition code write mask operator, where the condition code
6855bd8deadSopenharmony_ci        register is swizzled and tested, and the test results are used
6865bd8deadSopenharmony_ci        to mask register writes,
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ci      * six clip distance result bindings that can be used to perform
6895bd8deadSopenharmony_ci        more complicated user clipping operations than those provided
6905bd8deadSopenharmony_ci        with the position invariant program option,
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ci      * four-component address registers (instead of one-component
6935bd8deadSopenharmony_ci        registers in ARB_vertex_program), with the "ARL" instruction
6945bd8deadSopenharmony_ci        extended to produce a vector result,
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci      * an absolute value operator on scalar and swizzled operands.
6975bd8deadSopenharmony_ci
6985bd8deadSopenharmony_ci    The added functionality is identical to that provided by
6995bd8deadSopenharmony_ci    NV_vertex_program2 extension specification.
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci    Modify Section 2.14.5.3,  ARL:  Address Register Load
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci    The ARL instruction loads a single vector operand and performs a
7045bd8deadSopenharmony_ci    component-wise floor operation to generate a signed integer result
7055bd8deadSopenharmony_ci    vector.
7065bd8deadSopenharmony_ci
7075bd8deadSopenharmony_ci      tmp = VectorLoad(op0);
7085bd8deadSopenharmony_ci      iresult.x = floor(tmp.x);
7095bd8deadSopenharmony_ci      iresult.y = floor(tmp.y);
7105bd8deadSopenharmony_ci      iresult.z = floor(tmp.z);
7115bd8deadSopenharmony_ci      iresult.w = floor(tmp.w);
7125bd8deadSopenharmony_ci
7135bd8deadSopenharmony_ci    The floor operation returns the largest integer less than or equal
7145bd8deadSopenharmony_ci    to the operand.  For example floor(-1.7) = -2.0, floor(+1.0) = +1.0,
7155bd8deadSopenharmony_ci    and floor(+3.7) = +3.0.
7165bd8deadSopenharmony_ci
7175bd8deadSopenharmony_ci    Note that in the unextended ARB_vertex_program specification, the ARL
7185bd8deadSopenharmony_ci    instruction loads a scalar operand and generates a scalar result.  
7195bd8deadSopenharmony_ci
7205bd8deadSopenharmony_ci    Add to Section 2.14.5,  Vertex Program Instruction Set
7215bd8deadSopenharmony_ci
7225bd8deadSopenharmony_ci    Section 2.14.5.28,  ARA:  Address Register Add
7235bd8deadSopenharmony_ci
7245bd8deadSopenharmony_ci    The ARA instruction adds two pairs of components of a vector address
7255bd8deadSopenharmony_ci    register operand to produce an integer result vector.  The "x" and "z"
7265bd8deadSopenharmony_ci    components of the result vector contain the sum of the "x" and "z"
7275bd8deadSopenharmony_ci    components of the operand; the "y" and "w" components of the result
7285bd8deadSopenharmony_ci    vector contain the sum of the "y" and "w" components of the operand.
7295bd8deadSopenharmony_ci
7305bd8deadSopenharmony_ci      itmp = AddrVectorLoad(op0);
7315bd8deadSopenharmony_ci      iresult.x = itmp.x + itmp.z;
7325bd8deadSopenharmony_ci      iresult.y = itmp.y + itmp.w;
7335bd8deadSopenharmony_ci      iresult.z = itmp.x + itmp.z;
7345bd8deadSopenharmony_ci      iresult.w = itmp.y + itmp.w;
7355bd8deadSopenharmony_ci
7365bd8deadSopenharmony_ci    Component swizzling is not supported when the operand is loaded.
7375bd8deadSopenharmony_ci
7385bd8deadSopenharmony_ci    Section 2.14.5.29,  ARR:  Address Register Load (with round)
7395bd8deadSopenharmony_ci
7405bd8deadSopenharmony_ci    The ARR instruction loads a single vector operand and performs a
7415bd8deadSopenharmony_ci    component-wise round operation to generate a signed integer result
7425bd8deadSopenharmony_ci    vector.
7435bd8deadSopenharmony_ci
7445bd8deadSopenharmony_ci      tmp = VectorLoad(op0);
7455bd8deadSopenharmony_ci      iresult.x = round(tmp.x);
7465bd8deadSopenharmony_ci      iresult.y = round(tmp.y);
7475bd8deadSopenharmony_ci      iresult.z = round(tmp.z);
7485bd8deadSopenharmony_ci      iresult.w = round(tmp.w);
7495bd8deadSopenharmony_ci
7505bd8deadSopenharmony_ci    The round operation returns the nearest integer to the operand.  If the
7515bd8deadSopenharmony_ci    fractional portion of the operand is 0.5, round() selects the nearest even
7525bd8deadSopenharmony_ci    integer.  For example round(-1.7) = -2.0, round(+1.0) = +1.0, and
7535bd8deadSopenharmony_ci    round(+3.7) = +4.0.
7545bd8deadSopenharmony_ci
7555bd8deadSopenharmony_ci    Section 2.14.5.30,  BRA:  Branch
7565bd8deadSopenharmony_ci
7575bd8deadSopenharmony_ci    The BRA instruction conditionally transfers control to the instruction
7585bd8deadSopenharmony_ci    following the label specified in the instruction.  The following
7595bd8deadSopenharmony_ci    pseudocode describes the operation of the instruction:
7605bd8deadSopenharmony_ci
7615bd8deadSopenharmony_ci      if (TestCC(cc.c***) || TestCC(cc.*c**) || 
7625bd8deadSopenharmony_ci          TestCC(cc.**c*) || TestCC(cc.***c)) {
7635bd8deadSopenharmony_ci        // continue execution at instruction following <branchLabel>
7645bd8deadSopenharmony_ci      } else {
7655bd8deadSopenharmony_ci        // do nothing
7665bd8deadSopenharmony_ci      }
7675bd8deadSopenharmony_ci
7685bd8deadSopenharmony_ci    In the pseudocode, <branchLabel> is the label specified in the
7695bd8deadSopenharmony_ci    instruction according to the <branchLabel> grammar rule.
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci    Section 2.14.5.31,  CAL:  Subroutine Call
7725bd8deadSopenharmony_ci
7735bd8deadSopenharmony_ci    The CAL instruction conditionally transfers control to the instruction
7745bd8deadSopenharmony_ci    following the label specified in the instruction.  It also pushes a
7755bd8deadSopenharmony_ci    reference to the instruction immediately following the CAL instruction
7765bd8deadSopenharmony_ci    onto the call stack, where execution will continue after executing
7775bd8deadSopenharmony_ci    the matching RET instruction.  The following pseudocode describes
7785bd8deadSopenharmony_ci    the operation of the instruction:
7795bd8deadSopenharmony_ci
7805bd8deadSopenharmony_ci      if (TestCC(cc.c***) || TestCC(cc.*c**) || 
7815bd8deadSopenharmony_ci          TestCC(cc.**c*) || TestCC(cc.***c)) {
7825bd8deadSopenharmony_ci        if (callStackDepth >= MAX_PROGRAM_CALL_DEPTH_NV) {
7835bd8deadSopenharmony_ci          // terminate vertex program
7845bd8deadSopenharmony_ci        } else {
7855bd8deadSopenharmony_ci          callStack[callStackDepth] = nextInstruction;
7865bd8deadSopenharmony_ci          callStackDepth++;
7875bd8deadSopenharmony_ci        }
7885bd8deadSopenharmony_ci        // continue execution at instruction following <branchLabel>
7895bd8deadSopenharmony_ci      } else {
7905bd8deadSopenharmony_ci        // do nothing
7915bd8deadSopenharmony_ci      }
7925bd8deadSopenharmony_ci
7935bd8deadSopenharmony_ci    In the pseudocode, <branchLabel> is the label specified in the
7945bd8deadSopenharmony_ci    instruction matching the <branchLabel> grammar rule, <callStackDepth>
7955bd8deadSopenharmony_ci    is the current depth of the call stack, <callStack> is an array
7965bd8deadSopenharmony_ci    holding the call stack, and <nextInstruction> is a reference to the
7975bd8deadSopenharmony_ci    instruction immediately following the present one in the program
7985bd8deadSopenharmony_ci    string.
7995bd8deadSopenharmony_ci
8005bd8deadSopenharmony_ci    If the call stack overflows, the vertex program terminates abnormally and
8015bd8deadSopenharmony_ci    all vertex program results are undefined.
8025bd8deadSopenharmony_ci
8035bd8deadSopenharmony_ci    Section 2.14.5.32,  COS:  Cosine
8045bd8deadSopenharmony_ci
8055bd8deadSopenharmony_ci    The COS instruction approximates the cosine of the angle specified
8065bd8deadSopenharmony_ci    by the scalar operand and replicates the approximation to all four
8075bd8deadSopenharmony_ci    components of the result vector.  The angle is specified in radians
8085bd8deadSopenharmony_ci    and does not have to be in the range [0,2*PI].
8095bd8deadSopenharmony_ci
8105bd8deadSopenharmony_ci      tmp = ScalarLoad(op0);
8115bd8deadSopenharmony_ci      result.x = ApproxCosine(tmp);
8125bd8deadSopenharmony_ci      result.y = ApproxCosine(tmp);
8135bd8deadSopenharmony_ci      result.z = ApproxCosine(tmp);
8145bd8deadSopenharmony_ci      result.w = ApproxCosine(tmp);
8155bd8deadSopenharmony_ci
8165bd8deadSopenharmony_ci    Section 2.14.5.33,  RCC:  Reciprocal (Clamped)
8175bd8deadSopenharmony_ci
8185bd8deadSopenharmony_ci    The RCC instruction approximates the reciprocal of the scalar operand,
8195bd8deadSopenharmony_ci    clamps the result to one of two ranges, and replicates the clamped
8205bd8deadSopenharmony_ci    result to all four components of the result vector.
8215bd8deadSopenharmony_ci
8225bd8deadSopenharmony_ci    If the approximated reciprocal is greater than 0.0, the result is
8235bd8deadSopenharmony_ci    clamped to the range [2^-64, 2^+64].  If the approximate reciprocal
8245bd8deadSopenharmony_ci    is not greater than zero, the result is clamped to the range [-2^+64,
8255bd8deadSopenharmony_ci    -2^-64].
8265bd8deadSopenharmony_ci
8275bd8deadSopenharmony_ci      tmp = ScalarLoad(op0);
8285bd8deadSopenharmony_ci      result.x = ClampApproxReciprocal(tmp);
8295bd8deadSopenharmony_ci      result.y = ClampApproxReciprocal(tmp);
8305bd8deadSopenharmony_ci      result.z = ClampApproxReciprocal(tmp);
8315bd8deadSopenharmony_ci      result.w = ClampApproxReciprocal(tmp);
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci    The following rule applies to reciprocation:
8345bd8deadSopenharmony_ci
8355bd8deadSopenharmony_ci      1. ApproxReciprocal(+1.0) = +1.0.
8365bd8deadSopenharmony_ci
8375bd8deadSopenharmony_ci    Section 2.14.5.34,  RET:  Subroutine Call Return
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci    The RET instruction conditionally returns from a subroutine initiated
8405bd8deadSopenharmony_ci    by a CAL instruction by popping an instruction reference off the
8415bd8deadSopenharmony_ci    top of the call stack and transferring control to the referenced
8425bd8deadSopenharmony_ci    instruction.  The following pseudocode describes the operation of
8435bd8deadSopenharmony_ci    the instruction:
8445bd8deadSopenharmony_ci
8455bd8deadSopenharmony_ci      if (TestCC(cc.c***) || TestCC(cc.*c**) || 
8465bd8deadSopenharmony_ci          TestCC(cc.**c*) || TestCC(cc.***c)) {
8475bd8deadSopenharmony_ci        if (callStackDepth <= 0) {
8485bd8deadSopenharmony_ci          // terminate vertex program
8495bd8deadSopenharmony_ci        } else {
8505bd8deadSopenharmony_ci          callStackDepth--;
8515bd8deadSopenharmony_ci          instruction = callStack[callStackDepth];
8525bd8deadSopenharmony_ci        }
8535bd8deadSopenharmony_ci
8545bd8deadSopenharmony_ci        // continue execution at <instruction>
8555bd8deadSopenharmony_ci      } else {
8565bd8deadSopenharmony_ci        // do nothing
8575bd8deadSopenharmony_ci      }
8585bd8deadSopenharmony_ci
8595bd8deadSopenharmony_ci    In the pseudocode, <callStackDepth> is the depth of the call stack,
8605bd8deadSopenharmony_ci    <callStack> is an array holding the call stack, and <instruction> is
8615bd8deadSopenharmony_ci    a reference to an instruction previously pushed onto the call stack.
8625bd8deadSopenharmony_ci
8635bd8deadSopenharmony_ci    If the call stack is empty when RET executes, the vertex program
8645bd8deadSopenharmony_ci    terminates normally.
8655bd8deadSopenharmony_ci
8665bd8deadSopenharmony_ci    Section 2.14.5.35,  SEQ:  Set on Equal
8675bd8deadSopenharmony_ci
8685bd8deadSopenharmony_ci    The SEQ instruction performs a component-wise comparison of the
8695bd8deadSopenharmony_ci    two operands.  Each component of the result vector is 1.0 if the
8705bd8deadSopenharmony_ci    corresponding component of the first operand is equal to that of
8715bd8deadSopenharmony_ci    the second, and 0.0 otherwise.
8725bd8deadSopenharmony_ci
8735bd8deadSopenharmony_ci      tmp0 = VectorLoad(op0);
8745bd8deadSopenharmony_ci      tmp1 = VectorLoad(op1);
8755bd8deadSopenharmony_ci      result.x = (tmp0.x == tmp1.x) ? 1.0 : 0.0;
8765bd8deadSopenharmony_ci      result.y = (tmp0.y == tmp1.y) ? 1.0 : 0.0;
8775bd8deadSopenharmony_ci      result.z = (tmp0.z == tmp1.z) ? 1.0 : 0.0;
8785bd8deadSopenharmony_ci      result.w = (tmp0.w == tmp1.w) ? 1.0 : 0.0;
8795bd8deadSopenharmony_ci
8805bd8deadSopenharmony_ci    Section 2.14.5.36,  SFL:  Set on False
8815bd8deadSopenharmony_ci
8825bd8deadSopenharmony_ci    The SFL instruction is a degenerate case of the other "Set on"
8835bd8deadSopenharmony_ci    instructions that sets all components of the result vector to 0.0.
8845bd8deadSopenharmony_ci
8855bd8deadSopenharmony_ci      result.x = 0.0;
8865bd8deadSopenharmony_ci      result.y = 0.0;
8875bd8deadSopenharmony_ci      result.z = 0.0;
8885bd8deadSopenharmony_ci      result.w = 0.0;
8895bd8deadSopenharmony_ci
8905bd8deadSopenharmony_ci    Section 2.14.5.37,  SGT:  Set on Greater Than
8915bd8deadSopenharmony_ci
8925bd8deadSopenharmony_ci    The SGT instruction performs a component-wise comparison of the
8935bd8deadSopenharmony_ci    two operands.  Each component of the result vector is 1.0 if the
8945bd8deadSopenharmony_ci    corresponding component of the first operands is greater than that
8955bd8deadSopenharmony_ci    of the second, and 0.0 otherwise.
8965bd8deadSopenharmony_ci
8975bd8deadSopenharmony_ci      tmp0 = VectorLoad(op0);
8985bd8deadSopenharmony_ci      tmp1 = VectorLoad(op1);
8995bd8deadSopenharmony_ci      result.x = (tmp0.x > tmp1.x) ? 1.0 : 0.0;
9005bd8deadSopenharmony_ci      result.y = (tmp0.y > tmp1.y) ? 1.0 : 0.0;
9015bd8deadSopenharmony_ci      result.z = (tmp0.z > tmp1.z) ? 1.0 : 0.0;
9025bd8deadSopenharmony_ci      result.w = (tmp0.w > tmp1.w) ? 1.0 : 0.0;
9035bd8deadSopenharmony_ci
9045bd8deadSopenharmony_ci    Section 2.14.5.38,  SIN:  Sine
9055bd8deadSopenharmony_ci
9065bd8deadSopenharmony_ci    The SIN instruction approximates the sine of the angle specified by
9075bd8deadSopenharmony_ci    the scalar operand and replicates it to all four components of the
9085bd8deadSopenharmony_ci    result vector.  The angle is specified in radians and does not have
9095bd8deadSopenharmony_ci    to be in the range [0,2*PI].
9105bd8deadSopenharmony_ci
9115bd8deadSopenharmony_ci      tmp = ScalarLoad(op0);
9125bd8deadSopenharmony_ci      result.x = ApproxSine(tmp);
9135bd8deadSopenharmony_ci      result.y = ApproxSine(tmp);
9145bd8deadSopenharmony_ci      result.z = ApproxSine(tmp);
9155bd8deadSopenharmony_ci      result.w = ApproxSine(tmp);
9165bd8deadSopenharmony_ci
9175bd8deadSopenharmony_ci    Section 2.14.5.39,  SLE:  Set on Less Than or Equal
9185bd8deadSopenharmony_ci
9195bd8deadSopenharmony_ci    The SLE instruction performs a component-wise comparison of the
9205bd8deadSopenharmony_ci    two operands.  Each component of the result vector is 1.0 if the
9215bd8deadSopenharmony_ci    corresponding component of the first operand is less than or equal
9225bd8deadSopenharmony_ci    to that of the second, and 0.0 otherwise.
9235bd8deadSopenharmony_ci
9245bd8deadSopenharmony_ci      tmp0 = VectorLoad(op0);
9255bd8deadSopenharmony_ci      tmp1 = VectorLoad(op1);
9265bd8deadSopenharmony_ci      result.x = (tmp0.x <= tmp1.x) ? 1.0 : 0.0;
9275bd8deadSopenharmony_ci      result.y = (tmp0.y <= tmp1.y) ? 1.0 : 0.0;
9285bd8deadSopenharmony_ci      result.z = (tmp0.z <= tmp1.z) ? 1.0 : 0.0;
9295bd8deadSopenharmony_ci      result.w = (tmp0.w <= tmp1.w) ? 1.0 : 0.0;
9305bd8deadSopenharmony_ci
9315bd8deadSopenharmony_ci    Section 2.14.5.40,  SNE:  Set on Not Equal
9325bd8deadSopenharmony_ci
9335bd8deadSopenharmony_ci    The SNE instruction performs a component-wise comparison of the
9345bd8deadSopenharmony_ci    two operands.  Each component of the result vector is 1.0 if the
9355bd8deadSopenharmony_ci    corresponding component of the first operand is not equal to that
9365bd8deadSopenharmony_ci    of the second, and 0.0 otherwise.
9375bd8deadSopenharmony_ci
9385bd8deadSopenharmony_ci      tmp0 = VectorLoad(op0);
9395bd8deadSopenharmony_ci      tmp1 = VectorLoad(op1);
9405bd8deadSopenharmony_ci      result.x = (tmp0.x != tmp1.x) ? 1.0 : 0.0;
9415bd8deadSopenharmony_ci      result.y = (tmp0.y != tmp1.y) ? 1.0 : 0.0;
9425bd8deadSopenharmony_ci      result.z = (tmp0.z != tmp1.z) ? 1.0 : 0.0;
9435bd8deadSopenharmony_ci      result.w = (tmp0.w != tmp1.w) ? 1.0 : 0.0;
9445bd8deadSopenharmony_ci
9455bd8deadSopenharmony_ci    Section 2.14.5.41,  SSG:  Set Sign
9465bd8deadSopenharmony_ci
9475bd8deadSopenharmony_ci    The SSG instruction generates a result vector containing the signs of
9485bd8deadSopenharmony_ci    each component of the single vector operand.  Each component of the
9495bd8deadSopenharmony_ci    result vector is 1.0 if the corresponding component of the operand
9505bd8deadSopenharmony_ci    is greater than zero, 0.0 if the corresponding component of the
9515bd8deadSopenharmony_ci    operand is equal to zero, and -1.0 if the corresponding component
9525bd8deadSopenharmony_ci    of the operand is less than zero.
9535bd8deadSopenharmony_ci
9545bd8deadSopenharmony_ci      tmp = VectorLoad(op0);
9555bd8deadSopenharmony_ci      result.x = SetSign(tmp.x);
9565bd8deadSopenharmony_ci      result.y = SetSign(tmp.y);
9575bd8deadSopenharmony_ci      result.z = SetSign(tmp.z);
9585bd8deadSopenharmony_ci      result.w = SetSign(tmp.w);
9595bd8deadSopenharmony_ci
9605bd8deadSopenharmony_ci    Section 2.14.5.42,  STR:  Set on True
9615bd8deadSopenharmony_ci
9625bd8deadSopenharmony_ci    The STR instruction is a degenerate case of the other "Set on"
9635bd8deadSopenharmony_ci    instructions that sets all components of the result vector to 1.0.
9645bd8deadSopenharmony_ci
9655bd8deadSopenharmony_ci      result.x = 1.0;
9665bd8deadSopenharmony_ci      result.y = 1.0;
9675bd8deadSopenharmony_ci      result.z = 1.0;
9685bd8deadSopenharmony_ci      result.w = 1.0;
9695bd8deadSopenharmony_ci
9705bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization)
9715bd8deadSopenharmony_ci
9725bd8deadSopenharmony_ci    None.
9735bd8deadSopenharmony_ci
9745bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment
9755bd8deadSopenharmony_ciOperations and the Frame Buffer)
9765bd8deadSopenharmony_ci
9775bd8deadSopenharmony_ci    None.
9785bd8deadSopenharmony_ci
9795bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions)
9805bd8deadSopenharmony_ci
9815bd8deadSopenharmony_ci    None.
9825bd8deadSopenharmony_ci
9835bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.4 Specification (State and State
9845bd8deadSopenharmony_ciRequests)
9855bd8deadSopenharmony_ci
9865bd8deadSopenharmony_ci    None.
9875bd8deadSopenharmony_ci
9885bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.4 Specification (Invariance)
9895bd8deadSopenharmony_ci
9905bd8deadSopenharmony_ci    None.
9915bd8deadSopenharmony_ci
9925bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
9935bd8deadSopenharmony_ci
9945bd8deadSopenharmony_ci    None.
9955bd8deadSopenharmony_ci
9965bd8deadSopenharmony_ciDependencies on ARB_vertex_program
9975bd8deadSopenharmony_ci
9985bd8deadSopenharmony_ci    This specification is based on a modified version of the grammar
9995bd8deadSopenharmony_ci    published in the ARB_vertex_program specification.  This modified
10005bd8deadSopenharmony_ci    grammar (see below) includes a few structural changes to better
10015bd8deadSopenharmony_ci    accommodate new functionality from this and other extensions, but
10025bd8deadSopenharmony_ci    should be functionally equivalent to the ARB_vertex_program grammar.
10035bd8deadSopenharmony_ci
10045bd8deadSopenharmony_ci    <program>               ::= <optionSequence> <statementSequence> "END"
10055bd8deadSopenharmony_ci
10065bd8deadSopenharmony_ci    <optionSequence>        ::= <optionSequence> <option>
10075bd8deadSopenharmony_ci                              | /* empty */
10085bd8deadSopenharmony_ci
10095bd8deadSopenharmony_ci    <option>                ::= "OPTION" <optionName> ";"
10105bd8deadSopenharmony_ci
10115bd8deadSopenharmony_ci    <optionName>            ::= "ARB_position_invariant"
10125bd8deadSopenharmony_ci
10135bd8deadSopenharmony_ci    <statementSequence>     ::= <statement> <statementSequence>
10145bd8deadSopenharmony_ci                              | /* empty */
10155bd8deadSopenharmony_ci
10165bd8deadSopenharmony_ci    <statement>             ::= <instruction> ";"
10175bd8deadSopenharmony_ci                              | <namingStatement> ";"
10185bd8deadSopenharmony_ci
10195bd8deadSopenharmony_ci    <instruction>           ::= <ALUInstruction>
10205bd8deadSopenharmony_ci
10215bd8deadSopenharmony_ci    <ALUInstruction>        ::= <VECTORop_instruction>
10225bd8deadSopenharmony_ci                              | <SCALARop_instruction>
10235bd8deadSopenharmony_ci                              | <BINSCop_instruction>
10245bd8deadSopenharmony_ci                              | <BINop_instruction>
10255bd8deadSopenharmony_ci                              | <TRIop_instruction>
10265bd8deadSopenharmony_ci                              | <SWZop_instruction>
10275bd8deadSopenharmony_ci                              | <ARLop_instruction>
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ci    <VECTORop_instruction>  ::= <VECTORop> <instResult> "," <instOperandV>
10305bd8deadSopenharmony_ci
10315bd8deadSopenharmony_ci    <VECTORop>              ::= "ABS"
10325bd8deadSopenharmony_ci                              | "FLR"
10335bd8deadSopenharmony_ci                              | "FRC"
10345bd8deadSopenharmony_ci                              | "LIT"
10355bd8deadSopenharmony_ci                              | "MOV"
10365bd8deadSopenharmony_ci
10375bd8deadSopenharmony_ci    <SCALARop_instruction>  ::= <SCALARop> <instResult> "," <instOperandS>
10385bd8deadSopenharmony_ci
10395bd8deadSopenharmony_ci    <SCALARop>              ::= "EX2"
10405bd8deadSopenharmony_ci                              | "EXP"
10415bd8deadSopenharmony_ci                              | "LG2"
10425bd8deadSopenharmony_ci                              | "LOG"
10435bd8deadSopenharmony_ci                              | "RCP"
10445bd8deadSopenharmony_ci                              | "RSQ"
10455bd8deadSopenharmony_ci
10465bd8deadSopenharmony_ci    <BINSCop_instruction>   ::= <BINSCop> <instResult> "," <instOperandS> "," 
10475bd8deadSopenharmony_ci                                <instOperandS>
10485bd8deadSopenharmony_ci
10495bd8deadSopenharmony_ci    <BINSCop>               ::= "POW"
10505bd8deadSopenharmony_ci
10515bd8deadSopenharmony_ci    <BINop_instruction>     ::= <BINop> <instResult> "," <instOperandV> "," 
10525bd8deadSopenharmony_ci                                <instOperandV>
10535bd8deadSopenharmony_ci
10545bd8deadSopenharmony_ci    <BINop>                 ::= "ADD"
10555bd8deadSopenharmony_ci                              | "DP3"
10565bd8deadSopenharmony_ci                              | "DP4"
10575bd8deadSopenharmony_ci                              | "DPH"
10585bd8deadSopenharmony_ci                              | "DST"
10595bd8deadSopenharmony_ci                              | "MAX"
10605bd8deadSopenharmony_ci                              | "MIN"
10615bd8deadSopenharmony_ci                              | "MUL"
10625bd8deadSopenharmony_ci                              | "SGE"
10635bd8deadSopenharmony_ci                              | "SLT"
10645bd8deadSopenharmony_ci                              | "SUB"
10655bd8deadSopenharmony_ci                              | "XPD"
10665bd8deadSopenharmony_ci
10675bd8deadSopenharmony_ci    <TRIop_instruction>     ::= <TRIop> <instResult> "," <instOperandV> "," 
10685bd8deadSopenharmony_ci                                <instOperandV> "," <instOperandV>
10695bd8deadSopenharmony_ci
10705bd8deadSopenharmony_ci    <TRIop>                 ::= "MAD"
10715bd8deadSopenharmony_ci
10725bd8deadSopenharmony_ci    <SWZop_instruction>     ::= <SWZop> <instResult> "," <instOperandVNS> "," 
10735bd8deadSopenharmony_ci                                <extendedSwizzle>
10745bd8deadSopenharmony_ci
10755bd8deadSopenharmony_ci    <SWZop>                 ::= "SWZ"
10765bd8deadSopenharmony_ci
10775bd8deadSopenharmony_ci    <ARLop_instruction>     ::= <ARLop> <instResultAddr> "," <ARLop_src>
10785bd8deadSopenharmony_ci
10795bd8deadSopenharmony_ci    <ARLop>                 ::= "ARL"
10805bd8deadSopenharmony_ci
10815bd8deadSopenharmony_ci    <ARLop_src>             ::= <instOperandS>
10825bd8deadSopenharmony_ci
10835bd8deadSopenharmony_ci    <instOperandV>          ::= <instOperandBaseV>
10845bd8deadSopenharmony_ci
10855bd8deadSopenharmony_ci    <instOperandBaseV>      ::= <optSign> <attribUseV>
10865bd8deadSopenharmony_ci                              | <optSign> <tempUseV>
10875bd8deadSopenharmony_ci                              | <optSign> <paramUseV>
10885bd8deadSopenharmony_ci
10895bd8deadSopenharmony_ci    <instOperandS>          ::= <instOperandBaseS>
10905bd8deadSopenharmony_ci
10915bd8deadSopenharmony_ci    <instOperandBaseS>      ::= <optSign> <attribUseS>
10925bd8deadSopenharmony_ci                              | <optSign> <tempUseS>
10935bd8deadSopenharmony_ci                              | <optSign> <paramUseS>
10945bd8deadSopenharmony_ci
10955bd8deadSopenharmony_ci    <instOperandVNS>        ::= <attribUseVNS>
10965bd8deadSopenharmony_ci                              | <tempUseVNS>
10975bd8deadSopenharmony_ci                              | <paramUseVNS>
10985bd8deadSopenharmony_ci
10995bd8deadSopenharmony_ci    <instResult>            ::= <instResultBase>
11005bd8deadSopenharmony_ci
11015bd8deadSopenharmony_ci    <instResultBase>        ::= <tempUseW>
11025bd8deadSopenharmony_ci                              | <resultUseW>
11035bd8deadSopenharmony_ci
11045bd8deadSopenharmony_ci    <instResultAddr>        ::= <instResultAddrBase>
11055bd8deadSopenharmony_ci
11065bd8deadSopenharmony_ci    <instResultAddrBase>    ::= <addrUseW>
11075bd8deadSopenharmony_ci
11085bd8deadSopenharmony_ci    <namingStatement>       ::= <ATTRIB_statement>
11095bd8deadSopenharmony_ci                              | <PARAM_statement>
11105bd8deadSopenharmony_ci                              | <TEMP_statement>
11115bd8deadSopenharmony_ci                              | <OUTPUT_statement>
11125bd8deadSopenharmony_ci                              | <ALIAS_statement>
11135bd8deadSopenharmony_ci                              | <ADDRESS_statement>
11145bd8deadSopenharmony_ci
11155bd8deadSopenharmony_ci    <ATTRIB_statement>      ::= "ATTRIB" <establishName> "=" <attribUseD>
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci    <PARAM_statement>       ::= <PARAM_singleStmt>
11185bd8deadSopenharmony_ci                              | <PARAM_multipleStmt>
11195bd8deadSopenharmony_ci
11205bd8deadSopenharmony_ci    <PARAM_singleStmt>      ::= "PARAM" <establishName> <paramSingleInit>
11215bd8deadSopenharmony_ci
11225bd8deadSopenharmony_ci    <PARAM_multipleStmt>    ::= "PARAM" <establishName> "[" <optArraySize> "]" 
11235bd8deadSopenharmony_ci                                <paramMultipleInit>
11245bd8deadSopenharmony_ci
11255bd8deadSopenharmony_ci    <optArraySize>          ::= /* empty */
11265bd8deadSopenharmony_ci                              | <integer> /* [1,MAX_PROGRAM_PARAMETERS_ARB]*/
11275bd8deadSopenharmony_ci
11285bd8deadSopenharmony_ci    <paramSingleInit>       ::= "=" <paramUseDB>
11295bd8deadSopenharmony_ci
11305bd8deadSopenharmony_ci    <paramMultipleInit>     ::= "=" "{" <paramMultInitList> "}"
11315bd8deadSopenharmony_ci
11325bd8deadSopenharmony_ci    <paramMultInitList>     ::= <paramUseDM>
11335bd8deadSopenharmony_ci                              | <paramUseDM> "," <paramMultInitList>
11345bd8deadSopenharmony_ci
11355bd8deadSopenharmony_ci    <TEMP_statement>        ::= "TEMP" <varNameList>
11365bd8deadSopenharmony_ci
11375bd8deadSopenharmony_ci    <OUTPUT_statement>      ::= "OUTPUT" <establishName> "=" <resultUseD>
11385bd8deadSopenharmony_ci
11395bd8deadSopenharmony_ci    <ALIAS_statement>       ::= "ALIAS" <establishName> "=" <establishedName>
11405bd8deadSopenharmony_ci
11415bd8deadSopenharmony_ci    <establishedName>       ::= <tempVarName>
11425bd8deadSopenharmony_ci                              | <addrVarName>
11435bd8deadSopenharmony_ci                              | <attribVarName>
11445bd8deadSopenharmony_ci                              | <paramArrayVarName>
11455bd8deadSopenharmony_ci                              | <paramSingleVarName>
11465bd8deadSopenharmony_ci                              | <resultVarName>
11475bd8deadSopenharmony_ci
11485bd8deadSopenharmony_ci    <ADDRESS_statement>     ::= "ADDRESS" <varNameList>
11495bd8deadSopenharmony_ci
11505bd8deadSopenharmony_ci    <varNameList>           ::= <establishName>
11515bd8deadSopenharmony_ci                              | <establishName> "," <varNameList>
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ci    <establishName>         ::= <identifier>
11545bd8deadSopenharmony_ci
11555bd8deadSopenharmony_ci    <attribUseV>            ::= <attribBasic> <swizzleSuffix>
11565bd8deadSopenharmony_ci                              | <attribVarName> <swizzleSuffix>
11575bd8deadSopenharmony_ci                              | <attribColor> <swizzleSuffix>
11585bd8deadSopenharmony_ci                              | <attribColor> "." <colorType> <swizzleSuffix>
11595bd8deadSopenharmony_ci
11605bd8deadSopenharmony_ci    <attribUseS>            ::= <attribBasic> <scalarSuffix>
11615bd8deadSopenharmony_ci                              | <attribVarName> <scalarSuffix>
11625bd8deadSopenharmony_ci                              | <attribColor> <scalarSuffix>
11635bd8deadSopenharmony_ci                              | <attribColor> "." <colorType> <scalarSuffix>
11645bd8deadSopenharmony_ci
11655bd8deadSopenharmony_ci    <attribUseVNS>          ::= <attribBasic>
11665bd8deadSopenharmony_ci                              | <attribVarName>
11675bd8deadSopenharmony_ci                              | <attribColor>
11685bd8deadSopenharmony_ci                              | <attribColor> "." <colorType>
11695bd8deadSopenharmony_ci
11705bd8deadSopenharmony_ci    <attribUseD>            ::= <attribBasic>
11715bd8deadSopenharmony_ci                              | <attribColor>
11725bd8deadSopenharmony_ci                              | <attribColor> "." <colorType>
11735bd8deadSopenharmony_ci
11745bd8deadSopenharmony_ci    <attribBasic>           ::= "vertex" "." <attribVtxBasic>
11755bd8deadSopenharmony_ci
11765bd8deadSopenharmony_ci    <attribVtxBasic>        ::= "position"
11775bd8deadSopenharmony_ci                              | "weight" <vtxOptWeightNum>
11785bd8deadSopenharmony_ci                              | "normal"
11795bd8deadSopenharmony_ci                              | "fogcoord"
11805bd8deadSopenharmony_ci                              | "texcoord" <optTexCoordNum>
11815bd8deadSopenharmony_ci                              | "matrixindex" "[" <vtxWeightNum> "]"
11825bd8deadSopenharmony_ci                              | "attrib" "[" <vtxAttribNum> "]"
11835bd8deadSopenharmony_ci
11845bd8deadSopenharmony_ci    <attribColor>           ::= "vertex" "." "color"
11855bd8deadSopenharmony_ci
11865bd8deadSopenharmony_ci    <paramUseV>             ::= <paramSingleVarName> <swizzleSuffix>
11875bd8deadSopenharmony_ci                              | <paramArrayVarName> "[" <arrayMem> "]" 
11885bd8deadSopenharmony_ci                                <swizzleSuffix>
11895bd8deadSopenharmony_ci                              | <stateSingleItem> <swizzleSuffix>
11905bd8deadSopenharmony_ci                              | <programSingleItem> <swizzleSuffix>
11915bd8deadSopenharmony_ci                              | <constantVector> <swizzleSuffix>
11925bd8deadSopenharmony_ci                              | <constantScalar> <swizzleSuffix>
11935bd8deadSopenharmony_ci
11945bd8deadSopenharmony_ci    <paramUseS>             ::= <paramSingleVarName> <scalarSuffix>
11955bd8deadSopenharmony_ci                              | <paramArrayVarName> "[" <arrayMem> "]" 
11965bd8deadSopenharmony_ci                                <scalarSuffix>
11975bd8deadSopenharmony_ci                              | <stateSingleItem> <scalarSuffix>
11985bd8deadSopenharmony_ci                              | <programSingleItem> <scalarSuffix>
11995bd8deadSopenharmony_ci                              | <constantVector> <scalarSuffix>
12005bd8deadSopenharmony_ci                              | <constantScalar> <scalarSuffix>
12015bd8deadSopenharmony_ci
12025bd8deadSopenharmony_ci    <paramUseVNS>           ::= <paramSingleVarName>
12035bd8deadSopenharmony_ci                              | <paramArrayVarName> "[" <arrayMem> "]"
12045bd8deadSopenharmony_ci                              | <stateSingleItem>
12055bd8deadSopenharmony_ci                              | <programSingleItem>
12065bd8deadSopenharmony_ci                              | <constantVector>
12075bd8deadSopenharmony_ci                              | <constantScalar>
12085bd8deadSopenharmony_ci
12095bd8deadSopenharmony_ci    <paramUseDB>            ::= <stateSingleItem>
12105bd8deadSopenharmony_ci                              | <programSingleItem>
12115bd8deadSopenharmony_ci                              | <constantVector>
12125bd8deadSopenharmony_ci                              | <signedConstantScalar>
12135bd8deadSopenharmony_ci
12145bd8deadSopenharmony_ci    <paramUseDM>            ::= <stateMultipleItem>
12155bd8deadSopenharmony_ci                              | <programMultipleItem>
12165bd8deadSopenharmony_ci                              | <constantVector>
12175bd8deadSopenharmony_ci                              | <signedConstantScalar>
12185bd8deadSopenharmony_ci
12195bd8deadSopenharmony_ci    <stateMultipleItem>     ::= <stateSingleItem>
12205bd8deadSopenharmony_ci                              | "state" "." <stateMatrixRows>
12215bd8deadSopenharmony_ci
12225bd8deadSopenharmony_ci    <stateSingleItem>       ::= "state" "." <stateMaterialItem>
12235bd8deadSopenharmony_ci                              | "state" "." <stateLightItem>
12245bd8deadSopenharmony_ci                              | "state" "." <stateLightModelItem>
12255bd8deadSopenharmony_ci                              | "state" "." <stateLightProdItem>
12265bd8deadSopenharmony_ci                              | "state" "." <stateFogItem>
12275bd8deadSopenharmony_ci                              | "state" "." <stateMatrixRow>
12285bd8deadSopenharmony_ci                              | "state" "." <stateTexGenItem>
12295bd8deadSopenharmony_ci                              | "state" "." <stateClipPlaneItem>
12305bd8deadSopenharmony_ci                              | "state" "." <statePointItem>
12315bd8deadSopenharmony_ci
12325bd8deadSopenharmony_ci    <stateMaterialItem>     ::= "material" "." <stateMatProperty>
12335bd8deadSopenharmony_ci                              | "material" "." <faceType> "." 
12345bd8deadSopenharmony_ci                                <stateMatProperty>
12355bd8deadSopenharmony_ci
12365bd8deadSopenharmony_ci    <stateMatProperty>      ::= "ambient"
12375bd8deadSopenharmony_ci                              | "diffuse"
12385bd8deadSopenharmony_ci                              | "specular"
12395bd8deadSopenharmony_ci                              | "emission"
12405bd8deadSopenharmony_ci                              | "shininess"
12415bd8deadSopenharmony_ci
12425bd8deadSopenharmony_ci    <stateLightItem>        ::= "light" "[" <stateLightNumber> "]" "." 
12435bd8deadSopenharmony_ci                                <stateLightProperty>
12445bd8deadSopenharmony_ci
12455bd8deadSopenharmony_ci    <stateLightProperty>    ::= "ambient"
12465bd8deadSopenharmony_ci                              | "diffuse"
12475bd8deadSopenharmony_ci                              | "specular"
12485bd8deadSopenharmony_ci                              | "position"
12495bd8deadSopenharmony_ci                              | "attenuation"
12505bd8deadSopenharmony_ci                              | "spot" "." <stateSpotProperty>
12515bd8deadSopenharmony_ci                              | "half"
12525bd8deadSopenharmony_ci
12535bd8deadSopenharmony_ci    <stateSpotProperty>     ::= "direction"
12545bd8deadSopenharmony_ci
12555bd8deadSopenharmony_ci    <stateLightModelItem>   ::= "lightmodel" <stateLModProperty>
12565bd8deadSopenharmony_ci
12575bd8deadSopenharmony_ci    <stateLModProperty>     ::= "." "ambient"
12585bd8deadSopenharmony_ci                              | "." "scenecolor"
12595bd8deadSopenharmony_ci                              | "." <faceType> "." "scenecolor"
12605bd8deadSopenharmony_ci
12615bd8deadSopenharmony_ci    <stateLightProdItem>    ::= "lightprod" "[" <stateLightNumber> "]" "." 
12625bd8deadSopenharmony_ci                                <stateLProdProperty>
12635bd8deadSopenharmony_ci                              | "lightprod" "[" <stateLightNumber> "]" "." 
12645bd8deadSopenharmony_ci                                <faceType> "." <stateLProdProperty>
12655bd8deadSopenharmony_ci
12665bd8deadSopenharmony_ci    <stateLProdProperty>    ::= "ambient"
12675bd8deadSopenharmony_ci                              | "diffuse"
12685bd8deadSopenharmony_ci                              | "specular"
12695bd8deadSopenharmony_ci
12705bd8deadSopenharmony_ci    <stateLightNumber>      ::= <integer> /* [0,MAX_LIGHTS-1] */
12715bd8deadSopenharmony_ci
12725bd8deadSopenharmony_ci    <stateFogItem>          ::= "fog" "." <stateFogProperty>
12735bd8deadSopenharmony_ci
12745bd8deadSopenharmony_ci    <stateFogProperty>      ::= "color"
12755bd8deadSopenharmony_ci                              | "params"
12765bd8deadSopenharmony_ci
12775bd8deadSopenharmony_ci    <stateMatrixRows>       ::= <stateMatrixItem>
12785bd8deadSopenharmony_ci                              | <stateMatrixItem> "." <stateMatModifier>
12795bd8deadSopenharmony_ci                              | <stateMatrixItem> "." "row" "[" 
12805bd8deadSopenharmony_ci                                <stateMatrixRowNum> ".." <stateMatrixRowNum> 
12815bd8deadSopenharmony_ci                                "]"
12825bd8deadSopenharmony_ci                              | <stateMatrixItem> "." <stateMatModifier> "." 
12835bd8deadSopenharmony_ci                                "row" "[" <stateMatrixRowNum> ".." 
12845bd8deadSopenharmony_ci                                <stateMatrixRowNum> "]"
12855bd8deadSopenharmony_ci
12865bd8deadSopenharmony_ci    <stateMatrixRow>        ::= <stateMatrixItem> "." "row" "[" 
12875bd8deadSopenharmony_ci                                <stateMatrixRowNum> "]"
12885bd8deadSopenharmony_ci                              | <stateMatrixItem> "." <stateMatModifier> "." 
12895bd8deadSopenharmony_ci                                "row" "[" <stateMatrixRowNum> "]"
12905bd8deadSopenharmony_ci
12915bd8deadSopenharmony_ci    <stateMatrixItem>       ::= "matrix" "." <stateMatrixName>
12925bd8deadSopenharmony_ci
12935bd8deadSopenharmony_ci    <stateMatModifier>      ::= "inverse"
12945bd8deadSopenharmony_ci                              | "transpose"
12955bd8deadSopenharmony_ci                              | "invtrans"
12965bd8deadSopenharmony_ci
12975bd8deadSopenharmony_ci    <stateMatrixName>       ::= "modelview" <stateOptModMatNum>
12985bd8deadSopenharmony_ci                              | "projection"
12995bd8deadSopenharmony_ci                              | "mvp"
13005bd8deadSopenharmony_ci                              | "texture" <optTexCoordNum>
13015bd8deadSopenharmony_ci                              | "palette" "[" <statePaletteMatNum> "]"
13025bd8deadSopenharmony_ci                              | "program" "[" <stateProgramMatNum> "]"
13035bd8deadSopenharmony_ci
13045bd8deadSopenharmony_ci    <stateMatrixRowNum>     ::= <integer> /* [0,3] */
13055bd8deadSopenharmony_ci
13065bd8deadSopenharmony_ci    <stateOptModMatNum>     ::= /* empty */
13075bd8deadSopenharmony_ci                              | "[" <stateModMatNum> "]"
13085bd8deadSopenharmony_ci
13095bd8deadSopenharmony_ci    <stateModMatNum>        ::= <integer> /*[0,MAX_VERTEX_UNITS_ARB-1]*/
13105bd8deadSopenharmony_ci
13115bd8deadSopenharmony_ci    <statePaletteMatNum>    ::= <integer> /*[0,MAX_PALETTE_MATRICES_ARB-1]*/
13125bd8deadSopenharmony_ci
13135bd8deadSopenharmony_ci    <stateProgramMatNum>    ::= <integer> /*[0,MAX_PROGRAM_MATRICES_ARB-1]*/
13145bd8deadSopenharmony_ci
13155bd8deadSopenharmony_ci    <stateTexGenItem>       ::= "texgen" <optTexCoordNum> "." 
13165bd8deadSopenharmony_ci                                <stateTexGenType> "." <stateTexGenCoord>
13175bd8deadSopenharmony_ci
13185bd8deadSopenharmony_ci    <stateTexGenType>       ::= "eye"
13195bd8deadSopenharmony_ci                              | "object"
13205bd8deadSopenharmony_ci
13215bd8deadSopenharmony_ci    <stateTexGenCoord>      ::= "s"
13225bd8deadSopenharmony_ci                              | "t"
13235bd8deadSopenharmony_ci                              | "r"
13245bd8deadSopenharmony_ci                              | "q"
13255bd8deadSopenharmony_ci
13265bd8deadSopenharmony_ci    <stateClipPlaneItem>    ::= "clip" "[" <clipPlaneNum> "]" "." "plane"
13275bd8deadSopenharmony_ci
13285bd8deadSopenharmony_ci    <statePointItem>        ::= "point" "." <statePointProperty>
13295bd8deadSopenharmony_ci
13305bd8deadSopenharmony_ci    <statePointProperty>    ::= "size"
13315bd8deadSopenharmony_ci                              | "attenuation"
13325bd8deadSopenharmony_ci
13335bd8deadSopenharmony_ci    <programSingleItem>     ::= <progEnvParam>
13345bd8deadSopenharmony_ci                              | <progLocalParam>
13355bd8deadSopenharmony_ci
13365bd8deadSopenharmony_ci    <programMultipleItem>   ::= <progEnvParams>
13375bd8deadSopenharmony_ci                              | <progLocalParams>
13385bd8deadSopenharmony_ci
13395bd8deadSopenharmony_ci    <progEnvParams>         ::= "program" "." "env" "[" <progEnvParamNums> "]"
13405bd8deadSopenharmony_ci
13415bd8deadSopenharmony_ci    <progEnvParamNums>      ::= <progEnvParamNum>
13425bd8deadSopenharmony_ci                              | <progEnvParamNum> ".." <progEnvParamNum>
13435bd8deadSopenharmony_ci
13445bd8deadSopenharmony_ci    <progEnvParam>          ::= "program" "." "env" "[" <progEnvParamNum> "]"
13455bd8deadSopenharmony_ci
13465bd8deadSopenharmony_ci    <progLocalParams>       ::= "program" "." "local" "[" <progLocalParamNums> 
13475bd8deadSopenharmony_ci                                "]"
13485bd8deadSopenharmony_ci
13495bd8deadSopenharmony_ci    <progLocalParamNums>    ::= <progLocalParamNum>
13505bd8deadSopenharmony_ci                              | <progLocalParamNum> ".." <progLocalParamNum>
13515bd8deadSopenharmony_ci
13525bd8deadSopenharmony_ci    <progLocalParam>        ::= "program" "." "local" "[" <progLocalParamNum> 
13535bd8deadSopenharmony_ci                                "]"
13545bd8deadSopenharmony_ci
13555bd8deadSopenharmony_ci    <progEnvParamNum>       ::= <integer> 
13565bd8deadSopenharmony_ci                                /*[0,MAX_PROGRAM_ENV_PARAMETERS_ARB-1]*/
13575bd8deadSopenharmony_ci
13585bd8deadSopenharmony_ci    <progLocalParamNum>     ::= <integer> 
13595bd8deadSopenharmony_ci                                /*[0,MAX_PROGRAM_LOCAL_PARAMETERS_ARB-1]*/
13605bd8deadSopenharmony_ci
13615bd8deadSopenharmony_ci    <constantVector>        ::= "{" <constantVectorList> "}"
13625bd8deadSopenharmony_ci
13635bd8deadSopenharmony_ci    <constantVectorList>    ::= <signedConstantScalar>
13645bd8deadSopenharmony_ci                              | <signedConstantScalar> "," 
13655bd8deadSopenharmony_ci                                <signedConstantScalar>
13665bd8deadSopenharmony_ci                              | <signedConstantScalar> "," 
13675bd8deadSopenharmony_ci                                <signedConstantScalar> "," 
13685bd8deadSopenharmony_ci                                <signedConstantScalar>
13695bd8deadSopenharmony_ci                              | <signedConstantScalar> "," 
13705bd8deadSopenharmony_ci                                <signedConstantScalar> "," 
13715bd8deadSopenharmony_ci                                <signedConstantScalar> "," 
13725bd8deadSopenharmony_ci                                <signedConstantScalar>
13735bd8deadSopenharmony_ci
13745bd8deadSopenharmony_ci    <signedConstantScalar>  ::= <optSign> <constantScalar>
13755bd8deadSopenharmony_ci
13765bd8deadSopenharmony_ci    <constantScalar>        ::= <floatConstant>
13775bd8deadSopenharmony_ci
13785bd8deadSopenharmony_ci    <floatConstant>         ::= <float>
13795bd8deadSopenharmony_ci
13805bd8deadSopenharmony_ci    <tempUseV>              ::= <tempVarName> <swizzleSuffix>
13815bd8deadSopenharmony_ci
13825bd8deadSopenharmony_ci    <tempUseS>              ::= <tempVarName> <scalarSuffix>
13835bd8deadSopenharmony_ci
13845bd8deadSopenharmony_ci    <tempUseVNS>            ::= <tempVarName>
13855bd8deadSopenharmony_ci
13865bd8deadSopenharmony_ci    <tempUseW>              ::= <tempVarName> <optWriteMask>
13875bd8deadSopenharmony_ci
13885bd8deadSopenharmony_ci    <resultUseW>            ::= <resultBasic> <optWriteMask>
13895bd8deadSopenharmony_ci                              | <resultVarName> <optWriteMask>
13905bd8deadSopenharmony_ci                              | <resultVtxColor> <optWriteMask>
13915bd8deadSopenharmony_ci                              | <resultVtxColor> "." <colorType> 
13925bd8deadSopenharmony_ci                                <optWriteMask>
13935bd8deadSopenharmony_ci                              | <resultVtxColor> "." <faceType> <optWriteMask>
13945bd8deadSopenharmony_ci                              | <resultVtxColor> "." <faceType> "." 
13955bd8deadSopenharmony_ci                                <colorType> "." <optWriteMask>
13965bd8deadSopenharmony_ci
13975bd8deadSopenharmony_ci    <resultUseD>            ::= <resultBasic>
13985bd8deadSopenharmony_ci                              | <resultVtxColor>
13995bd8deadSopenharmony_ci                              | <resultVtxColor> "." <colorType>
14005bd8deadSopenharmony_ci                              | <resultVtxColor> "." <faceType>
14015bd8deadSopenharmony_ci                              | <resultVtxColor> "." <faceType> "." 
14025bd8deadSopenharmony_ci                                <colorType>
14035bd8deadSopenharmony_ci
14045bd8deadSopenharmony_ci    <resultBasic>           ::= "result" "." <resultVtxBasic>
14055bd8deadSopenharmony_ci
14065bd8deadSopenharmony_ci    <resultVtxBasic>        ::= "position"
14075bd8deadSopenharmony_ci                              | "fogcoord"
14085bd8deadSopenharmony_ci                              | "pointsize"
14095bd8deadSopenharmony_ci                              | "texcoord" <optTexCoordNum>
14105bd8deadSopenharmony_ci
14115bd8deadSopenharmony_ci    <resultVtxColor>        ::= "result" "." "color"
14125bd8deadSopenharmony_ci
14135bd8deadSopenharmony_ci    <arrayMem>              ::= <arrayMemAbs>
14145bd8deadSopenharmony_ci                              | <arrayMemRel>
14155bd8deadSopenharmony_ci
14165bd8deadSopenharmony_ci    <arrayMemRel>           ::= <addrUseS> <arrayMemRelOffset>
14175bd8deadSopenharmony_ci
14185bd8deadSopenharmony_ci    <arrayMemAbs>           ::= <integer>
14195bd8deadSopenharmony_ci
14205bd8deadSopenharmony_ci    <arrayMemRelOffset>     ::= /* empty */
14215bd8deadSopenharmony_ci                              | "+" <integer>
14225bd8deadSopenharmony_ci                              | "-" <integer>
14235bd8deadSopenharmony_ci
14245bd8deadSopenharmony_ci    <addrUseS>              ::= <addrVarName> <scalarAddrSuffix>
14255bd8deadSopenharmony_ci
14265bd8deadSopenharmony_ci    <addrUseW>              ::= <addrVarName> <addrWriteMask>
14275bd8deadSopenharmony_ci
14285bd8deadSopenharmony_ci    <addrWriteMask>         ::= "." "x"
14295bd8deadSopenharmony_ci
14305bd8deadSopenharmony_ci    <optWriteMask>          ::= /* empty */
14315bd8deadSopenharmony_ci                              | <xyzwMask>
14325bd8deadSopenharmony_ci
14335bd8deadSopenharmony_ci    <xyzwMask>              ::= "." "x"
14345bd8deadSopenharmony_ci                              | "." "y"
14355bd8deadSopenharmony_ci                              | "." "xy"
14365bd8deadSopenharmony_ci                              | "." "z"
14375bd8deadSopenharmony_ci                              | "." "xz"
14385bd8deadSopenharmony_ci                              | "." "yz"
14395bd8deadSopenharmony_ci                              | "." "xyz"
14405bd8deadSopenharmony_ci                              | "." "w"
14415bd8deadSopenharmony_ci                              | "." "xw"
14425bd8deadSopenharmony_ci                              | "." "yw"
14435bd8deadSopenharmony_ci                              | "." "xyw"
14445bd8deadSopenharmony_ci                              | "." "zw"
14455bd8deadSopenharmony_ci                              | "." "xzw"
14465bd8deadSopenharmony_ci                              | "." "yzw"
14475bd8deadSopenharmony_ci                              | "." "xyzw"
14485bd8deadSopenharmony_ci
14495bd8deadSopenharmony_ci    <swizzleSuffix>         ::= /* empty */
14505bd8deadSopenharmony_ci                              | "." <component>
14515bd8deadSopenharmony_ci                              | "." <xyzwComponent> <xyzwComponent> 
14525bd8deadSopenharmony_ci                                <xyzwComponent> <xyzwComponent>
14535bd8deadSopenharmony_ci
14545bd8deadSopenharmony_ci    <extendedSwizzle>       ::= <extSwizComp> "," <extSwizComp> "," 
14555bd8deadSopenharmony_ci                                <extSwizComp> "," <extSwizComp>
14565bd8deadSopenharmony_ci
14575bd8deadSopenharmony_ci    <extSwizComp>           ::= <optSign> <xyzwExtSwizSel>
14585bd8deadSopenharmony_ci
14595bd8deadSopenharmony_ci    <xyzwExtSwizSel>        ::= "0"
14605bd8deadSopenharmony_ci                              | "1"
14615bd8deadSopenharmony_ci                              | <xyzwComponent>
14625bd8deadSopenharmony_ci
14635bd8deadSopenharmony_ci    <scalarAddrSuffix>      ::= "." <addrComponent>
14645bd8deadSopenharmony_ci
14655bd8deadSopenharmony_ci    <addrComponent>         ::= "x"
14665bd8deadSopenharmony_ci
14675bd8deadSopenharmony_ci    <scalarSuffix>          ::= "." <component>
14685bd8deadSopenharmony_ci
14695bd8deadSopenharmony_ci    <component>             ::= <xyzwComponent>
14705bd8deadSopenharmony_ci
14715bd8deadSopenharmony_ci    <xyzwComponent>         ::= "x"
14725bd8deadSopenharmony_ci                              | "y"
14735bd8deadSopenharmony_ci                              | "z"
14745bd8deadSopenharmony_ci                              | "w"
14755bd8deadSopenharmony_ci
14765bd8deadSopenharmony_ci    <optSign>               ::= /* empty */
14775bd8deadSopenharmony_ci                              | "-"
14785bd8deadSopenharmony_ci                              | "+"
14795bd8deadSopenharmony_ci
14805bd8deadSopenharmony_ci    <faceType>              ::= "front"
14815bd8deadSopenharmony_ci                              | "back"
14825bd8deadSopenharmony_ci
14835bd8deadSopenharmony_ci    <colorType>             ::= "primary"
14845bd8deadSopenharmony_ci                              | "secondary"
14855bd8deadSopenharmony_ci
14865bd8deadSopenharmony_ci    <vtxAttribNum>          ::= <integer> /*[0,MAX_VERTEX_ATTRIBS_ARB-1]*/
14875bd8deadSopenharmony_ci
14885bd8deadSopenharmony_ci    <vtxOptWeightNum>       ::= /* empty */
14895bd8deadSopenharmony_ci                              | "[" <vtxWeightNum> "]"
14905bd8deadSopenharmony_ci
14915bd8deadSopenharmony_ci    <vtxWeightNum>          ::= <integer> /*[0,MAX_VERTEX_UNITS_ARB-1] must be 
14925bd8deadSopenharmony_ci                                divisible by four */
14935bd8deadSopenharmony_ci
14945bd8deadSopenharmony_ci    <optTexCoordNum>        ::= /* empty */
14955bd8deadSopenharmony_ci                              | "[" <texCoordNum> "]"
14965bd8deadSopenharmony_ci
14975bd8deadSopenharmony_ci    <texCoordNum>           ::= <integer> /*[0,MAX_TEXTURE_COORDS_ARB-1]*/
14985bd8deadSopenharmony_ci
14995bd8deadSopenharmony_ci    <clipPlaneNum>          ::= <integer> /*[0,MAX_CLIP_PLANES-1]*/
15005bd8deadSopenharmony_ci
15015bd8deadSopenharmony_ci    The <integer>, <float>, and <identifier> grammar rules match
15025bd8deadSopenharmony_ci    integer constants, floating point constants, and identifier names
15035bd8deadSopenharmony_ci    as described in the ARB_vertex_program specification.  The <float>
15045bd8deadSopenharmony_ci    grammar rule here is identical to the <floatConstant> grammar rule
15055bd8deadSopenharmony_ci    in ARB_vertex_program.
15065bd8deadSopenharmony_ci
15075bd8deadSopenharmony_ci    The grammar rules <tempVarName>, <addrVarName>, <attribVarName>,
15085bd8deadSopenharmony_ci    <paramArrayVarName>, <paramSingleVarName>, <resultVarName> refer
15095bd8deadSopenharmony_ci    to the names of temporary, address register, attribute, program
15105bd8deadSopenharmony_ci    parameter array, program parameter, and result variables declared
15115bd8deadSopenharmony_ci    in the program text.
15125bd8deadSopenharmony_ci
15135bd8deadSopenharmony_ciGLX Protocol
15145bd8deadSopenharmony_ci
15155bd8deadSopenharmony_ci    None.
15165bd8deadSopenharmony_ci
15175bd8deadSopenharmony_ciErrors
15185bd8deadSopenharmony_ci
15195bd8deadSopenharmony_ci    None.
15205bd8deadSopenharmony_ci
15215bd8deadSopenharmony_ciNew State
15225bd8deadSopenharmony_ci
15235bd8deadSopenharmony_ci    None.
15245bd8deadSopenharmony_ci
15255bd8deadSopenharmony_ci
15265bd8deadSopenharmony_ciNew Implementation Dependent State
15275bd8deadSopenharmony_ci                                                                  Min
15285bd8deadSopenharmony_ci    Get Value                            Type    Get Command      Value   Description         Sec       Attrib
15295bd8deadSopenharmony_ci    -----------------------------------  ----    ---------------  ------  -----------------   --------  ------
15305bd8deadSopenharmony_ci    MAX_PROGRAM_EXEC_INSTRUCTIONS_NV     Z+      GetProgramivARB  65536   maximum program     2.14.4.4  -
15315bd8deadSopenharmony_ci                                                                          execution inst-
15325bd8deadSopenharmony_ci                                                                          ruction count
15335bd8deadSopenharmony_ci    MAX_PROGRAM_CALL_DEPTH_NV            Z+      GetProgramivARB  4       maximum program     2.14.4.4  -
15345bd8deadSopenharmony_ci                                                                          call stack depth
15355bd8deadSopenharmony_ci
15365bd8deadSopenharmony_ci    (add to Table X.11.  New Implementation-Dependent Values Introduced
15375bd8deadSopenharmony_ci    by ARB_vertex_program.  Values queried by GetProgramivARB require
15385bd8deadSopenharmony_ci    a <pname> of VERTEX_PROGRAM_ARB.)
15395bd8deadSopenharmony_ci
15405bd8deadSopenharmony_ciRevision History
15415bd8deadSopenharmony_ci
15425bd8deadSopenharmony_ci    Rev.  Date      Author   Changes
15435bd8deadSopenharmony_ci    ----  --------  -------  --------------------------------------------
15445bd8deadSopenharmony_ci    3     06/23/04  pbrown   Documented that vertex results are undefined
15455bd8deadSopenharmony_ci                             if the call stack overflows, and clarified that
15465bd8deadSopenharmony_ci                             RET with an empty call stack is not an error.
15475bd8deadSopenharmony_ci
15485bd8deadSopenharmony_ci    2     05/16/04  pbrown   Documented terminals in modified vertex program
15495bd8deadSopenharmony_ci                             grammar. 
15505bd8deadSopenharmony_ci
15515bd8deadSopenharmony_ci    1     --------  pbrown   Internal pre-release revisions.
1552