Mesa (master): glsl: handle case where index is array deref in optimize_split_arrays
Tapani Pälli
tpalli at kemper.freedesktop.org
Wed Nov 25 10:06:29 UTC 2015
Module: Mesa
Branch: master
Commit: 315c4c315e311674c840069174244eef97c92705
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=315c4c315e311674c840069174244eef97c92705
Author: Tapani Pälli <tapani.palli at intel.com>
Date: Thu Nov 19 13:12:13 2015 +0200
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 <tapani.palli at intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/glsl/opt_array_splitting.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/glsl/opt_array_splitting.cpp b/src/glsl/opt_array_splitting.cpp
index 9e73f3c..89ce76b 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;
}
More information about the mesa-commit
mailing list