From f8426eea35e2e08797cdd29fc295720514081988 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Tue, 5 Feb 2013 15:07:26 -0800 Subject: 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 --- src/glsl/glsl_parser_extras.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/glsl_parser_extras.h') 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; -- cgit v1.2.3