summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2013-09-06 15:05:10 -0700
committerMatt Turner <mattst88@gmail.com>2013-09-17 17:02:06 -0700
commita3b51a22f71819236baa6bbda9d0d050914b149d (patch)
treef6e54b19755aedb18f9e3e11a310805d07f35818 /src/glsl
parentd56bbd04415d439b8e04c8f27e911485813f01e4 (diff)
downloadexternal_mesa3d-a3b51a22f71819236baa6bbda9d0d050914b149d.zip
external_mesa3d-a3b51a22f71819236baa6bbda9d0d050914b149d.tar.gz
external_mesa3d-a3b51a22f71819236baa6bbda9d0d050914b149d.tar.bz2
glsl: Correctly validate fma()'s types.
lrp() can take a scalar as a third argument, and fma() cannot. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir_validate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 66a9800..2068de0 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -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);