[PATCH] wined3d: Fix the odd line condition in gen_yv12_read().

Anton Baskanov baskanov at gmail.com
Tue Aug 31 00:44:28 CDT 2021


On понедельник, 30 августа 2021 г. 20:59:07 +07 you wrote:
> On Sun, 29 Aug 2021 at 20:19, Anton Baskanov <baskanov at gmail.com> wrote:
> > Signed-off-by: Anton Baskanov <baskanov at gmail.com>
> > ---
> > The original condition is true for every other line, which is incorrect
> > since the chroma has only half the resolution. Fixes comb artifacts
> > around color transitions.
> > ---
> > 
> >  dlls/wined3d/glsl_shader.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
> > index 5ae90148dc8..21aef4606ff 100644
> > --- a/dlls/wined3d/glsl_shader.c
> > +++ b/dlls/wined3d/glsl_shader.c
> > @@ -12622,7 +12622,7 @@ static void gen_yv12_read(struct
> > wined3d_string_buffer *buffer,> 
> >       * get filtering bleeding. */
> >      
> >      /* Read odd lines from the right side (add 0.5 to the x coordinate).
> >      */
> > 
> > -    shader_addline(buffer, "    if (fract(floor(texcoord.y * size.y) *
> > 0.5 + 1.0 / 6.0) >= 0.5)\n"); +    shader_addline(buffer, "    if
> > (fract(texcoord.y * size.y * 0.25) >= 0.5)\n");> 
> >      shader_addline(buffer, "        texcoord.x += 0.5;\n");
> 
> Changing the multiplier from 0.5 to 0.25 makes sense, but it would be
> helpful to update the comment to make that obvious. It's not clear to
> me why you're changing the rest of the expression.

Added a comment in v2. I'm changing it because it looks overcomplicated, and I 
couldn't think of any reason why it should be.





More information about the wine-devel mailing list