[Mesa-stable] [PATCH 6/9] meta: Add default precision qualifier to all fragement shaders

Ian Romanick idr at freedesktop.org
Fri Aug 9 16:38:38 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "9.2" <mesa-stable at lists.freedesktop.org>
---
 src/mesa/drivers/common/meta.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 69b06ed..609ef80 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1537,6 +1537,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
          "}\n";
 
       fs_source = ralloc_asprintf(mem_ctx,
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "varying vec2 texCoords;\n"
                                   "void main()\n"
@@ -1561,6 +1564,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
                                   _mesa_is_desktop_gl(ctx) ? "130" : "300 es");
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#version %s\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "in vec2 texCoords;\n"
                                   "out vec4 out_color;\n"
@@ -2134,6 +2140,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
       "   gl_Position = position;\n"
       "}\n";
    const char *fs_source =
+      "#ifdef GL_ES\n"
+      "precision highp float;\n"
+      "#endif\n"
       "uniform vec4 color;\n"
       "void main()\n"
       "{\n"
@@ -2193,6 +2202,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
       const char *fs_int_source =
          ralloc_asprintf(shader_source_mem_ctx,
                          "#version %s\n"
+                         "#ifdef GL_ES\n"
+                         "precision highp float;\n"
+                         "#endif\n"
                          "uniform ivec4 color;\n"
                          "out ivec4 out_color;\n"
                          "\n"
@@ -3421,6 +3433,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
 
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#extension GL_EXT_texture_array : enable\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "varying vec3 texCoords;\n"
                                   "void main()\n"
@@ -3444,6 +3459,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
                                   _mesa_is_desktop_gl(ctx) ? "130" : "300 es");
       fs_source = ralloc_asprintf(mem_ctx,
                                   "#version %s\n"
+                                  "#ifdef GL_ES\n"
+                                  "precision highp float;\n"
+                                  "#endif\n"
                                   "uniform %s texSampler;\n"
                                   "in vec3 texCoords;\n"
                                   "out vec4 out_color;\n"
-- 
1.8.1.4



More information about the mesa-stable mailing list