Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

nv30_shader.h

Go to the documentation of this file.
00001 #ifndef __NV30_SHADER_H__
00002 #define __NV30_SHADER_H__
00003 
00004 /* Vertex programs instruction set
00005  *
00006  * 128bit opcodes, split into 4 32-bit ones for ease of use.
00007  *
00008  * Non-native instructions
00009  *   ABS - MOV + NV40_VP_INST0_DEST_ABS
00010  *   POW - EX2 + MUL + LG2
00011  *   SUB - ADD, second source negated
00012  *   SWZ - MOV
00013  *   XPD -  
00014  *
00015  * Register access
00016  *   - Only one INPUT can be accessed per-instruction (move extras into TEMPs)
00017  *   - Only one CONST can be accessed per-instruction (move extras into TEMPs)
00018  *
00019  * Relative Addressing
00020  *   According to the value returned for MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB
00021  *   there are only two address registers available.  The destination in the ARL
00022  *   instruction is set to TEMP <n> (The temp isn't actually written).
00023  *
00024  *   When using vanilla ARB_v_p, the proprietary driver will squish both the available
00025  *   ADDRESS regs into the first hardware reg in the X and Y components.
00026  *
00027  *   To use an address reg as an index into consts, the CONST_SRC is set to
00028  *   (const_base + offset) and INDEX_CONST is set.
00029  *
00030  *   To access the second address reg use ADDR_REG_SELECT_1. A particular component
00031  *   of the address regs is selected with ADDR_SWZ.
00032  *
00033  *   Only one address register can be accessed per instruction.
00034  *
00035  * Conditional execution (see NV_vertex_program{2,3} for details)
00036  *   Conditional execution of an instruction is enabled by setting COND_TEST_ENABLE, and
00037  *   selecting the condition which will allow the test to pass with COND_{FL,LT,...}.
00038  *   It is possible to swizzle the values in the condition register, which allows for
00039  *   testing against an individual component.
00040  *
00041  * Branching
00042  *   The BRA/CAL instructions seem to follow a slightly different opcode layout.  The
00043  *   destination instruction ID (IADDR) overlaps a source field.  Instruction ID's seem to
00044  *   be numbered based on the UPLOAD_FROM_ID FIFO command, and is incremented automatically
00045  *   on each UPLOAD_INST FIFO command.
00046  *
00047  *   Conditional branching is achieved by using the condition tests described above.
00048  *   There doesn't appear to be dedicated looping instructions, but this can be done
00049  *   using a temp reg + conditional branching.
00050  *
00051  *   Subroutines may be uploaded before the main program itself, but the first executed
00052  *   instruction is determined by the PROGRAM_START_ID FIFO command.
00053  *
00054  */
00055 
00056 /* DWORD 0 */
00057 #define NV30_VP_INST_ADDR_REG_SELECT_1              (1 << 24)
00058 #define NV30_VP_INST_SRC2_ABS                   (1 << 23) /* guess */
00059 #define NV30_VP_INST_SRC1_ABS                   (1 << 22) /* guess */
00060 #define NV30_VP_INST_SRC0_ABS                   (1 << 21) /* guess */
00061 #define NV30_VP_INST_OUT_RESULT                 (1 << 20)
00062 #define NV30_VP_INST_DEST_TEMP_ID_SHIFT             16
00063 #define NV30_VP_INST_DEST_TEMP_ID_MASK              (0x0F << 16)
00064 #define NV30_VP_INST_COND_UPDATE_ENABLE             (1<<15)
00065 #define NV30_VP_INST_COND_TEST_ENABLE               (1<<14)
00066 #define NV30_VP_INST_COND_SHIFT                 11
00067 #define NV30_VP_INST_COND_MASK                  (0x07 << 11)
00068 #   define NV30_VP_INST_COND_FL 0 /* guess */   
00069 #   define NV30_VP_INST_COND_LT 1   
00070 #   define NV30_VP_INST_COND_EQ 2
00071 #   define NV30_VP_INST_COND_LE 3
00072 #   define NV30_VP_INST_COND_GT 4
00073 #   define NV30_VP_INST_COND_NE 5
00074 #   define NV30_VP_INST_COND_GE 6
00075 #   define NV30_VP_INST_COND_TR 7 /* guess */
00076 #define NV30_VP_INST_COND_SWZ_X_SHIFT               9
00077 #define NV30_VP_INST_COND_SWZ_X_MASK                (0x03 <<  9)
00078 #define NV30_VP_INST_COND_SWZ_Y_SHIFT               7
00079 #define NV30_VP_INST_COND_SWZ_Y_MASK                (0x03 <<  7)
00080 #define NV30_VP_INST_COND_SWZ_Z_SHIFT               5
00081 #define NV30_VP_INST_COND_SWZ_Z_MASK                (0x03 <<  5)
00082 #define NV30_VP_INST_COND_SWZ_W_SHIFT               3
00083 #define NV30_VP_INST_COND_SWZ_W_MASK                (0x03 <<  3)
00084 #define NV30_VP_INST_COND_SWZ_ALL_SHIFT             3
00085 #define NV30_VP_INST_COND_SWZ_ALL_MASK              (0xFF <<  3)
00086 #define NV30_VP_INST_ADDR_SWZ_SHIFT             1
00087 #define NV30_VP_INST_ADDR_SWZ_MASK              (0x03 <<  1)
00088 #define NV30_VP_INST_SCA_OPCODEH_SHIFT              0
00089 #define NV30_VP_INST_SCA_OPCODEH_MASK               (0x01 <<  0)
00090 
00091 /* DWORD 1 */
00092 #define NV30_VP_INST_SCA_OPCODEL_SHIFT              28
00093 #define NV30_VP_INST_SCA_OPCODEL_MASK               (0x0F << 28)
00094 #   define NV30_VP_INST_OP_NOP  0x00
00095 #   define NV30_VP_INST_OP_RCP  0x02
00096 #   define NV30_VP_INST_OP_RCC  0x03
00097 #   define NV30_VP_INST_OP_RSQ  0x04
00098 #   define NV30_VP_INST_OP_EXP  0x05
00099 #   define NV30_VP_INST_OP_LOG  0x06
00100 #   define NV30_VP_INST_OP_LIT  0x07
00101 #   define NV30_VP_INST_OP_BRA  0x09
00102 #   define NV30_VP_INST_OP_CAL  0x0B
00103 #   define NV30_VP_INST_OP_RET  0x0C
00104 #   define NV30_VP_INST_OP_LG2  0x0D
00105 #   define NV30_VP_INST_OP_EX2  0x0E
00106 #   define NV30_VP_INST_OP_SIN  0x0F
00107 #   define NV30_VP_INST_OP_COS  0x10
00108 #define NV30_VP_INST_VEC_OPCODE_SHIFT               23
00109 #define NV30_VP_INST_VEC_OPCODE_MASK                (0x1F << 23)
00110 #   define NV30_VP_INST_OP_NOPV 0x00
00111 #   define NV30_VP_INST_OP_MOV  0x01
00112 #   define NV30_VP_INST_OP_MUL  0x02
00113 #   define NV30_VP_INST_OP_ADD  0x03
00114 #   define NV30_VP_INST_OP_MAD  0x04
00115 #   define NV30_VP_INST_OP_DP3  0x05
00116 #   define NV30_VP_INST_OP_DP4  0x07
00117 #   define NV30_VP_INST_OP_DPH  0x06
00118 #   define NV30_VP_INST_OP_DST  0x08
00119 #   define NV30_VP_INST_OP_MIN  0x09
00120 #   define NV30_VP_INST_OP_MAX  0x0A
00121 #   define NV30_VP_INST_OP_SLT  0x0B
00122 #   define NV30_VP_INST_OP_SGE  0x0C
00123 #   define NV30_VP_INST_OP_ARL  0x0D
00124 #   define NV30_VP_INST_OP_FRC  0x0E
00125 #   define NV30_VP_INST_OP_FLR  0x0F
00126 #   define NV30_VP_INST_OP_SEQ  0x10
00127 #   define NV30_VP_INST_OP_SFL  0x11
00128 #   define NV30_VP_INST_OP_SGT  0x12
00129 #   define NV30_VP_INST_OP_SLE  0x13
00130 #   define NV30_VP_INST_OP_SNE  0x14
00131 #   define NV30_VP_INST_OP_STR  0x15
00132 #   define NV30_VP_INST_OP_SSG  0x16
00133 #   define NV30_VP_INST_OP_ARR  0x17
00134 #   define NV30_VP_INST_OP_ARA  0x18
00135 #define NV30_VP_INST_CONST_SRC_SHIFT                14
00136 #define NV30_VP_INST_CONST_SRC_MASK             (0xFF << 14)
00137 #define NV30_VP_INST_INPUT_SRC_SHIFT                9       /*NV20*/
00138 #define NV30_VP_INST_INPUT_SRC_MASK             (0x0F <<  9)    /*NV20*/
00139 #   define NV30_VP_INST_IN_POS  0     /* These seem to match the bindings specified in */
00140 #   define NV30_VP_INST_IN_WEIGHT   1     /* the ARB_v_p spec (2.14.3.1) */
00141 #   define NV30_VP_INST_IN_NORMAL   2     
00142 #   define NV30_VP_INST_IN_COL0 3     /* Should probably confirm them all though */
00143 #   define NV30_VP_INST_IN_COL1 4
00144 #   define NV30_VP_INST_IN_FOGC 5
00145 #   define NV30_VP_INST_IN_TC0  8
00146 #   define NV30_VP_INST_IN_TC(n)    (8+n)
00147 #define NV30_VP_INST_SRC0H_SHIFT                0       /*NV20*/
00148 #define NV30_VP_INST_SRC0H_MASK                 (0x1FF << 0)    /*NV20*/
00149 
00150 /* DWORD 2 */
00151 #define NV30_VP_INST_SRC0L_SHIFT                26      /*NV20*/
00152 #define NV30_VP_INST_SRC0L_MASK                 (0x3F  <<26)    /*NV20*/
00153 #define NV30_VP_INST_SRC1_SHIFT                 11      /*NV20*/
00154 #define NV30_VP_INST_SRC1_MASK                  (0x7FFF<<11)    /*NV20*/
00155 #define NV30_VP_INST_SRC2H_SHIFT                0       /*NV20*/
00156 #define NV30_VP_INST_SRC2H_MASK                 (0x7FF << 0)    /*NV20*/
00157 #define NV30_VP_INST_IADDR_SHIFT                2
00158 #define NV30_VP_INST_IADDR_MASK                 (0xFF <<  2)    /* guess */
00159 
00160 /* DWORD 3 */
00161 #define NV30_VP_INST_SRC2L_SHIFT                28      /*NV20*/
00162 #define NV30_VP_INST_SRC2L_MASK                 (0x0F  <<28)    /*NV20*/
00163 #define NV30_VP_INST_STEMP_WRITEMASK_SHIFT          24
00164 #define NV30_VP_INST_STEMP_WRITEMASK_MASK           (0x0F << 24)
00165 #define NV30_VP_INST_VTEMP_WRITEMASK_SHIFT          20
00166 #define NV30_VP_INST_VTEMP_WRITEMASK_MASK           (0x0F << 20)
00167 #define NV30_VP_INST_SDEST_WRITEMASK_SHIFT          16
00168 #define NV30_VP_INST_SDEST_WRITEMASK_MASK           (0x0F << 16)
00169 #define NV30_VP_INST_VDEST_WRITEMASK_SHIFT          12      /*NV20*/
00170 #define NV30_VP_INST_VDEST_WRITEMASK_MASK           (0x0F << 12)    /*NV20*/
00171 #define NV30_VP_INST_DEST_ID_SHIFT              2
00172 #define NV30_VP_INST_DEST_ID_MASK               (0x0F <<  2)
00173 #   define NV30_VP_INST_DEST_POS    0
00174 #   define NV30_VP_INST_DEST_COL0   3
00175 #   define NV30_VP_INST_DEST_COL1   4
00176 #   define NV30_VP_INST_DEST_TC(n)  (8+n)
00177 
00178 /* Source-register definition - matches NV20 exactly */
00179 #define NV30_VP_SRC_REG_NEGATE                  (1<<14)
00180 #define NV30_VP_SRC_REG_SWZ_X_SHIFT             12
00181 #define NV30_VP_SRC_REG_SWZ_X_MASK              (0x03  <<12)
00182 #define NV30_VP_SRC_REG_SWZ_Y_SHIFT             10
00183 #define NV30_VP_SRC_REG_SWZ_Y_MASK              (0x03  <<10)
00184 #define NV30_VP_SRC_REG_SWZ_Z_SHIFT             8
00185 #define NV30_VP_SRC_REG_SWZ_Z_MASK              (0x03  << 8)
00186 #define NV30_VP_SRC_REG_SWZ_W_SHIFT             6
00187 #define NV30_VP_SRC_REG_SWZ_W_MASK              (0x03  << 6)
00188 #define NV30_VP_SRC_REG_SWZ_ALL_SHIFT               6
00189 #define NV30_VP_SRC_REG_SWZ_ALL_MASK                (0xFF  << 6)
00190 #define NV30_VP_SRC_REG_TEMP_ID_SHIFT               2
00191 #define NV30_VP_SRC_REG_TEMP_ID_MASK                (0x0F  << 0)
00192 #define NV30_VP_SRC_REG_TYPE_SHIFT              0
00193 #define NV30_VP_SRC_REG_TYPE_MASK               (0x03  << 0)
00194 #define NV30_VP_SRC_REG_TYPE_TEMP   1
00195 #define NV30_VP_SRC_REG_TYPE_INPUT  2
00196 #define NV30_VP_SRC_REG_TYPE_CONST  3 /* guess */
00197 
00198 /*
00199  * Each fragment program opcode appears to be comprised of 4 32-bit values.
00200  *
00201  *   0 - Opcode, output reg/mask, ATTRIB source
00202  *   1 - Source 0
00203  *   2 - Source 1
00204  *   3 - Source 2
00205  *
00206  * There appears to be no special difference between result regs and temp regs.
00207  *      result.color == R0.xyzw
00208  *      result.depth == R1.z
00209  * When the fragprog contains instructions to write depth, NV30_TCL_PRIMITIVE_3D_UNK1D78=0
00210  * otherwise it is set to 1.
00211  *
00212  * Constants are inserted directly after the instruction that uses them.
00213  * 
00214  * It appears that it's not possible to use two input registers in one
00215  * instruction as the input sourcing is done in the instruction dword
00216  * and not the source selection dwords.  As such instructions such as:
00217  * 
00218  *       ADD result.color, fragment.color, fragment.texcoord[0];
00219  *
00220  * must be split into two MOV's and then an ADD (nvidia does this) but
00221  * I'm not sure why it's not just one MOV and then source the second input
00222  * in the ADD instruction..
00223  *
00224  * Negation of the full source is done with NV30_FP_REG_NEGATE, arbitrary
00225  * negation requires multiplication with a const.
00226  *
00227  * Arbitrary swizzling is supported with the exception of SWIZZLE_ZERO/SWIZZLE_ONE
00228  * The temp/result regs appear to be initialised to (0.0, 0.0, 0.0, 0.0) as SWIZZLE_ZERO
00229  * is implemented simply by not writing to the relevant components of the destination.
00230  *
00231  * Looping
00232  *   Loops appear to be fairly expensive on NV40 at least, the proprietary driver
00233  *   goes to a lot of effort to avoid using the native looping instructions.  If
00234  *   the total number of *executed* instructions between REP/ENDREP or LOOP/ENDLOOP
00235  *   is <=500, the driver will unroll the loop.  The maximum loop count is 255.
00236  *
00237  * Conditional execution
00238  *   TODO
00239  * 
00240  * Non-native instructions:
00241  *   LIT
00242  *   LRP - MAD+MAD
00243  *   SUB - ADD, negate second source
00244  *   RSQ - LG2 + EX2
00245  *   POW - LG2 + MUL + EX2
00246  *   SCS - COS + SIN
00247  *   XPD
00248  *   DP2 - MUL + ADD
00249  *   NRM
00250  */
00251 
00252 //== Opcode / Destination selection ==
00253 #define NV30_FP_OP_PROGRAM_END                  (1 << 0)
00254 #define NV30_FP_OP_OUT_REG_SHIFT                1
00255 #define NV30_FP_OP_OUT_REG_MASK                 (31 << 1)   /* uncertain */
00256 #define NV30_FP_OP_COND_WRITE_ENABLE                (1 << 8)
00257 #define NV30_FP_OP_OUTMASK_SHIFT                9
00258 #define NV30_FP_OP_OUTMASK_MASK                 (0xF << 9)
00259 #   define NV30_FP_OP_OUT_X (1<<9)
00260 #   define NV30_FP_OP_OUT_Y (1<<10)
00261 #   define NV30_FP_OP_OUT_Z (1<<11)
00262 #   define NV30_FP_OP_OUT_W (1<<12)
00263 /* Uncertain about these, especially the input_src values.. it's possible that
00264  * they can be dynamically changed.
00265  */
00266 #define NV30_FP_OP_INPUT_SRC_SHIFT              13
00267 #define NV30_FP_OP_INPUT_SRC_MASK               (15 << 13)
00268 #   define NV30_FP_OP_INPUT_SRC_POSITION    0x0
00269 #   define NV30_FP_OP_INPUT_SRC_COL0    0x1
00270 #   define NV30_FP_OP_INPUT_SRC_COL1    0x2
00271 #   define NV30_FP_OP_INPUT_SRC_FOGC    0x3
00272 #   define NV30_FP_OP_INPUT_SRC_TC0     0x4
00273 #   define NV30_FP_OP_INPUT_SRC_TC(n)   (0x4 + n)
00274 #define NV30_FP_OP_TEX_UNIT_SHIFT               17
00275 #define NV30_FP_OP_TEX_UNIT_MASK                (0xF << 17) /* guess */
00276 #define NV30_FP_OP_PRECISION_SHIFT              22
00277 #define NV30_FP_OP_PRECISION_MASK               (3 << 22)
00278 #   define NV30_FP_PRECISION_FP32   0
00279 #   define NV30_FP_PRECISION_FP16   1
00280 #   define NV30_FP_PRECISION_FX12   2
00281 #define NV30_FP_OP_OPCODE_SHIFT                 24
00282 #define NV30_FP_OP_OPCODE_MASK                  (0x3F << 24)
00283 #   define NV30_FP_OP_OPCODE_NOP    0x00
00284 #   define NV30_FP_OP_OPCODE_MOV    0x01
00285 #   define NV30_FP_OP_OPCODE_MUL    0x02
00286 #   define NV30_FP_OP_OPCODE_ADD    0x03
00287 #   define NV30_FP_OP_OPCODE_MAD    0x04
00288 #   define NV30_FP_OP_OPCODE_DP3    0x05
00289 #   define NV30_FP_OP_OPCODE_DP4    0x06
00290 #   define NV30_FP_OP_OPCODE_DST    0x07
00291 #   define NV30_FP_OP_OPCODE_MIN    0x08
00292 #   define NV30_FP_OP_OPCODE_MAX    0x09
00293 #   define NV30_FP_OP_OPCODE_SLT    0x0A
00294 #   define NV30_FP_OP_OPCODE_SGE    0x0B
00295 #   define NV30_FP_OP_OPCODE_SLE    0x0C
00296 #   define NV30_FP_OP_OPCODE_SGT    0x0D
00297 #   define NV30_FP_OP_OPCODE_SNE    0x0E
00298 #   define NV30_FP_OP_OPCODE_SEQ    0x0F
00299 #   define NV30_FP_OP_OPCODE_FRC    0x10
00300 #   define NV30_FP_OP_OPCODE_FLR    0x11
00301 #   define NV30_FP_OP_OPCODE_PK4B   0x13
00302 #   define NV30_FP_OP_OPCODE_UP4B   0x14
00303 #   define NV30_FP_OP_OPCODE_DDX    0x15 /* can only write XY */
00304 #   define NV30_FP_OP_OPCODE_DDY    0x16 /* can only write XY */
00305 #   define NV30_FP_OP_OPCODE_TEX    0x17
00306 #   define NV30_FP_OP_OPCODE_TXP    0x18
00307 #   define NV30_FP_OP_OPCODE_TXD    0x19
00308 #   define NV30_FP_OP_OPCODE_RCP    0x1A
00309 #   define NV30_FP_OP_OPCODE_EX2    0x1C
00310 #   define NV30_FP_OP_OPCODE_LG2    0x1D
00311 #   define NV30_FP_OP_OPCODE_COS    0x22
00312 #   define NV30_FP_OP_OPCODE_SIN    0x23
00313 #   define NV30_FP_OP_OPCODE_PK2H   0x24
00314 #   define NV30_FP_OP_OPCODE_UP2H   0x25
00315 #   define NV30_FP_OP_OPCODE_PK4UB  0x27
00316 #   define NV30_FP_OP_OPCODE_UP4UB  0x28
00317 #   define NV30_FP_OP_OPCODE_PK2US  0x29
00318 #   define NV30_FP_OP_OPCODE_UP2US  0x2A
00319 #   define NV30_FP_OP_OPCODE_DP2A   0x2E
00320 #   define NV30_FP_OP_OPCODE_TXL    0x2F
00321 #   define NV30_FP_OP_OPCODE_TXB    0x31
00322 #   define NV30_FP_OP_OPCODE_DIV    0x3A
00323 /* The use of these instructions appears to be indicated by bit 31 of DWORD 2.*/
00324 #   define NV30_FP_OP_BRA_OPCODE_BRK    0x0
00325 #   define NV30_FP_OP_BRA_OPCODE_CAL    0x1
00326 #   define NV30_FP_OP_BRA_OPCODE_IF     0x2
00327 #   define NV30_FP_OP_BRA_OPCODE_LOOP   0x3
00328 #   define NV30_FP_OP_BRA_OPCODE_REP    0x4
00329 #   define NV30_FP_OP_BRA_OPCODE_RET    0x5
00330 #define NV30_FP_OP_OUT_SAT                  (1 << 31)
00331 
00332 /* high order bits of SRC0 */
00333 #define NV30_FP_OP_OUT_ABS                  (1 << 29)
00334 #define NV30_FP_OP_COND_SWZ_W_SHIFT             27
00335 #define NV30_FP_OP_COND_SWZ_W_MASK              (3 << 27)
00336 #define NV30_FP_OP_COND_SWZ_Z_SHIFT             25
00337 #define NV30_FP_OP_COND_SWZ_Z_MASK              (3 << 25)
00338 #define NV30_FP_OP_COND_SWZ_Y_SHIFT             23
00339 #define NV30_FP_OP_COND_SWZ_Y_MASK              (3 << 23)
00340 #define NV30_FP_OP_COND_SWZ_X_SHIFT             21
00341 #define NV30_FP_OP_COND_SWZ_X_MASK              (3 << 21)
00342 #define NV30_FP_OP_COND_SWZ_ALL_SHIFT               21
00343 #define NV30_FP_OP_COND_SWZ_ALL_MASK                (0xFF << 21)
00344 #define NV30_FP_OP_COND_SHIFT                   18
00345 #define NV30_FP_OP_COND_MASK                    (0x07 << 18)
00346 #   define NV30_FP_OP_COND_FL   0
00347 #   define NV30_FP_OP_COND_LT   1
00348 #   define NV30_FP_OP_COND_EQ   2
00349 #   define NV30_FP_OP_COND_LE   3
00350 #   define NV30_FP_OP_COND_GT   4
00351 #   define NV30_FP_OP_COND_NE   5
00352 #   define NV30_FP_OP_COND_GE   6
00353 #   define NV30_FP_OP_COND_TR   7
00354 
00355 /* high order bits of SRC1 */
00356 #define NV30_FP_OP_OPCODE_IS_BRANCH             (1<<31)
00357 #define NV30_FP_OP_SRC_SCALE_SHIFT              28
00358 #define NV30_FP_OP_SRC_SCALE_MASK               (3 << 28)
00359 
00360 /* SRC1 LOOP */
00361 #define NV30_FP_OP_LOOP_INCR_SHIFT              19
00362 #define NV30_FP_OP_LOOP_INCR_MASK               (0xFF << 19)
00363 #define NV30_FP_OP_LOOP_INDEX_SHIFT             10
00364 #define NV30_FP_OP_LOOP_INDEX_MASK              (0xFF << 10)
00365 #define NV30_FP_OP_LOOP_COUNT_SHIFT             2
00366 #define NV30_FP_OP_LOOP_COUNT_MASK              (0xFF << 2) /* from MAX_PROGRAM_LOOP_COUNT_NV */
00367 
00368 /* SRC1 IF */
00369 #define NV30_FP_OP_ELSE_ID_SHIFT                2
00370 #define NV30_FP_OP_ELSE_ID_MASK                 (0xFF << 2) /* UNKNOWN */
00371 
00372 /* SRC1 CAL */
00373 #define NV30_FP_OP_IADDR_SHIFT                  2
00374 #define NV30_FP_OP_IADDR_MASK                   (0xFF << 2)
00375 
00376 /* SRC1 REP
00377  *   I have no idea why there are 3 count values here..  but they
00378  *   have always been filled with the same value in my tests so
00379  *   far..
00380  */
00381 #define NV30_FP_OP_REP_COUNT1_SHIFT             2
00382 #define NV30_FP_OP_REP_COUNT1_MASK              (0xFF << 2)
00383 #define NV30_FP_OP_REP_COUNT2_SHIFT             10
00384 #define NV30_FP_OP_REP_COUNT2_MASK              (0xFF << 10)
00385 #define NV30_FP_OP_REP_COUNT3_SHIFT             19
00386 #define NV30_FP_OP_REP_COUNT3_MASK              (0xFF << 19)
00387 
00388 /* SRC2 REP/IF */
00389 #define NV30_FP_OP_END_ID_SHIFT                 2
00390 #define NV30_FP_OP_END_ID_MASK                  (0xFF << 2) /* UNKNOWN */
00391 
00392 // SRC2 high-order
00393 #define NV30_FP_OP_INDEX_INPUT                  (1 << 30)
00394 #define NV30_FP_OP_ADDR_INDEX_SHIFT             19
00395 #define NV30_FP_OP_ADDR_INDEX_MASK              (0xF << 19) /* UNKNOWN */
00396 
00397 //== Register selection ==
00398 #define NV30_FP_REG_TYPE_SHIFT                  0
00399 #define NV30_FP_REG_TYPE_MASK                   (3 << 0)
00400 #   define NV30_FP_REG_TYPE_TEMP    0
00401 #   define NV30_FP_REG_TYPE_INPUT   1
00402 #   define NV30_FP_REG_TYPE_CONST   2
00403 #define NV30_FP_REG_SRC_SHIFT                   2 /* uncertain */
00404 #define NV30_FP_REG_SRC_MASK                    (31 << 2)
00405 #define NV30_FP_REG_UNK_0                   (1 << 8)
00406 #define NV30_FP_REG_SWZ_ALL_SHIFT               9
00407 #define NV30_FP_REG_SWZ_ALL_MASK                (255 << 9)
00408 #define NV30_FP_REG_SWZ_X_SHIFT                 9
00409 #define NV30_FP_REG_SWZ_X_MASK                  (3 << 9)
00410 #define NV30_FP_REG_SWZ_Y_SHIFT                 11
00411 #define NV30_FP_REG_SWZ_Y_MASK                  (3 << 11)
00412 #define NV30_FP_REG_SWZ_Z_SHIFT                 13
00413 #define NV30_FP_REG_SWZ_Z_MASK                  (3 << 13)
00414 #define NV30_FP_REG_SWZ_W_SHIFT                 15
00415 #define NV30_FP_REG_SWZ_W_MASK                  (3 << 15)
00416 #   define NV30_FP_SWIZZLE_X    0
00417 #   define NV30_FP_SWIZZLE_Y    1
00418 #   define NV30_FP_SWIZZLE_Z    2
00419 #   define NV30_FP_SWIZZLE_W    3
00420 #define NV30_FP_REG_NEGATE                  (1 << 17)
00421 
00422 #endif

Generated on Sat Aug 19 20:40:53 2006 for Renouveau by  doxygen 1.4.4