diff options
author | Ian Romanick <[email protected]> | 2013-12-16 13:10:11 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-02-11 16:00:12 -0800 |
commit | d524654c34c42fff785dcdc08c9a73abd88fbf45 (patch) | |
tree | c492c3eeb43374472019c99271554893a7856327 /src | |
parent | 4825af972a7e318f34ca20a32e8e1597f90ae90c (diff) |
meta: Improve GLSL version check
We want to use the GLSL 1.30-ish path for OpenGL ES 3.0.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 40e1f373532..a40bf08b280 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -461,7 +461,12 @@ setup_shader_for_sampler(struct gl_context *ctx, struct glsl_sampler *sampler) if (sampler->shader_prog != 0) return sampler->shader_prog; - if (ctx->API == API_OPENGLES2 || ctx->Const.GLSLVersion < 130) { + /* The version check is a little tricky. API is set to API_OPENGLES2 even + * for OpenGL ES 3.0 contexts, and GLSLVersion may be set to 140, for + * example, in an OpenGL ES 2.0 context. + */ + if ((ctx->API == API_OPENGLES2 && ctx->Version < 30) + || ctx->Const.GLSLVersion < 130) { vs_source = "attribute vec2 position;\n" "attribute vec3 textureCoords;\n" |