From: Paul Berry <stereotype...@gmail.com>

Previously we recorded just the GLSL version, with the knowledge that
100 means GLSL 1.00 ES.  With the advent of GLSL 3.00 ES, this is
going to get more complex, and eventually will probably become
ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be
created some day).

To reduce confusion, this patch simply records whether the shader is
GLSL ES as an explicit boolean.

Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
---
 src/glsl/main.cpp      | 1 +
 src/mesa/main/mtypes.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 04143ad..77b8eca 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -190,6 +190,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader 
*shader)
    shader->symbols = state->symbols;
    shader->CompileStatus = !state->error;
    shader->Version = state->language_version;
+   shader->IsEsShader = state->es_shader;
    memcpy(shader->builtins_to_link, state->builtins_to_link,
          sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
    shader->num_builtins_to_link = state->num_builtins_to_link;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 69518b7..f364ae1 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2184,6 +2184,7 @@ struct gl_shader
    struct gl_sl_pragmas Pragmas;
 
    unsigned Version;       /**< GLSL version used for linking */
+   GLboolean IsEsShader; /**< True if this shader uses GLSL ES */
 
    /**
     * \name Sampler tracking
-- 
1.7.11.7

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to