diff options
author | Brian <[email protected]> | 2006-12-13 14:54:47 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2006-12-13 14:54:47 -0700 |
commit | fe1d01cb398cbcb5b28a0b222845d3865c4d612b (patch) | |
tree | 92faedffbd069150e9cf4993506802962c640459 /src/mesa/shader/nvfragparse.c | |
parent | 8627bf14524a85cedc3d1794fce9f562fd12bf79 (diff) |
Checkpoint of work for new GLSL compiler back-end. Lots of assorted changes.
Diffstat (limited to 'src/mesa/shader/nvfragparse.c')
-rw-r--r-- | src/mesa/shader/nvfragparse.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 79e6dbd87b7..8405623333f 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1038,21 +1038,25 @@ Parse_VectorSrc(struct parse_state *parseState, else if (IsDigit(token[0]) || token[0] == '-' || token[0] == '+' || token[0] == '.'){ /* literal scalar constant */ GLfloat values[4]; - GLuint paramIndex; + GLuint paramIndex, swizzle; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, + values, 4, &swizzle); + ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } else if (token[0] == '{'){ /* literal vector constant */ GLfloat values[4]; - GLuint paramIndex; + GLuint paramIndex, swizzle; (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, + values, 4, &swizzle); + ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1138,11 +1142,13 @@ Parse_ScalarSrcReg(struct parse_state *parseState, else if (token[0] == '{') { /* vector literal */ GLfloat values[4]; - GLuint paramIndex; + GLuint paramIndex, swizzle; (void) Parse_String(parseState, "{"); if (!Parse_VectorConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, + values, 4, &swizzle); + ASSERT(swizzle == SWIZZLE_NOOP); srcReg->File = PROGRAM_NAMED_PARAM; srcReg->Index = paramIndex; } @@ -1163,10 +1169,12 @@ Parse_ScalarSrcReg(struct parse_state *parseState, else if (IsDigit(token[0])) { /* scalar literal */ GLfloat values[4]; - GLuint paramIndex; + GLuint paramIndex, swizzle; if (!Parse_ScalarConstant(parseState, values)) RETURN_ERROR; - paramIndex = _mesa_add_unnamed_constant(parseState->parameters, values, 4); + paramIndex = _mesa_add_unnamed_constant(parseState->parameters, + values, 4, &swizzle); + ASSERT(swizzle == SWIZZLE_NOOP); srcReg->Index = paramIndex; srcReg->File = PROGRAM_NAMED_PARAM; needSuffix = GL_FALSE; |