aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program/nvfragparse.c
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-05-17 17:13:20 -0500
committerBryan Cain <[email protected]>2011-08-01 17:59:07 -0500
commit6d89abadbcd68bbe9e08f041412549f8dc1fc73c (patch)
tree9876b1797693765c2cde010487011f7db6725020 /src/mesa/program/nvfragparse.c
parent17b695e6e7dd730497fb60a8e161935b23fa0e9c (diff)
mesa: support boolean and integer-based parameters in prog_parameter
The functionality is not used by anything yet, and the glUniform functions will need to be reworked before this can reach its full usefulness. It is nonetheless a step towards integer support in the state tracker and classic drivers.
Diffstat (limited to 'src/mesa/program/nvfragparse.c')
-rw-r--r--src/mesa/program/nvfragparse.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c
index 8516b5fc1ff..ce72c610d89 100644
--- a/src/mesa/program/nvfragparse.c
+++ b/src/mesa/program/nvfragparse.c
@@ -472,8 +472,9 @@ Parse_ScalarConstant(struct parse_state *parseState, GLfloat *number)
const GLfloat *constant;
if (!Parse_Identifier(parseState, ident))
RETURN_ERROR1("Expected an identifier");
- constant = _mesa_lookup_parameter_value(parseState->parameters,
- -1, (const char *) ident);
+ constant = (GLfloat *)_mesa_lookup_parameter_value(parseState->parameters,
+ -1,
+ (const char *) ident);
/* XXX Check that it's a constant and not a parameter */
if (!constant) {
RETURN_ERROR1("Undefined symbol");
@@ -1039,7 +1040,8 @@ Parse_VectorSrc(struct parse_state *parseState,
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
paramIndex = _mesa_add_unnamed_constant(parseState->parameters,
- values, 4, NULL);
+ (gl_constant_value *) values,
+ 4, NULL);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1051,7 +1053,8 @@ Parse_VectorSrc(struct parse_state *parseState,
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
paramIndex = _mesa_add_unnamed_constant(parseState->parameters,
- values, 4, NULL);
+ (gl_constant_value *) values,
+ 4, NULL);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1145,7 +1148,8 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
if (!Parse_VectorConstant(parseState, values))
RETURN_ERROR;
paramIndex = _mesa_add_unnamed_constant(parseState->parameters,
- values, 4, NULL);
+ (gl_constant_value *) values,
+ 4, NULL);
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
@@ -1170,7 +1174,8 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
if (!Parse_ScalarConstant(parseState, values))
RETURN_ERROR;
paramIndex = _mesa_add_unnamed_constant(parseState->parameters,
- values, 4, NULL);
+ (gl_constant_value *) values,
+ 4, NULL);
srcReg->Index = paramIndex;
srcReg->File = PROGRAM_NAMED_PARAM;
needSuffix = GL_FALSE;
@@ -1296,7 +1301,8 @@ Parse_InstructionSequence(struct parse_state *parseState,
RETURN_ERROR2(id, "already defined");
}
_mesa_add_named_parameter(parseState->parameters,
- (const char *) id, value);
+ (const char *) id,
+ (gl_constant_value *) value);
}
else if (Parse_String(parseState, "DECLARE")) {
GLubyte id[100];
@@ -1315,7 +1321,8 @@ Parse_InstructionSequence(struct parse_state *parseState,
RETURN_ERROR2(id, "already declared");
}
_mesa_add_named_parameter(parseState->parameters,
- (const char *) id, value);
+ (const char *) id,
+ (gl_constant_value *) value);
}
else if (Parse_String(parseState, "END")) {
inst->Opcode = OPCODE_END;