summaryrefslogtreecommitdiff
path: root/src/mesa/shader/prog_instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/prog_instruction.h')
-rw-r--r--src/mesa/shader/prog_instruction.h80
1 files changed, 42 insertions, 38 deletions
diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h
index a8842c68c7..3808644550 100644
--- a/src/mesa/shader/prog_instruction.h
+++ b/src/mesa/shader/prog_instruction.h
@@ -145,6 +145,7 @@ typedef enum prog_opcode {
OPCODE_NOP = 0, /* X */
OPCODE_ABS, /* X X 1.1 X */
OPCODE_ADD, /* X X X X X */
+ OPCODE_AND, /* */
OPCODE_ARA, /* 2 */
OPCODE_ARL, /* X X */
OPCODE_ARL_NV, /* 2 */
@@ -159,6 +160,8 @@ typedef enum prog_opcode {
OPCODE_COS, /* X 2 X X */
OPCODE_DDX, /* X X */
OPCODE_DDY, /* X X */
+ OPCODE_DP2, /* 2 */
+ OPCODE_DP2A, /* 2 */
OPCODE_DP3, /* X X X X X */
OPCODE_DP4, /* X X X X X */
OPCODE_DPH, /* X X 1.1 */
@@ -173,7 +176,6 @@ typedef enum prog_opcode {
OPCODE_FLR, /* X X 2 X X */
OPCODE_FRC, /* X X 2 X X */
OPCODE_IF, /* opt */
- OPCODE_INT, /* X */
OPCODE_KIL, /* X */
OPCODE_KIL_NV, /* X X */
OPCODE_LG2, /* X X 2 X X */
@@ -189,6 +191,10 @@ typedef enum prog_opcode {
OPCODE_NOISE2, /* X */
OPCODE_NOISE3, /* X */
OPCODE_NOISE4, /* X */
+ OPCODE_NOT, /* */
+ OPCODE_NRM3, /* */
+ OPCODE_NRM4, /* */
+ OPCODE_OR, /* */
OPCODE_PK2H, /* X */
OPCODE_PK2US, /* X */
OPCODE_PK4B, /* X */
@@ -221,23 +227,34 @@ typedef enum prog_opcode {
OPCODE_TXL, /* 3 2 X */
OPCODE_TXP, /* X X */
OPCODE_TXP_NV, /* 3 X */
+ OPCODE_TRUNC, /* X */
OPCODE_UP2H, /* X */
OPCODE_UP2US, /* X */
OPCODE_UP4B, /* X */
OPCODE_UP4UB, /* X */
OPCODE_X2D, /* X */
+ OPCODE_XOR, /* */
OPCODE_XPD, /* X X X */
MAX_OPCODE
} gl_inst_opcode;
/**
+ * Number of bits for the src/dst register Index field.
+ * This limits the size of temp/uniform register files.
+ */
+#define INST_INDEX_BITS 10
+
+
+/**
* Instruction source register.
*/
struct prog_src_register
{
GLuint File:4; /**< One of the PROGRAM_* register file values. */
- GLint Index:9; /**< May be negative for relative addressing. */
+ GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
+ * May be negative for relative addressing.
+ */
GLuint Swizzle:12;
GLuint RelAddr:1;
@@ -281,7 +298,7 @@ struct prog_src_register
struct prog_dst_register
{
GLuint File:4; /**< One of the PROGRAM_* register file values */
- GLuint Index:8;
+ GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */
GLuint WriteMask:4;
GLuint RelAddr:1;
@@ -314,8 +331,7 @@ struct prog_dst_register
*/
GLuint CondSrc:1;
/*@}*/
-
- GLuint pad:30;
+ GLuint pad:28;
};
@@ -325,14 +341,6 @@ struct prog_dst_register
struct prog_instruction
{
gl_inst_opcode Opcode;
-#if FEATURE_MESA_program_debug
- GLshort StringPos;
-#endif
- /**
- * Arbitrary data. Used for the PRINT, CAL, and BRA instructions.
- */
- void *Data;
-
struct prog_src_register SrcReg[3];
struct prog_dst_register DstReg;
@@ -372,7 +380,7 @@ struct prog_instruction
GLuint SaturateMode:2;
/**
- * Per-instruction selectable precision.
+ * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
*
* \since
* NV_fragment_program, NV_fragment_program_option.
@@ -380,45 +388,41 @@ struct prog_instruction
GLuint Precision:3;
/**
- * \name Texture source controls.
- *
- * The texture source controls are only used with the \c TEX, \c TXD,
- * \c TXL, and \c TXP instructions.
- *
- * \since
- * ARB_fragment_program, NV_fragment_program, NV_vertex_program3.
+ * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions.
*/
/*@{*/
- /**
- * Source texture unit. OpenGL supports a maximum of 32 texture
- * units.
- */
+ /** Source texture unit. */
GLuint TexSrcUnit:5;
- /**
- * Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX.
- */
+ /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
GLuint TexSrcTarget:3;
+
+ /** True if tex instruction should do shadow comparison */
+ GLuint TexShadow:1;
/*@}*/
/**
* For BRA and CAL instructions, the location to jump to.
* For BGNLOOP, points to ENDLOOP (and vice-versa).
* For BRK, points to BGNLOOP (which points to ENDLOOP).
- * For IF, points to else or endif.
- * For ELSE, points to endif.
+ * For IF, points to ELSE or ENDIF.
+ * For ELSE, points to ENDIF.
*/
GLint BranchTarget;
-#if 0
- /**
- * For TEX instructions in shaders, the sampler to use for the
- * texture lookup.
- */
- GLint Sampler;
-#endif
-
+ /** for debugging purposes */
const char *Comment;
+
+ /** Arbitrary data. Used for OPCODE_PRINT and some drivers */
+ void *Data;
+
+ /** for driver use (try to remove someday) */
+ GLint Aux;
+
+ /* XXX obsolete - remove someday */
+#if FEATURE_MESA_program_debug
+ GLshort StringPos;
+#endif
};