summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-02-05 15:07:26 -0800
committerPaul Berry <[email protected]>2013-02-12 08:06:35 -0800
commitf8426eea35e2e08797cdd29fc295720514081988 (patch)
tree7bb3796701db60ba7f6aabee5e0deca2982ffb4d /src/glsl/glsl_parser_extras.h
parent9870459522c50d7890ce114b03fe78020edd5d2a (diff)
glsl: Fix unsupported version error for GLSL ES 3.00, future proof for 3.30.
When the user specifies an unsupported GLSL version, _mesa_glsl_parse_state::process_version_directive() nicely gives them an error message telling them which GLSL versions are supported. Previous to this patch, the logic for determining whether a given language version was supported was independent from the logic to generate this error message string; as a result, we had a bug where GLSL 3.00 would never be listed in the error message as an available language version, even if it was really available. To make matters worse, the code for generating the error message string assumed that desktop GL versions were always separated by 0.10, an assumption that will be wrong as soon as we support GLSL 3.30. This patch fixes both problems by adding a table of supported GLSL versions to _mesa_glsl_parse_state; this table is used both to generate the error message and to check whether a given version is supported. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r--src/glsl/glsl_parser_extras.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 53df149d871..3ebc27e1a0d 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -148,6 +148,12 @@ struct _mesa_glsl_parse_state {
unsigned uniform_block_array_size;
struct gl_uniform_block *uniform_blocks;
+ unsigned num_supported_versions;
+ struct {
+ unsigned ver;
+ bool es;
+ } supported_versions[12];
+
bool es_shader;
unsigned language_version;
enum _mesa_glsl_parser_targets target;