summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-07-09 08:05:56 -0600
committerBrian Paul <brianp@vmware.com>2009-07-09 08:05:56 -0600
commit8987410ab6575048a7f7cbf27bb047d76ae46514 (patch)
treef2d8d72014f8fceaea7eb38d0b204fec16f5dcde /src/mesa/shader
parent7ccb00b1acacb57cefca1ae789246983ef4831d9 (diff)
parent78af70be3727945d2d81a07b99d5a794f1114c05 (diff)
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/slang_builtin.c11
-rw-r--r--src/mesa/shader/slang/slang_codegen.c5
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c
index 154609c26e..289d94644f 100644
--- a/src/mesa/shader/slang/slang_builtin.c
+++ b/src/mesa/shader/slang/slang_builtin.c
@@ -111,10 +111,9 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field,
if (isMatrix) {
if (tokens[0] == STATE_TEXTURE_MATRIX) {
- if (index1 >= 0) {
- tokens[1] = index1; /* which texture matrix */
- index1 = 0; /* prevent extra addition at end of function */
- }
+ /* texture_matrix[index1][index2] */
+ tokens[1] = index1 >= 0 ? index1 : 0; /* which texture matrix */
+ index1 = index2; /* move matrix row value to index1 */
}
if (index1 < 0) {
/* index1 is unused: prevent extra addition at end of function */
@@ -682,7 +681,9 @@ _slang_alloc_statevar(slang_ir_node *n,
if (n->Opcode == IR_ELEMENT) {
/* XXX can only handle constant indexes for now */
if (n->Children[1]->Opcode == IR_FLOAT) {
- index2 = (GLint) n->Children[1]->Value[0];
+ /* two-dimensional array index: mat[i][j] */
+ index2 = index1;
+ index1 = (GLint) n->Children[1]->Value[0];
}
else {
*direct = GL_FALSE;
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 24e9952386..2b7e781f98 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -1417,8 +1417,9 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun,
}
else if (p->type.qualifier == SLANG_QUAL_CONST) {
/* a constant input param */
- if (args[i].type == SLANG_OPER_IDENTIFIER ||
- args[i].type == SLANG_OPER_LITERAL_FLOAT) {
+ if (args[i].type == SLANG_OPER_IDENTIFIER ||
+ args[i].type == SLANG_OPER_LITERAL_FLOAT ||
+ args[i].type == SLANG_OPER_SUBSCRIPT) {
/* replace all occurances of this parameter variable with the
* actual argument variable or a literal.
*/