[Mesa-dev] [PATCH 10/51] glsl: Allow 16-bit math

Topi Pohjolainen topi.pohjolainen at gmail.com
Fri Nov 24 12:26:37 UTC 2017


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/compiler/glsl/ir_validate.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
index 735e862141..d246af866d 100644
--- a/src/compiler/glsl/ir_validate.cpp
+++ b/src/compiler/glsl/ir_validate.cpp
@@ -272,7 +272,8 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_unop_rsq:
    case ir_unop_sqrt:
       assert(ir->type->is_float() ||
-             ir->type->is_double());
+             ir->type->is_double() ||
+             ir->type->base_type == GLSL_TYPE_FLOAT16);
       assert(ir->type == ir->operands[0]->type);
       break;
 
@@ -281,7 +282,9 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_unop_exp2:
    case ir_unop_log2:
    case ir_unop_saturate:
-      assert(ir->operands[0]->type->is_float());
+      assert(ir->operands[0]->type->is_float() ||
+             (ir->operands[0]->type->get_scalar_type()->base_type ==
+              GLSL_TYPE_FLOAT16));
       assert(ir->type == ir->operands[0]->type);
       break;
 
-- 
2.11.0



More information about the mesa-dev mailing list