diff options
author | Eric Anholt <[email protected]> | 2012-01-28 11:26:02 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-02-03 11:06:50 +0100 |
commit | 22d81f154fed9e004cca91807808ae3b81b01ced (patch) | |
tree | ee39e66020ecb289915ca90489bc9f621275b0e7 /src/glsl/glsl_parser_extras.h | |
parent | b8c9252570d126e06607cd28b14f0fe3a2ffe4cf (diff) |
glsl: Save and restore the whole switch state for nesting.
This stuffs them all in a struct for sanity. Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index dd932951f4e..35d1e3aee26 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -42,6 +42,15 @@ enum _mesa_glsl_parser_targets { struct gl_context; +struct glsl_switch_state { + /** Temporary variables needed for switch statement. */ + ir_variable *test_var; + ir_variable *is_fallthru_var; + ir_variable *is_break_var; + class ast_switch_statement *switch_nesting_ast; + bool is_switch_innermost; // if switch stmt is closest to break, ... +}; + struct _mesa_glsl_parse_state { _mesa_glsl_parse_state(struct gl_context *ctx, GLenum target, void *mem_ctx); @@ -150,13 +159,8 @@ struct _mesa_glsl_parse_state { /** Loop or switch statement containing the current instructions. */ class ast_iteration_statement *loop_nesting_ast; - class ast_switch_statement *switch_nesting_ast; - bool is_switch_innermost; // if switch stmt is closest to break, ... - /** Temporary variables needed for switch statement. */ - ir_variable *test_var; - ir_variable *is_fallthru_var; - ir_variable *is_break_var; + struct glsl_switch_state switch_state; /** List of structures defined in user code. */ const glsl_type **user_structures; |