diff options
author | Eric Anholt <[email protected]> | 2012-05-14 08:45:59 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-05-17 10:05:24 -0700 |
commit | bbbc7c7d566905920967f56648fc26abcb37f4a1 (patch) | |
tree | 2f2fac9b059c3dfa5ca86fd428ebc2a96221cdef /src | |
parent | 5d6ea16dfe99e1aba61c25a897b66951faab1a39 (diff) |
glsl: Reject non-scalar switch expressions.
The comment quotes spec saying that only scalar integers are allowed,
but we only checked for integer.
Fixes piglit switch-expression-const-ivec2.vert
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 513908a0dbd..c59e5e6f37f 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -3521,11 +3521,9 @@ ast_switch_statement::hir(exec_list *instructions, * * "The type of init-expression in a switch statement must be a * scalar integer." - * - * The checks are separated so that higher quality diagnostics can be - * generated for cases where the rule is violated. */ - if (!test_expression->type->is_integer()) { + if (!test_expression->type->is_scalar() || + !test_expression->type->is_integer()) { YYLTYPE loc = this->test_expression->get_location(); _mesa_glsl_error(& loc, |