OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e31f96
)
glsl: Add support for ir_unop_f2u to constant folding.
author
Paul Berry
<stereotype441@gmail.com>
Wed, 13 Jun 2012 22:48:56 +0000
(15:48 -0700)
committer
Paul Berry
<stereotype441@gmail.com>
Fri, 15 Jun 2012 15:58:55 +0000
(08:58 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_constant_expression.cpp
b/src/glsl/ir_constant_expression.cpp
index
38a1ed9
..
17b54b9
100644
(file)
--- a/
src/glsl/ir_constant_expression.cpp
+++ b/
src/glsl/ir_constant_expression.cpp
@@
-182,6
+182,12
@@
ir_expression::constant_expression_value(struct hash_table *variable_context)
data.i[c] = (int) op[0]->value.f[c];
}
break;
+ case ir_unop_f2u:
+ assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
+ for (unsigned c = 0; c < op[0]->type->components(); c++) {
+ data.i[c] = (unsigned) op[0]->value.f[c];
+ }
+ break;
case ir_unop_i2f:
assert(op[0]->type->base_type == GLSL_TYPE_INT);
for (unsigned c = 0; c < op[0]->type->components(); c++) {