summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-01-02 13:42:41 +0100
committersfan5 <sfan5@live.de>2022-01-02 14:01:33 +0100
commit57bc5ba6d6579d5f1e6897f6915a3a940b84bb73 (patch)
treea20110cc431b6d2c04d47b6820310bb5c5e8e3e3
parentf40d66f62454b66280a5a25c3f718fdafba860cf (diff)
downloadmpv-57bc5ba6d6579d5f1e6897f6915a3a940b84bb73.tar.bz2
mpv-57bc5ba6d6579d5f1e6897f6915a3a940b84bb73.tar.xz
vo_gpu: move image2D precision qualifier to point of use
image2D is only defined from GLSL ES 3.1 onwards, so those statements broke GLES 2.0. Move the qualifier to a place that is only reached with the right version requirements. fixes commit 584ab29c88d6c5ffa03666bffbbc93e4f0740f67
-rw-r--r--video/out/gpu/shader_cache.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c
index c2b701382c..cb88c35ae6 100644
--- a/video/out/gpu/shader_cache.c
+++ b/video/out/gpu/shader_cache.c
@@ -339,7 +339,7 @@ void gl_sc_uniform_image2D_wo(struct gl_shader_cache *sc, const char *name,
struct sc_uniform *u = find_uniform(sc, name);
u->input.type = RA_VARTYPE_IMG_W;
- u->glsl_type = "writeonly image2D";
+ u->glsl_type = sc->ra->glsl_es ? "writeonly highp image2D" : "writeonly image2D";
u->input.binding = gl_sc_next_binding(sc, u->input.type);
u->v.tex = tex;
}
@@ -783,10 +783,8 @@ static void gl_sc_generate(struct gl_shader_cache *sc,
if (glsl_es) {
ADD(header, "#ifdef GL_FRAGMENT_PRECISION_HIGH\n");
ADD(header, "precision highp float;\n");
- ADD(header, "precision highp image2D;\n");
ADD(header, "#else\n");
ADD(header, "precision mediump float;\n");
- ADD(header, "precision mediump image2D;\n");
ADD(header, "#endif\n");
ADD(header, "precision mediump sampler2D;\n");