summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-08-24 23:08:01 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-08-24 23:08:01 +0000
commite6940f0a33a571b199bab60b680c30b718c47445 (patch)
tree4f89ce5857abcb6052f73e07d6d53a99c696bd38 /src
parentc6511ab950e2865e606ff13ce87f0ffc782c57ad (diff)
downloadexternal_mesa3d-e6940f0a33a571b199bab60b680c30b718c47445.zip
external_mesa3d-e6940f0a33a571b199bab60b680c30b718c47445.tar.gz
external_mesa3d-e6940f0a33a571b199bab60b680c30b718c47445.tar.bz2
scalar sources such as 'time.x' weren't accepted by parser
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/nvfragparse.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 364c706..1361041 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -1009,14 +1009,14 @@ Parse_VectorSrc(struct parse_state *parseState,
srcReg->Index = idx;
}
else if (token[0] == 'f') {
- /* XXX this might be an identier! */
+ /* XXX this might be an identifier! */
srcReg->File = PROGRAM_INPUT;
if (!Parse_FragReg(parseState, &idx))
RETURN_ERROR;
srcReg->Index = idx;
}
else if (token[0] == 'p') {
- /* XXX this might be an identier! */
+ /* XXX this might be an identifier! */
srcReg->File = PROGRAM_LOCAL_PARAM;
if (!Parse_ProgramParamReg(parseState, &idx))
RETURN_ERROR;
@@ -1146,6 +1146,20 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
srcReg->File = PROGRAM_NAMED_PARAM;
srcReg->Index = paramIndex;
}
+ else if (IsLetter(token[0])){
+ /* named param/constant */
+ GLubyte ident[100];
+ GLint paramIndex;
+ if (!Parse_Identifier(parseState, ident))
+ RETURN_ERROR;
+ paramIndex = _mesa_lookup_parameter_index(parseState->parameters,
+ -1, (const char *) ident);
+ if (paramIndex < 0) {
+ RETURN_ERROR2("Undefined constant or parameter: ", ident);
+ }
+ srcReg->File = PROGRAM_NAMED_PARAM;
+ srcReg->Index = paramIndex;
+ }
else if (IsDigit(token[0])) {
/* scalar literal */
GLfloat values[4];