aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_constant_expression.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-05-08 12:04:45 -0700
committerKenneth Graunke <[email protected]>2012-05-08 12:28:44 -0700
commitf72e9b2041e294c8ac2258ff3f2b923c39cbef83 (patch)
tree2449054f36b35a67c12ee58ded6b2fc9656db554 /src/glsl/ir_constant_expression.cpp
parentc55ebc3e3e556a5bf5cd78cee2807f4cbb6f626a (diff)
glsl: Fix broken constant expression handling for <, <=, >, and >=.
We were looping over all the vector components, but only dealing with the first one. This was masked by the fact that constant expression handling on built-ins went through custom code for the lessThan() /function/ rather than the ir_binop_less expression operator. NOTE: This is a candidate for all release branches. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Olivier Galibert <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_constant_expression.cpp')
-rw-r--r--src/glsl/ir_constant_expression.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 4e1714a8420..e724e3a5dda 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -640,13 +640,13 @@ ir_expression::constant_expression_value()
for (unsigned c = 0; c < op[0]->type->components(); c++) {
switch (op[0]->type->base_type) {
case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
+ data.b[c] = op[0]->value.u[c] < op[1]->value.u[c];
break;
case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
+ data.b[c] = op[0]->value.i[c] < op[1]->value.i[c];
break;
case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
+ data.b[c] = op[0]->value.f[c] < op[1]->value.f[c];
break;
default:
assert(0);
@@ -676,13 +676,13 @@ ir_expression::constant_expression_value()
for (unsigned c = 0; c < op[0]->type->components(); c++) {
switch (op[0]->type->base_type) {
case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
+ data.b[c] = op[0]->value.u[c] <= op[1]->value.u[c];
break;
case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
+ data.b[c] = op[0]->value.i[c] <= op[1]->value.i[c];
break;
case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
+ data.b[c] = op[0]->value.f[c] <= op[1]->value.f[c];
break;
default:
assert(0);
@@ -694,13 +694,13 @@ ir_expression::constant_expression_value()
for (unsigned c = 0; c < op[0]->type->components(); c++) {
switch (op[0]->type->base_type) {
case GLSL_TYPE_UINT:
- data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
+ data.b[c] = op[0]->value.u[c] >= op[1]->value.u[c];
break;
case GLSL_TYPE_INT:
- data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
+ data.b[c] = op[0]->value.i[c] >= op[1]->value.i[c];
break;
case GLSL_TYPE_FLOAT:
- data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
+ data.b[c] = op[0]->value.f[c] >= op[1]->value.f[c];
break;
default:
assert(0);