tests: Add a test for side effects of ternary operator.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-07-10 16:04:21 +02:00 committed by Alexandre Julliard
parent 44bf5556ae
commit a18ace731d
Notes: Alexandre Julliard 2023-07-17 23:26:07 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/277

View File

@ -31,3 +31,18 @@ float4 main() : sv_target
uniform 0 float4 1.1 3.0 4.0 5.0
draw quad
probe all rgba (1.1, 2.0, 0.0, 0.0)
[pixel shader]
float4 f;
float4 main() : sv_target
{
float f1 = 0.1, f2 = 0.2, f3;
f3 = f.x ? (f1 = 0.5) + 0.2 : (f2 = 0.6);
return float4(f1, f2, f3, 0.0);
}
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (0.5, 0.6, 0.7, 0.0)