[Mesa-dev] [PATCH] main, glsl: Bump max known desktop glsl version to 4.50
Matt Turner
mattst88 at gmail.com
Mon Nov 24 16:14:42 PST 2014
On Mon, Nov 24, 2014 at 3:06 PM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
> src/glsl/glsl_parser_extras.cpp | 10 +++++++---
> src/glsl/glsl_parser_extras.h | 2 +-
> src/mesa/main/getstring.c | 6 ++++++
> 3 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
> index 27e3301..c920cbf 100644
> --- a/src/glsl/glsl_parser_extras.cpp
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -50,7 +50,7 @@ glsl_compute_version_string(void *mem_ctx, bool is_es, unsigned version)
>
>
> static const unsigned known_desktop_glsl_versions[] =
> - { 110, 120, 130, 140, 150, 330, 400, 410, 420, 430, 440 };
> + { 110, 120, 130, 140, 150, 330, 400, 410, 420, 430, 440, 450 };
>
>
> _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
> @@ -141,6 +141,12 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
> this->user_structures = NULL;
> this->num_user_structures = 0;
>
> + /* supported_versions should be large enough to support the known desktop
> + * GLSL versions plus 2 GLES versions (ES2 & ES3)
> + */
> + STATIC_ASSERT((ARRAY_SIZE(known_desktop_glsl_versions) + 2) ==
> + ARRAY_SIZE(this->supported_versions));
> +
> /* Populate the list of supported GLSL versions */
> /* FINISHME: Once the OpenGL 3.0 'forward compatible' context or
> * the OpenGL 3.2 Core context is supported, this logic will need
> @@ -168,8 +174,6 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
> this->supported_versions[this->num_supported_versions].es = true;
> this->num_supported_versions++;
> }
> - assert(this->num_supported_versions
> - <= ARRAY_SIZE(this->supported_versions));
>
> /* Create a string for use in error messages to tell the user which GLSL
> * versions are supported.
> diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
> index c14d74c..e9eb237 100644
> --- a/src/glsl/glsl_parser_extras.h
> +++ b/src/glsl/glsl_parser_extras.h
> @@ -217,7 +217,7 @@ struct _mesa_glsl_parse_state {
> struct {
> unsigned ver;
> bool es;
> - } supported_versions[12];
> + } supported_versions[14];
Someone sent a similar patch before and I was confused about 12 -> 14,
but the answer is that when I added 440 (commit e0648015e) I didn't
update it. Whoops.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the mesa-dev
mailing list