diff options
author | Brian Paul <[email protected]> | 2009-12-11 09:22:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-11 09:22:00 -0700 |
commit | b605f4ff11c894500f2d0273c5d4653ff413448d (patch) | |
tree | 144a2202677b29020bfb0477d145a985cae3c29f /src/mesa/shader | |
parent | da3bc492d2438ac915e720c17b54d0d12ffd8a97 (diff) | |
parent | 5076a4f53a2f34cc9116b45951037f639885c7a1 (diff) |
Merge branch 'mesa_7_6_branch' into mesa_7_7_branch
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/nvfragparse.c | 8 | ||||
-rw-r--r-- | src/mesa/shader/prog_parameter.c | 2 | ||||
-rw-r--r-- | src/mesa/shader/program.c | 14 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.h | 1 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_simplify.c | 9 |
5 files changed, 24 insertions, 10 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0fd55524abf..b739a6aa07c 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 2f029b02e50..f22492e029e 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 532adf4d360..6b8d94e6614 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -806,9 +806,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index 58f1edeed85..1f15c198963 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index b8a21f642cb..13b9ca3c877 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[16]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; |