From: Ian Romanick Date: Tue, 28 Apr 2015 19:13:21 +0000 (-0700) Subject: glsl/es3.1: Allow 3.10 ES shaders in a GLES 3.1 context X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7038370bd166a8d6f4a24db05da70f713ef7ed37;p=mesa.git glsl/es3.1: Allow 3.10 ES shaders in a GLES 3.1 context Currently no 3.10 ES features (beyond 3.00 ES) are enabled. That will come later. Signed-off-by: Ian Romanick Reviewed-by: Tapani Pälli --- diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index a8ba89eda3a..9e2f19f6388 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -143,9 +143,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->num_user_structures = 0; /* supported_versions should be large enough to support the known desktop - * GLSL versions plus 2 GLES versions (ES2 & ES3) + * GLSL versions plus 3 GLES versions (ES 1.00, ES 3.00, and ES 3.10)) */ - STATIC_ASSERT((ARRAY_SIZE(known_desktop_glsl_versions) + 2) == + STATIC_ASSERT((ARRAY_SIZE(known_desktop_glsl_versions) + 3) == ARRAY_SIZE(this->supported_versions)); /* Populate the list of supported GLSL versions */ @@ -175,6 +175,11 @@ _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++; } + if (_mesa_is_gles31(ctx)) { + this->supported_versions[this->num_supported_versions].ver = 310; + this->supported_versions[this->num_supported_versions].es = true; + this->num_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 51f2bf5e000..5c0ee9b2fc3 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -229,7 +229,7 @@ struct _mesa_glsl_parse_state { struct { unsigned ver; bool es; - } supported_versions[14]; + } supported_versions[15]; bool es_shader; unsigned language_version;