[Mesa-dev] [PATCH] glsl: Enable extensions implied by GLSL 3.30

Kenneth Graunke kenneth at whitecape.org
Fri Sep 13 11:24:12 PDT 2013


On 09/13/2013 09:13 AM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Reported-by: Dan Ginsburg <dang at valvesoftware.com>
> ---
>  src/glsl/glsl_parser_extras.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
> index 3f65ca5..e92f36e 100644
> --- a/src/glsl/glsl_parser_extras.cpp
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -306,6 +306,11 @@ _mesa_glsl_parse_state::process_version_directive(YYLTYPE *locp, int version,
>     if (this->language_version == 300 && this->es_shader) {
>        this->ARB_explicit_attrib_location_enable = true;
>     }
> +
> +   if (this->language_version >= 330) {
> +      this->ARB_shader_bit_encoding_enable = true;
> +      this->ARB_explicit_attrib_location_enable = true;
> +   }
>  }
>  
>  extern "C" {
> 

The real purpose of this patch appears to be enabling
ARB_explicit_attrib_location functionality in GLSL 3.30; AFAIK, we don't
have any Piglit tests for this yet.  This is a good change, but it could
be simplified.

The other part, setting ARB_shader_bit_encoding_enable = true, should
actually have no effect.  The only usage of that flag is in
builtin_functions.cpp:

static bool
shader_bit_encoding(const _mesa_glsl_parse_state *state)
{
   return state->is_version(330, 300) ||
          state->ARB_shader_bit_encoding_enable ||
          state->ARB_gpu_shader5_enable;
}

...which already enables support in 3.30 and ES 3.00.

I'm sending out three patches which replace this.  The first enables
ARB_explicit_attrib_location, and the next two frob around with the
ARB_shader_bit_encoding enables.  I'm pretty ambivalent about the last
two, so I'd welcome opinions.


More information about the mesa-dev mailing list