glsl: Record in gl_shader whether the shader uses GLSL ES.
authorPaul Berry <stereotype441@gmail.com>
Fri, 3 Aug 2012 00:47:49 +0000 (17:47 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 6 Dec 2012 20:13:22 +0000 (12:13 -0800)
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.

[v2, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
src/glsl/main.cpp
src/mesa/main/mtypes.h

index 33cd79c8544fb12af1d801da434dabcccbbd8937..7463cda26123458379f5f6e707dc7d3fd106a5b2 100644 (file)
@@ -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->IsES = 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;
index 66693a75215b1593f52440b8fc3a0e8b28dad5be..a43c94e6a04829b91649e87a73398c687d12401f 100644 (file)
@@ -2186,6 +2186,7 @@ struct gl_shader
    struct gl_sl_pragmas Pragmas;
 
    unsigned Version;       /**< GLSL version used for linking */
+   GLboolean IsES;         /**< True if this shader uses GLSL ES */
 
    /**
     * \name Sampler tracking