summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-07-15 16:34:56 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-07-16 15:43:13 -0700
commit9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f (patch)
tree6bf19d582464b2227ad82e36b5078f220f6fa018 /src
parent99f8ea295fe370fe0572ca29ad8bf48108cb722b (diff)
downloadexternal_mesa3d-9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f.zip
external_mesa3d-9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f.tar.gz
external_mesa3d-9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f.tar.bz2
glsl: Make the tree rebalancer bail on matrix operands.
It doesn't handle things like (vector * matrix) correctly, and apparently Matt's intention was to bail. Fixes shader compilation in Natural Selection 2. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/opt_rebalance_tree.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/opt_rebalance_tree.cpp b/src/glsl/opt_rebalance_tree.cpp
index daabdc9..7ef0d2d 100644
--- a/src/glsl/opt_rebalance_tree.cpp
+++ b/src/glsl/opt_rebalance_tree.cpp
@@ -217,7 +217,9 @@ is_reduction(ir_instruction *ir, void *data)
* constant fold once split up. Handling matrices will need some more
* work.
*/
- if (expr->type->is_matrix()) {
+ if (expr->type->is_matrix() ||
+ expr->operands[0]->type->is_matrix() ||
+ (expr->operands[1] && expr->operands[1]->type->is_matrix())) {
ird->is_reduction = false;
return;
}