glsl: Correctly validate fma()'s types.
authorMatt Turner <mattst88@gmail.com>
Fri, 6 Sep 2013 22:05:10 +0000 (15:05 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 18 Sep 2013 00:02:06 +0000 (17:02 -0700)
lrp() can take a scalar as a third argument, and fma() cannot.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_validate.cpp

index 66a9800ce75156afe88e1ed7f311e85e01783560..2068de06a3b4c310cb355a6637a99ba82d72e433 100644 (file)
@@ -531,6 +531,12 @@ ir_validate::visit_leave(ir_expression *ir)
       break;
 
    case ir_triop_fma:
+      assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+      assert(ir->type == ir->operands[0]->type);
+      assert(ir->type == ir->operands[1]->type);
+      assert(ir->type == ir->operands[2]->type);
+      break;
+
    case ir_triop_lrp:
       assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
       assert(ir->operands[0]->type == ir->operands[1]->type);