summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-11-19 13:12:13 +0200
committerTapani Pälli <[email protected]>2015-11-25 11:25:57 +0200
commit315c4c315e311674c840069174244eef97c92705 (patch)
tree7ae590c0e057dd57916b266cb64338d199d66ca8 /src
parent63c344d179a8bbfd56c5c08f576be728bfb3d6b0 (diff)
glsl: handle case where index is array deref in optimize_split_arrays
Previously pass did not traverse to those array dereferences which were used as indices to arrays. This fixes Synmark2 Gl42CSCloth application issues. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/opt_array_splitting.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/opt_array_splitting.cpp b/src/glsl/opt_array_splitting.cpp
index 9e73f3c44bb..89ce76bed2b 100644
--- a/src/glsl/opt_array_splitting.cpp
+++ b/src/glsl/opt_array_splitting.cpp
@@ -188,6 +188,10 @@ ir_array_reference_visitor::visit_enter(ir_dereference_array *ir)
if (entry && !ir->array_index->as_constant())
entry->split = false;
+ /* If the index is also array dereference, visit index. */
+ if (ir->array_index->as_dereference_array())
+ visit_enter(ir->array_index->as_dereference_array());
+
return visit_continue_with_parent;
}