[692] | 1 | #ifndef _VS10INST_H
|
---|
| 2 | #define _VS10INST_H
|
---|
| 3 |
|
---|
| 4 | #define VS10_ADD 1
|
---|
| 5 | #define VS10_DP3 2
|
---|
| 6 | #define VS10_DP4 3
|
---|
| 7 | #define VS10_DST 4
|
---|
| 8 | #define VS10_EXP 5
|
---|
| 9 | #define VS10_EXPP 6
|
---|
| 10 | #define VS10_FRC 7
|
---|
| 11 | #define VS10_LIT 8
|
---|
| 12 | #define VS10_LOG 9
|
---|
| 13 | #define VS10_LOGP 10
|
---|
| 14 | #define VS10_M3X2 11
|
---|
| 15 | #define VS10_M3X3 12
|
---|
| 16 | #define VS10_M3X4 13
|
---|
| 17 | #define VS10_M4X3 14
|
---|
| 18 | #define VS10_M4X4 15
|
---|
| 19 | #define VS10_MAD 16
|
---|
| 20 | #define VS10_MAX 17
|
---|
| 21 | #define VS10_MIN 18
|
---|
| 22 | #define VS10_MOV 19
|
---|
| 23 | #define VS10_MUL 20
|
---|
| 24 | #define VS10_NOP 21
|
---|
| 25 | #define VS10_RCP 22
|
---|
| 26 | #define VS10_RSQ 23
|
---|
| 27 | #define VS10_SGE 24
|
---|
| 28 | #define VS10_SLT 25
|
---|
| 29 | #define VS10_SUB 26
|
---|
| 30 | #define VS10_COMMENT 27
|
---|
| 31 | #define VS10_HEADER 28
|
---|
| 32 |
|
---|
| 33 | #define TYPE_TEMPORARY_REG 1
|
---|
| 34 | #define TYPE_VERTEX_ATTRIB_REG 2
|
---|
| 35 | #define TYPE_ADDRESS_REG 3
|
---|
| 36 | #define TYPE_CONSTANT_MEM_REG 4
|
---|
| 37 | #define TYPE_CONSTANT_A0_REG 5
|
---|
| 38 | #define TYPE_CONSTANT_A0_OFFSET_REG 6
|
---|
| 39 | #define TYPE_POSITION_RESULT_REG 7
|
---|
| 40 | #define TYPE_COLOR_RESULT_REG 8
|
---|
| 41 | #define TYPE_TEXTURE_RESULT_REG 9
|
---|
| 42 | #define TYPE_FOG_RESULT_REG 10
|
---|
| 43 | #define TYPE_POINTS_RESULT_REG 11
|
---|
| 44 |
|
---|
| 45 | class VS10Reg {
|
---|
| 46 | public:
|
---|
| 47 | // VS10Reg();
|
---|
| 48 | // VS10Reg(const VS10Reg &r);
|
---|
| 49 | // VS10Reg& operator=(const VS10Reg &r);
|
---|
| 50 | void Init();
|
---|
| 51 | void Translate();
|
---|
| 52 | int type;
|
---|
| 53 | int index;
|
---|
| 54 | int sign;
|
---|
| 55 | char mask[4];
|
---|
| 56 |
|
---|
| 57 | int ValidateIndex();
|
---|
| 58 | };
|
---|
| 59 |
|
---|
| 60 | typedef class VS10Inst {
|
---|
| 61 | public:
|
---|
| 62 | ~VS10Inst();
|
---|
| 63 | VS10Inst();
|
---|
| 64 | VS10Inst(int currline);
|
---|
| 65 | VS10Inst(const VS10Inst &inst);
|
---|
| 66 | VS10Inst& operator=(const VS10Inst &inst);
|
---|
| 67 | VS10Inst(int currline, int inst);
|
---|
| 68 | VS10Inst(int currline, int inst, char *cmt);
|
---|
| 69 | VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0);
|
---|
| 70 | VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1);
|
---|
| 71 | VS10Inst(int currline, int inst, VS10Reg dreg, VS10Reg src0, VS10Reg src1, VS10Reg src2);
|
---|
| 72 | void Validate( int &vsflag );
|
---|
| 73 | int Translate();
|
---|
| 74 | VS10Reg dst;
|
---|
| 75 | VS10Reg src[3];
|
---|
| 76 | private:
|
---|
| 77 | int line;
|
---|
| 78 | int instid;
|
---|
| 79 | char *comment;
|
---|
| 80 | void ValidateRegIndices();
|
---|
| 81 | void ValidateDestMask();
|
---|
| 82 | void ValidateSrcMasks();
|
---|
| 83 | void ValidateDestWritable();
|
---|
| 84 | void ValidateSrcReadable();
|
---|
| 85 | void ValidateReadPorts();
|
---|
| 86 |
|
---|
| 87 | } *VS10InstPtr;
|
---|
| 88 |
|
---|
| 89 | #endif
|
---|