summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-01-30 08:50:14 -0800
committerEric Anholt <[email protected]>2012-02-03 11:07:02 +0100
commit140632190cf41e6a035ca199b181091d4ed46986 (patch)
treecad868b8ac2a3ce141bcea415e057d28ce120777 /src/glsl/glsl_parser_extras.h
parent01a5a2c9d761d4c9d72c236084efee700dcb28b8 (diff)
glsl: Throw an error when faced with a duplicated switch() case label.
The error message I chose matches gcc's error. Fixes piglit switch-case-duplicated.vert. 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 35d1e3aee26..d5d5101a820 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -48,6 +48,10 @@ struct glsl_switch_state {
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;
+
bool is_switch_innermost; // if switch stmt is closest to break, ...
};