diff options
author | Ian Romanick <[email protected]> | 2016-07-12 16:51:35 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-08-30 16:28:01 -0700 |
commit | fd2dabbb9fc2c7d349d0d913c9e115ac3ac3eac0 (patch) | |
tree | 4c5ea542791ab0c5c5b442878c1f0d1a61e936c9 /src | |
parent | 13ef8c46b8b8b90b74e2f9d1cc7b0483fa89c3c7 (diff) |
glsl: Sort GLSL type enums in switch-statements in enum order
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/ir_constant_expression.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
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; |