From 5e89aed93460c41c78cc09ac3d7573bec4fa989c Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Thu, 3 Aug 2017 18:50:07 +0200 Subject: 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) --- video/out/opengl/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.2.3