mirror of https://github.com/mpv-player/mpv
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)
This commit is contained in:
parent
83f3910398
commit
5e89aed934
|
@ -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
|
// Clamp the texture coordinates to prevent sampling out-of-bounds in
|
||||||
// threads that exceed the requested width/height
|
// threads that exceed the requested width/height
|
||||||
PRELUDE("#define texmap%d(id) min(texcoord%d_rot(id), vec2(1.0))\n", n, n);
|
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));
|
pass_record(p, gl_sc_generate(p->sc, GL_COMPUTE_SHADER));
|
||||||
|
|
Loading…
Reference in New Issue