[PATCH v3 2/2] wined3d: Simplify the odd line condition in gen_yv12_read().

Stefan Dösinger stefandoesinger at gmail.com
Wed Sep 1 10:53:14 CDT 2021



> Am 31.08.2021 um 19:26 schrieb Anton Baskanov <baskanov at gmail.com>:
> 
> -    shader_addline(buffer, "    if (fract(floor(texcoord.y * size.y) * 0.25 + 1.0 / 6.0) >= 0.5)\n");
> +    shader_addline(buffer, "    if (fract(texcoord.y * size.y * 0.25) >= 0.5)\n");

Some archeology 2c: the code in arb_program_shader.c has this to say about the 1/6 offset:

        shader_addline(buffer, "ADD texcrd2.x, texcrd2.y, yv12_coef.y;\n"); /* To avoid 0.5 == 0.5 comparisons */

I don't remember why I was scared of 0.5 == 0.5 comparisons or why exactly they might happen (at the exact edge of the texture probably? But even then I'd expect the texture coordinate to be not quite 1.0), why I was scared of equality here ('SGE' is set greater equal after all. Driver bugs?). It was 13 years ago when I wrote the ARB version of this.

The ARB code does use 0.25 though, like the change your previous patch introduces.

My gut feeling says that those shaders should be safe re magnifying filters, but if the blit scales the YUV image down while converting to RGB it'll probably break in interesting ways.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210901/963fd969/attachment.sig>


More information about the wine-devel mailing list