[Mesa-stable] [Mesa-dev] [PATCH] glsl: Set ARB_texture_rectangle_enable to false if version 100 shader

Matt Turner mattst88 at gmail.com
Fri Jan 17 21:10:22 PST 2014


On Mon, Dec 9, 2013 at 6:00 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
> OpenGL with ARB_ES2_compatibility extension allows shaders that specify
> #version 100 and the shader is treated as targeting version 100 of the
> GLSL ES.
> state->es_shader flag might change during parsing based on the #version
> directive mentioned in the shader program. This patch adds another check
> to disable ARB_texture_rectangle for GLSL ES shaders.
>
> This fixes Khronos OpenGL CTS test(Texture_Rectangle_Samplers_frag.test)
> failure on mesa.
>
> Cc: mesa-stable at lists.freedesktop.org
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/glsl/builtin_types.cpp | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/glsl/builtin_types.cpp b/src/glsl/builtin_types.cpp
> index 92e3860..7d77cb5 100644
> --- a/src/glsl/builtin_types.cpp
> +++ b/src/glsl/builtin_types.cpp
> @@ -247,6 +247,12 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
>        }
>     }
>
> +   /* State of this flag might change in process_version_directive() function.
> +    * So, do another check here.
> +    */
> +   if (state->es_shader)
> +      state->ARB_texture_rectangle_enable = false;
> +
>     /* Add types for enabled extensions.  They may have already been added
>      * by the version-based loop, but attempting to add them a second time
>      * is harmless.
> --
> 1.8.3.1

I don't think this is really the place we want to disable the
extension. Please take a look at the patch I sent and see if you agree
that it's a better location.

Thanks,
Matt


More information about the mesa-stable mailing list