summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-12-12 13:18:30 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-12-12 13:18:30 -0700
commit87a00959ba40ee0aeaebbc8a86ca081cf3b81c75 (patch)
tree140c62c0db8e06df50e53e1e0de106fd0f4fe7b2
parent8571401d7d7c9c91c6f053e5dc8c94a4567140fe (diff)
mesa: array size fix in _slang_typeof_operation()
-rw-r--r--src/mesa/shader/slang/slang_typeinfo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c
index 3978df751d..bd135c1a11 100644
--- a/src/mesa/shader/slang/slang_typeinfo.c
+++ b/src/mesa/shader/slang/slang_typeinfo.c
@@ -600,7 +600,15 @@ _slang_typeof_operation(slang_operation * op,
return GL_FALSE;
}
ti->can_be_referenced = GL_TRUE;
- ti->array_len = var->array_len;
+ if (var->type.specifier.type == SLANG_SPEC_ARRAY &&
+ var->type.array_len >= 1) {
+ /* the datatype is an array, ex: float[3] x; */
+ ti->array_len = var->type.array_len;
+ }
+ else {
+ /* the variable is an array, ex: float x[3]; */
+ ti->array_len = var->array_len;
+ }
}
break;
case SLANG_OPER_SEQUENCE: