Mesa (master): glsl: Implement type inferencing of matrix types.

Matt Turner mattst88 at kemper.freedesktop.org
Tue Mar 31 21:48:14 UTC 2015


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Mar 27 10:45:07 2015 -0700

glsl: Implement type inferencing of matrix types.

Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

---

 src/glsl/ir.cpp |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 54656f8..4b8ca9b 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -380,10 +380,12 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
       } else if (op1->type->is_scalar()) {
 	 this->type = op0->type;
       } else {
-	 /* FINISHME: matrix types */
-	 assert(!op0->type->is_matrix() && !op1->type->is_matrix());
-	 assert(op0->type == op1->type);
-	 this->type = op0->type;
+         if (this->operation == ir_binop_mul) {
+            this->type = glsl_type::get_mul_type(op0->type, op1->type);
+         } else {
+            assert(op0->type == op1->type);
+            this->type = op0->type;
+         }
       }
       break;
 




More information about the mesa-commit mailing list