summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-20 13:01:56 -0700
committerKenneth Graunke <[email protected]>2010-07-21 16:38:32 -0700
commit46d6b8d1ba09d9d6844ce99a30416283004f77c6 (patch)
tree5e6d093c94f4e11ef02c92ff7a2f2aa56acf2720 /src/glsl/ir_constant_expression.cpp
parent3163f87463e6d0123c4f95bd76a658cb1e5d0843 (diff)
ir_constant_expression: Add support for ir_unop_u2f.
Also make ir_unop_i2f only operate on signed integers.
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r--src/glsl/ir_constant_expression.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index b0333dbebb7..acfbb864597 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -87,13 +87,15 @@ ir_expression::constant_expression_value()
}
break;
case ir_unop_i2f:
- assert(op[0]->type->base_type == GLSL_TYPE_UINT ||
- op[0]->type->base_type == GLSL_TYPE_INT);
+ assert(op[0]->type->base_type == GLSL_TYPE_INT);
for (unsigned c = 0; c < op[0]->type->components(); c++) {
- if (op[0]->type->base_type == GLSL_TYPE_INT)
- data.f[c] = op[0]->value.i[c];
- else
- data.f[c] = op[0]->value.u[c];
+ data.f[c] = op[0]->value.i[c];
+ }
+ break;
+ case ir_unop_u2f:
+ assert(op[0]->type->base_type == GLSL_TYPE_UINT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.f[c] = op[0]->value.u[c];
}
break;
case ir_unop_b2f: