Checkpoint of work for new GLSL compiler back-end. Lots of assorted changes.
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index af06c03..a3f50b9 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -128,8 +128,8 @@
* A string such as "state.light[0].ambient" gets translated into a
* sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
*/
-enum state_index {
- STATE_MATERIAL,
+typedef enum gl_state_index_ {
+ STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */
STATE_LIGHT,
STATE_LIGHTMODEL_AMBIENT,
@@ -191,7 +191,7 @@
STATE_TEXRECT_SCALE,
STATE_POSITION_NORMALIZED, /* normalized light position */
STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */
-};
+} gl_state_index;
@@ -205,7 +205,10 @@
{
const char *Name; /**< Null-terminated string */
enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
- enum state_index StateIndexes[6]; /**< Global state reference */
+ /**
+ * A sequence of STATE_* tokens and integers to identify GL state.
+ */
+ gl_state_index StateIndexes[6];
};
@@ -244,7 +247,16 @@
extern GLint
_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
- const GLfloat values[4], GLuint size);
+ const GLfloat values[4], GLuint size,
+ GLuint *swizzleOut);
+
+extern GLint
+_mesa_add_uniform(struct gl_program_parameter_list *paramList,
+ const char *name, GLuint size);
+
+extern GLint
+_mesa_add_varying(struct gl_program_parameter_list *paramList,
+ const char *name, GLuint size);
extern GLint
_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
@@ -261,7 +273,7 @@
extern GLboolean
_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList,
const GLfloat v[], GLsizei vSize,
- GLuint *posOut, GLuint *swizzleOut);
+ GLint *posOut, GLuint *swizzleOut);
extern void
_mesa_load_state_parameters(GLcontext *ctx,