mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
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 <ian.d.romanick@intel.com> Signed-off-by: Olivier Galibert <galibert@pobox.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
c55ebc3e3e
commit
f72e9b2041
1 changed files with 9 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue