diff options
author | Kenneth Graunke <[email protected]> | 2012-11-19 21:51:25 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-12-07 16:29:31 -0800 |
commit | 50e4a1df94c0fde3364d64cc564ded9110e3d182 (patch) | |
tree | ed0998459d74cdcfdb712a0a2f07970b64004c07 /src/mesa | |
parent | 6cffdb1ca0ae0f60a77dfc070a5685f014e35438 (diff) |
meta: Use #version 300 es in GenerateMipmap shaders on ES3.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index ad21fa863d3..0fba681ff15 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3112,18 +3112,19 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, sampler->func, sampler->texcoords); } else { - vs_source = - "#version 130\n" - "in vec2 position;\n" - "in vec3 textureCoords;\n" - "out vec3 texCoords;\n" - "void main()\n" - "{\n" - " texCoords = textureCoords;\n" - " gl_Position = vec4(position, 0.0, 1.0);\n" - "}\n"; + vs_source = ralloc_asprintf(mem_ctx, + "#version %s\n" + "in vec2 position;\n" + "in vec3 textureCoords;\n" + "out vec3 texCoords;\n" + "void main()\n" + "{\n" + " texCoords = textureCoords;\n" + " gl_Position = vec4(position, 0.0, 1.0);\n" + "}\n", + _mesa_is_desktop_gl(ctx) ? "130" : "300 es"); fs_source = ralloc_asprintf(mem_ctx, - "#version 130\n" + "#version %s\n" "uniform %s texSampler;\n" "in vec3 texCoords;\n" "out vec4 out_color;\n" @@ -3132,6 +3133,7 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, "{\n" " out_color = texture(texSampler, %s);\n" "}\n", + _mesa_is_desktop_gl(ctx) ? "130" : "300 es", sampler->type, sampler->texcoords); } |