summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video.c
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-02-22 09:47:24 -0500
committersfan5 <sfan5@live.de>2024-02-24 21:12:17 +0100
commit3e17d9da8f3a9c0e4c78822b89cb3251b711f036 (patch)
tree591d22c88d258278f7ff5b35cfc80ea7b525e832 /video/out/gpu/video.c
parentf9b8f156d7fe910d9024b864e3e72bbcf76fdecb (diff)
downloadmpv-3e17d9da8f3a9c0e4c78822b89cb3251b711f036.tar.bz2
mpv-3e17d9da8f3a9c0e4c78822b89cb3251b711f036.tar.xz
vo_gpu: use fbo texture height for fragment coordinate calculation
Previous fix only worked when the video output doesn't have vertical black bars. This fixes the cases like fullscreen, video-zoom etc. Fixes: https://github.com/mpv-player/mpv/pull/13528
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r--video/out/gpu/video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 61af661e6f..c7bbbfd888 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -2861,7 +2861,7 @@ static void pass_dither(struct gl_video *p, const struct ra_fbo *fbo)
gl_sc_uniform_texture(p->sc, "dither", p->dither_texture);
GLSLF("vec2 dither_coord = vec2(gl_FragCoord.x, %d.0 + %f * gl_FragCoord.y);",
- fbo->flip ? p->dst_rect.y1 : 0, fbo->flip ? -1.0 : 1.0);
+ fbo->flip ? fbo->tex->params.h : 0, fbo->flip ? -1.0 : 1.0);
GLSLF("vec2 dither_pos = dither_coord * 1.0/%d.0;\n", dither_size);
if (p->opts.temporal_dither) {
@@ -3081,7 +3081,7 @@ static void pass_draw_to_screen(struct gl_video *p, const struct ra_fbo *fbo, in
// Draw checkerboard pattern to indicate transparency
GLSLF("// transparency checkerboard\n");
GLSLF("vec2 tile_coord = vec2(gl_FragCoord.x, %d.0 + %f * gl_FragCoord.y);",
- fbo->flip ? p->dst_rect.y1 : 0, fbo->flip ? -1.0 : 1.0);
+ fbo->flip ? fbo->tex->params.h : 0, fbo->flip ? -1.0 : 1.0);
GLSL(bvec2 tile = lessThan(fract(tile_coord * 1.0 / 32.0), vec2(0.5));)
GLSL(vec3 background = vec3(tile.x == tile.y ? 0.93 : 0.87);)
GLSL(color.rgb += background.rgb * (1.0 - color.a);)