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

Anuj Phogat anuj.phogat at gmail.com
Mon Dec 9 18:00:33 PST 2013


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



More information about the mesa-dev mailing list