summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/ir.cpp2
-rw-r--r--src/glsl/ir.h1
-rw-r--r--src/glsl/ir_validate.cpp4
3 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index f81bfd1ab8a..1c9eec6e2d1 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -299,6 +299,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
break;
case ir_unop_i2u:
+ case ir_unop_f2u:
case ir_unop_bitcast_f2u:
this->type = glsl_type::get_instance(GLSL_TYPE_UINT,
op0->type->vector_elements, 1);
@@ -428,6 +429,7 @@ static const char *const operator_strs[] = {
"exp2",
"log2",
"f2i",
+ "f2u",
"i2f",
"f2b",
"b2f",
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 55535b2f5ce..014f3630d77 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -896,6 +896,7 @@ enum ir_expression_operation {
ir_unop_exp2,
ir_unop_log2,
ir_unop_f2i, /**< Float-to-integer conversion. */
+ ir_unop_f2u, /**< Float-to-unsigned conversion. */
ir_unop_i2f, /**< Integer-to-float conversion. */
ir_unop_f2b, /**< Float-to-boolean conversion */
ir_unop_b2f, /**< Boolean-to-float conversion */
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 5721717a5ac..191d3983109 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -256,6 +256,10 @@ ir_validate::visit_leave(ir_expression *ir)
assert(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->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);