glsl/linker: check for xfb_offset aliasing
[mesa.git] / src / compiler / glsl / opt_algebraic.cpp
index 1a8ee36165221b323da047680e75931190b0462a..ff4be269578c1f95152e36138594514131977b19 100644 (file)
@@ -709,6 +709,12 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
          if (!is_vec_zero(zero))
             continue;
 
+         /* We are allowed to add scalars with a vector or matrix. In that
+          * case lets just exit early.
+          */
+         if (add->operands[0]->type != add->operands[1]->type)
+            continue;
+
          /* Depending of the zero position we want to optimize
           * (0 cmp x+y) into (-x cmp y) or (x+y cmp 0) into (x cmp -y)
           */