scalar sources such as 'time.x' weren't accepted by parser
This commit is contained in:
@@ -1009,14 +1009,14 @@ Parse_VectorSrc(struct parse_state *parseState,
|
|||||||
srcReg->Index = idx;
|
srcReg->Index = idx;
|
||||||
}
|
}
|
||||||
else if (token[0] == 'f') {
|
else if (token[0] == 'f') {
|
||||||
/* XXX this might be an identier! */
|
/* XXX this might be an identifier! */
|
||||||
srcReg->File = PROGRAM_INPUT;
|
srcReg->File = PROGRAM_INPUT;
|
||||||
if (!Parse_FragReg(parseState, &idx))
|
if (!Parse_FragReg(parseState, &idx))
|
||||||
RETURN_ERROR;
|
RETURN_ERROR;
|
||||||
srcReg->Index = idx;
|
srcReg->Index = idx;
|
||||||
}
|
}
|
||||||
else if (token[0] == 'p') {
|
else if (token[0] == 'p') {
|
||||||
/* XXX this might be an identier! */
|
/* XXX this might be an identifier! */
|
||||||
srcReg->File = PROGRAM_LOCAL_PARAM;
|
srcReg->File = PROGRAM_LOCAL_PARAM;
|
||||||
if (!Parse_ProgramParamReg(parseState, &idx))
|
if (!Parse_ProgramParamReg(parseState, &idx))
|
||||||
RETURN_ERROR;
|
RETURN_ERROR;
|
||||||
@@ -1146,6 +1146,20 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
|
|||||||
srcReg->File = PROGRAM_NAMED_PARAM;
|
srcReg->File = PROGRAM_NAMED_PARAM;
|
||||||
srcReg->Index = paramIndex;
|
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])) {
|
else if (IsDigit(token[0])) {
|
||||||
/* scalar literal */
|
/* scalar literal */
|
||||||
GLfloat values[4];
|
GLfloat values[4];
|
||||||
|
Reference in New Issue
Block a user