[PATCH vkd3d 3/5] tests: Try to avoid using SV_Position from shaders which can be tested with SM2.

Henri Verbeet hverbeet at gmail.com
Thu Apr 7 16:34:43 CDT 2022


On Thu, 7 Apr 2022 at 21:14, Zebediah Figura <zfigura at codeweavers.com> wrote:
> Ah, now I remember. The problem ends up being a difference in pixel
> center. E.g. one can do something like this for the trigonometry test:
>
>
> [vertex shader]
> void main(out float tex : texcoord, inout float4 pos : sv_position)
> {
>      tex = (pos.x + 1) * 320;
> }
>
> [pixel shader]
> float4 main(float tex : texcoord) : sv_target
> {
>      return float4(sin(tex), cos(tex), 0, 0);
> }
>
>
> and the results will remain about the same (modulo measuring error) for
> d3d9, but will be different for d3d11/d3d12 due to the half-pixel offset.
>
> I suppose we could manually offset vertex position in the shader runner
> backend...

Actually, we should do that in order to properly draw screen-aligned
quads with d3d9. Otherwise these quads are going to only partially
cover the pixels at their edges.



More information about the wine-devel mailing list