summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisf@ijw.co.nz>2015-03-01 22:05:46 +1300
committerKenneth Graunke <kenneth@whitecape.org>2015-11-04 10:18:56 -0800
commit9708ddb921b7202be13b6d1fe71d62882f962757 (patch)
treeae344daaf1ea2e628bab40a0736e53e2983fd98c
parenta77e15d322ec3ebfe6d7f2bad89b3f5fdfc09d9b (diff)
glsl: adjust find-innermost-index to see through swizzles
This is only used for TCS output assignment validation. Previously, we'd produce an error for assignments like: # TCS out vec4 a[]; a[gl_InvocationID].x = ...
-rw-r--r--src/glsl/ast_to_hir.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 030653079d..745c0b2662 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -707,7 +707,9 @@ find_innermost_array_index(ir_rvalue *rv)
{
ir_dereference_array *last = NULL;
while (rv) {
- if (rv->as_dereference_array()) {
+ if (rv->as_swizzle()) {
+ rv = rv->as_swizzle()->val;
+ } else if (rv->as_dereference_array()) {
last = rv->as_dereference_array();
rv = last->array;
} else if (rv->as_dereference_record())