glsl: Make the tree rebalancer bail on matrix operands.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 15 Jul 2014 23:34:56 +0000 (16:34 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 16 Jul 2014 22:43:13 +0000 (15:43 -0700)
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>
src/glsl/opt_rebalance_tree.cpp

index daabdc9..7ef0d2d 100644 (file)
@@ -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;
    }