aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/glsl_parser_extras.h')
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h
index dd932951f..ee8f71b82 100644
--- a/mesalib/src/glsl/glsl_parser_extras.h
+++ b/mesalib/src/glsl/glsl_parser_extras.h
@@ -42,6 +42,20 @@ 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;
+
+ /** Table of constant values already used in case labels */
+ struct hash_table *labels_ht;
+ class ast_case_label *previous_default;
+
+ 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 +164,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;