1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 06:14:32 +00:00

vo_opengl: don't hardcode texmap0 for polar compute

This was an oversight. The ID shouldn't be hard-coded here, so add it to
sampler_prelude instead.
This commit is contained in:
Niklas Haas 2017-08-03 18:51:51 +02:00
parent 5e89aed934
commit 2bf094cd55
No known key found for this signature in database
GPG Key ID: 9A09076581B27402

View File

@ -29,7 +29,9 @@
void sampler_prelude(struct gl_shader_cache *sc, int tex_num)
{
GLSLF("#undef tex\n");
GLSLF("#undef texmap\n");
GLSLF("#define tex texture%d\n", tex_num);
GLSLF("#define texmap texmap%d\n", tex_num);
GLSLF("vec2 pos = texcoord%d;\n", tex_num);
GLSLF("vec2 size = texture_size%d;\n", tex_num);
GLSLF("vec2 pt = pixel_size%d;\n", tex_num);
@ -227,7 +229,7 @@ void pass_compute_polar(struct gl_shader_cache *sc, struct scaler *scaler,
GLSL(color = vec4(0.0);)
GLSLF("{\n");
GLSL(vec2 wpos = texmap0(gl_WorkGroupID * gl_WorkGroupSize);)
GLSL(vec2 wpos = texmap(gl_WorkGroupID * gl_WorkGroupSize);)
GLSL(vec2 wbase = wpos - pt * fract(wpos * size - vec2(0.5));)
GLSL(vec2 fcoord = fract(pos * size - vec2(0.5));)
GLSL(vec2 base = pos - pt * fcoord;)