tests: Check that derivatives are still computed after discarding.

This commit is contained in:
Giovanni Mascellani 2024-04-12 14:06:36 +02:00 committed by Alexandre Julliard
parent 12c457b43f
commit 7196484e59
Notes: Alexandre Julliard 2024-04-19 22:26:50 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/784

View File

@ -16,6 +16,30 @@ uniform 0 float4 9 8 7 6
todo(sm<4 | glsl) draw quad todo(sm<4 | glsl) draw quad
probe all rgba (1, 2, 3, 4) probe all rgba (1, 2, 3, 4)
[require]
shader model >= 3.0
% Check that derivatives are still computed after discarding
% other pixels in the same quad
[pixel shader todo(sm<4)]
float4 main(float4 pos : sv_position) : sv_target
{
if (frac((floor(pos.x) + floor(pos.y)) / 2) == 0.5)
discard;
return float4(ddx(pos.x), ddx(pos.y), ddy(pos.x), ddy(pos.y));
}
[test]
todo(sm<4 | glsl) draw quad
probe (0, 0) rgba (1, 0, 0, 1)
probe (1, 0) rgba (1, 2, 3, 4)
probe (0, 1) rgba (1, 2, 3, 4)
probe (1, 1) rgba (1, 0, 0, 1)
probe (2, 0) rgba (1, 0, 0, 1)
probe (3, 0) rgba (1, 2, 3, 4)
probe (2, 1) rgba (1, 2, 3, 4)
probe (3, 1) rgba (1, 0, 0, 1)
[require] [require]
shader model >= 5.0 shader model >= 5.0