summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-03 18:50:07 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-03 18:50:07 +0200
commit5e89aed93460c41c78cc09ac3d7573bec4fa989c (patch)
tree3d908b62c066bb273626207647f17d0246277fee
parent83f39103989ba6bd289a2ed83abe8177a3ba2f93 (diff)
downloadmpv-5e89aed93460c41c78cc09ac3d7573bec4fa989c.tar.bz2
mpv-5e89aed93460c41c78cc09ac3d7573bec4fa989c.tar.xz
vo_opengl: don't precompute texcoord in global scope
Breaks on mesa for whatever reason... even though it doesn't generate a GLSL shader compiler error Shouldn't make a performance difference for us because we cache `pos` anyway, and most compute shaders will probably cache all of their samples to shmem. Might have to re-visit this when we have an actual use case for repeated sampling inside CS though. (RAVU + anti-ringing is a possible candidate for that)
-rw-r--r--video/out/opengl/video.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 811c7b717b..14d7d68171 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -1183,7 +1183,7 @@ static void dispatch_compute(struct gl_video *p, int w, int h,
// Clamp the texture coordinates to prevent sampling out-of-bounds in
// threads that exceed the requested width/height
PRELUDE("#define texmap%d(id) min(texcoord%d_rot(id), vec2(1.0))\n", n, n);
- PRELUDE("vec2 texcoord%d = texmap%d(gl_GlobalInvocationID);\n", n, n);
+ PRELUDE("#define texcoord%d texmap%d(gl_GlobalInvocationID)\n", n, n);
}
pass_record(p, gl_sc_generate(p->sc, GL_COMPUTE_SHADER));