From: Ian Romanick Date: Tue, 12 Jul 2016 23:51:35 +0000 (-0700) Subject: glsl: Sort GLSL type enums in switch-statements in enum order X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd2dabbb9fc2c7d349d0d913c9e115ac3ac3eac0;p=mesa.git glsl: Sort GLSL type enums in switch-statements in enum order Signed-off-by: Ian Romanick Reviewed-by: Matt Turner --- diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp index 0dafb0cba78..6a4a2746b39 100644 --- a/src/compiler/glsl/ir_constant_expression.cpp +++ b/src/compiler/glsl/ir_constant_expression.cpp @@ -657,14 +657,14 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) switch (this->operation) { case ir_unop_bit_not: switch (op[0]->type->base_type) { - case GLSL_TYPE_INT: - for (unsigned c = 0; c < components; c++) - data.i[c] = ~ op[0]->value.i[c]; - break; case GLSL_TYPE_UINT: for (unsigned c = 0; c < components; c++) data.u[c] = ~ op[0]->value.u[c]; break; + case GLSL_TYPE_INT: + for (unsigned c = 0; c < components; c++) + data.i[c] = ~ op[0]->value.i[c]; + break; default: assert(0); } @@ -1423,12 +1423,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) 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; case GLSL_TYPE_DOUBLE: data.b[c] = op[0]->value.d[c] == op[1]->value.d[c]; break; + case GLSL_TYPE_BOOL: + data.b[c] = op[0]->value.b[c] == op[1]->value.b[c]; + break; default: assert(0); } @@ -1447,12 +1447,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) 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; case GLSL_TYPE_DOUBLE: data.b[c] = op[0]->value.d[c] != op[1]->value.d[c]; break; + case GLSL_TYPE_BOOL: + data.b[c] = op[0]->value.b[c] != op[1]->value.b[c]; + break; default: assert(0); } @@ -1519,12 +1519,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) c0 += c0_inc, c1 += c1_inc, c++) { switch (op[0]->type->base_type) { - case GLSL_TYPE_INT: - data.i[c] = op[0]->value.i[c0] & op[1]->value.i[c1]; - break; case GLSL_TYPE_UINT: data.u[c] = op[0]->value.u[c0] & op[1]->value.u[c1]; break; + case GLSL_TYPE_INT: + data.i[c] = op[0]->value.i[c0] & op[1]->value.i[c1]; + break; default: assert(0); } @@ -1537,12 +1537,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) c0 += c0_inc, c1 += c1_inc, c++) { switch (op[0]->type->base_type) { - case GLSL_TYPE_INT: - data.i[c] = op[0]->value.i[c0] | op[1]->value.i[c1]; - break; case GLSL_TYPE_UINT: data.u[c] = op[0]->value.u[c0] | op[1]->value.u[c1]; break; + case GLSL_TYPE_INT: + data.i[c] = op[0]->value.i[c0] | op[1]->value.i[c1]; + break; default: assert(0); } @@ -1581,12 +1581,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) c0 += c0_inc, c1 += c1_inc, c++) { switch (op[0]->type->base_type) { - case GLSL_TYPE_INT: - data.i[c] = op[0]->value.i[c0] ^ op[1]->value.i[c1]; - break; case GLSL_TYPE_UINT: data.u[c] = op[0]->value.u[c0] ^ op[1]->value.u[c1]; break; + case GLSL_TYPE_INT: + data.i[c] = op[0]->value.i[c0] ^ op[1]->value.i[c1]; + break; default: assert(0); } @@ -1742,21 +1742,21 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) memcpy(&data, &op[0]->value, sizeof(data)); switch (this->type->base_type) { - case GLSL_TYPE_INT: - data.i[idx] = op[1]->value.i[0]; - break; case GLSL_TYPE_UINT: data.u[idx] = op[1]->value.u[0]; break; + case GLSL_TYPE_INT: + data.i[idx] = op[1]->value.i[0]; + break; case GLSL_TYPE_FLOAT: data.f[idx] = op[1]->value.f[0]; break; - case GLSL_TYPE_BOOL: - data.b[idx] = op[1]->value.b[0]; - break; case GLSL_TYPE_DOUBLE: data.d[idx] = op[1]->value.d[0]; break; + case GLSL_TYPE_BOOL: + data.b[idx] = op[1]->value.b[0]; + break; default: assert(!"Should not get here."); break; @@ -1772,12 +1772,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) case ir_quadop_vector: for (unsigned c = 0; c < this->type->vector_elements; c++) { switch (this->type->base_type) { - case GLSL_TYPE_INT: - data.i[c] = op[c]->value.i[0]; - break; case GLSL_TYPE_UINT: data.u[c] = op[c]->value.u[0]; break; + case GLSL_TYPE_INT: + data.i[c] = op[c]->value.i[0]; + break; case GLSL_TYPE_FLOAT: data.f[c] = op[c]->value.f[0]; break;