Signed-off-by: Topi Pohjolainen <topi.pohjolai...@intel.com> --- src/glsl/glsl_types.h | 2 +- src/glsl/ir_validate.cpp | 36 ++++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index d58718e..b90aa28 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -443,7 +443,7 @@ struct glsl_type { */ bool is_float() const { - return base_type == GLSL_TYPE_FLOAT; + return base_type == GLSL_TYPE_FLOAT || base_type == GLSL_TYPE_HALF; } /** diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index cfe0df3..0669d9f 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -262,24 +262,29 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_unop_f2i: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type->base_type == GLSL_TYPE_INT); break; case ir_unop_f2u: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type->base_type == GLSL_TYPE_UINT); break; case ir_unop_i2f: assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); - assert(ir->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type->base_type == GLSL_TYPE_HALF || + ir->type->base_type == GLSL_TYPE_FLOAT); break; case ir_unop_f2b: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->type->base_type == GLSL_TYPE_BOOL); break; case ir_unop_b2f: assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL); - assert(ir->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type->base_type == GLSL_TYPE_HALF || + ir->type->base_type == GLSL_TYPE_FLOAT); break; case ir_unop_i2b: assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); @@ -291,7 +296,8 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_unop_u2f: assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); - assert(ir->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->type->base_type == GLSL_TYPE_HALF || + ir->type->base_type == GLSL_TYPE_FLOAT); break; case ir_unop_i2u: assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); @@ -328,7 +334,8 @@ ir_validate::visit_leave(ir_expression *ir) case ir_unop_ceil: case ir_unop_floor: case ir_unop_fract: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); assert(ir->operands[0]->type == ir->type); break; @@ -340,7 +347,8 @@ ir_validate::visit_leave(ir_expression *ir) case ir_unop_dFdy: case ir_unop_dFdy_coarse: case ir_unop_dFdy_fine: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); assert(ir->operands[0]->type == ir->type); break; @@ -547,9 +555,11 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_binop_dot: - assert(ir->type == glsl_type::float_type || + assert(ir->type == glsl_type::hfloat_type || + ir->type == glsl_type::float_type || ir->type == glsl_type::double_type); - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); assert(ir->operands[0]->type->is_vector()); assert(ir->operands[0]->type == ir->operands[1]->type); @@ -602,7 +612,8 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_triop_fma: - assert(ir->type->base_type == GLSL_TYPE_FLOAT || + assert(ir->type->base_type == GLSL_TYPE_HALF || + ir->type->base_type == GLSL_TYPE_FLOAT || ir->type->base_type == GLSL_TYPE_DOUBLE); assert(ir->type == ir->operands[0]->type); assert(ir->type == ir->operands[1]->type); @@ -610,7 +621,8 @@ ir_validate::visit_leave(ir_expression *ir) break; case ir_triop_lrp: - assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || + assert(ir->operands[0]->type->base_type == GLSL_TYPE_HALF || + ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT || ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE); assert(ir->operands[0]->type == ir->operands[1]->type); assert(ir->operands[2]->type == ir->operands[0]->type || -- 1.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev