glsl: Handle constant expressions involving ir_binop_equal/nequal.

Constant expressions which called GLSL's equal() and notEqual()
built-ins on bvecs would hit an assertion failure; we simply forgot to
implement them for booleans.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
Kenneth Graunke
2011-11-09 00:58:21 -08:00
parent 83d0514f1f
commit a17a78a212

View File

@@ -713,6 +713,9 @@ ir_expression::constant_expression_value()
case GLSL_TYPE_FLOAT:
data.b[c] = op[0]->value.f[c] == op[1]->value.f[c];
break;
case GLSL_TYPE_BOOL:
data.b[c] = op[0]->value.b[c] == op[1]->value.b[c];
break;
default:
assert(0);
}
@@ -731,6 +734,9 @@ ir_expression::constant_expression_value()
case GLSL_TYPE_FLOAT:
data.b[c] = op[0]->value.f[c] != op[1]->value.f[c];
break;
case GLSL_TYPE_BOOL:
data.b[c] = op[0]->value.b[c] != op[1]->value.b[c];
break;
default:
assert(0);
}