[Mesa-dev] [PATCH] Obvious fixes in relational operator constant expression evaluation.
Ian Romanick
idr at freedesktop.org
Tue May 8 08:45:21 PDT 2012
On 05/08/2012 01:55 AM, Olivier Galibert wrote:
Holy crap sandwich. I guess I'm not sure how we didn't catch this
before. Since this only happens when both sides of the relational
operation are constant, I guess it's not that common. Ugh.
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
> index baf23b6..61c0ae6 100644
> --- a/src/glsl/ir_constant_expression.cpp
> +++ b/src/glsl/ir_constant_expression.cpp
> @@ -641,13 +641,13 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
> 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);
> @@ -677,13 +677,13 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
> 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);
> @@ -695,13 +695,13 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
> 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);
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list