summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-12-08 18:21:18 -0700
committerBrian Paul <[email protected]>2010-12-08 18:21:20 -0700
commitc6d74bcbfcb54e0c03f4c3d7e82bc1267f36ffe4 (patch)
tree75a25fab098a769b15133b987de9168a6936fd9d /src
parent975418a654e72d8338a9cf288d2d1f9429c226ae (diff)
mesa: add PROGRAM_SYSTEM_VALUE and related tokens
System values are shader inputs which don't necessarily change from vertex to vertex or fragment to fragment. gl_InstanceID and gl_FrontFacing are examples.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/mtypes.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 80c20e09d9a..417f8df8e34 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1747,11 +1747,24 @@ typedef enum
PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */
PROGRAM_ADDRESS, /**< machine->AddressReg */
PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */
+ PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */
PROGRAM_UNDEFINED, /**< Invalid/TBD value */
PROGRAM_FILE_MAX
} gl_register_file;
+/**
+ * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be
+ * one of these values.
+ */
+typedef enum
+{
+ SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */
+ SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */
+ SYSTEM_VALUE_MAX /**< Number of values */
+} gl_system_value;
+
+
/** Vertex and fragment instructions */
struct prog_instruction;
struct gl_program_parameter_list;
@@ -1774,6 +1787,7 @@ struct gl_program
GLbitfield InputsRead; /**< Bitmask of which input regs are read */
GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
+ GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */
GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */
GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */
GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */