Mesa (master): glsl: Correctly validate fma()'s types.

Matt Turner mattst88 at kemper.freedesktop.org
Wed Sep 18 00:02:40 UTC 2013


Module: Mesa
Branch: master
Commit: a3b51a22f71819236baa6bbda9d0d050914b149d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a3b51a22f71819236baa6bbda9d0d050914b149d

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Sep  6 15:05:10 2013 -0700

glsl: Correctly validate fma()'s types.

lrp() can take a scalar as a third argument, and fma() cannot.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/glsl/ir_validate.cpp |    6 ++++++
 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);




More information about the mesa-commit mailing list