glsl: handle case where index is array deref in optimize_split_arrays
authorTapani Pälli <tapani.palli@intel.com>
Thu, 19 Nov 2015 11:12:13 +0000 (13:12 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 25 Nov 2015 09:25:57 +0000 (11:25 +0200)
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 <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
src/glsl/opt_array_splitting.cpp

index 9e73f3c44bbfa1f57a7bf8f2e83a65e54bf3b2d5..89ce76bed2bf362156231ffca03e98c5c79a17de 100644 (file)
@@ -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;
 }