diff options
author | Tapani Pälli <[email protected]> | 2014-07-14 09:45:46 +0300 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2014-07-17 07:39:12 +0300 |
commit | 48deb4dbf278c03ea49aeaa7f9d9eda231def817 (patch) | |
tree | 90e159a25940475d0510c5eec6be435c51273dfd /src/glsl/glsl_parser_extras.h | |
parent | 9e47ed2f77d8c274104cdcbc6b7c0c7334c50fdb (diff) |
glsl: handle a switch where default is in the middle of cases
This fixes following tests in es3conform:
shaders.switch.default_not_last_dynamic_vertex
shaders.switch.default_not_last_dynamic_fragment
and makes following tests in Piglit pass:
glsl-1.30/execution/switch/fs-default-notlast-fallthrough
glsl-1.30/execution/switch/fs-default_notlast
No Piglit regressions.
v2: take away unnecessary ir_if, just use conditional assignment
v3: use foreach_in_list instead of foreach_list
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]> (v2)
Reviewed-by: Ian Romanick <[email protected]> (v3)
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 17918163e31..6df41d442de 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -43,6 +43,9 @@ struct glsl_switch_state { ir_variable *is_break_var; class ast_switch_statement *switch_nesting_ast; + /** Used to set condition if 'default' label should be chosen. */ + ir_variable *run_default; + /** Table of constant values already used in case labels */ struct hash_table *labels_ht; class ast_case_label *previous_default; |