Skip to content

Commit

Permalink
shaders/sampling: fix gather version of pl_shader_sample_polar
Browse files Browse the repository at this point in the history
It was sampling already sampled pixels when switching between direct and
gather sampling. There was a check only on first pixel, but if the first
one was not sampled yet, but the next were, it would overlap the gather
window.

Fixes: mpv-player/mpv#13405
  • Loading branch information
kasper93 authored and haasn committed Mar 4, 2024
1 parent e5f7d6a commit c33267c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shaders/sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,9 @@ bool pl_shader_sample_polar(pl_shader sh, const struct pl_sample_src *src,
if (x+xo[p] > bound || y+yo[p] > bound)
continue; // next subpixel

if (!yo[p] && (gathered_cur & (bit << xo[p])))
continue; // already sampled

GLSL("idx = %d;\n", p);
polar_sample(sh, obj->filter, src_tex, lut, radius_c,
x+xo[p], y+yo[p], cmask, in, use_ar, scale);
Expand Down

0 comments on commit c33267c

Please sign in to comment.