summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/nvfragparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/nvfragparse.c')
-rw-r--r--src/mesa/shader/nvfragparse.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 79e6dbd87b7..b4e19ce74de 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -39,13 +39,11 @@
#include "glheader.h"
#include "context.h"
-#include "hash.h"
#include "imports.h"
#include "macros.h"
-#include "mtypes.h"
-#include "program_instruction.h"
+#include "prog_parameter.h"
+#include "prog_instruction.h"
#include "nvfragparse.h"
-#include "nvprogram.h"
#include "program.h"
@@ -1038,21 +1036,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 +1140,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 +1167,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;
@@ -1557,7 +1563,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
program->Base.InputsRead = parseState.inputsRead;
program->Base.OutputsWritten = parseState.outputsWritten;
for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++)
- program->TexturesUsed[u] = parseState.texturesUsed[u];
+ program->Base.TexturesUsed[u] = parseState.texturesUsed[u];
/* save program parameters */
program->Base.Parameters = parseState.parameters;