vkd3d/tests/hlsl-for.shader_test
Giovanni Mascellani 3522d0f3a7 tests: Test a for loop, with break and continue.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-15 18:34:58 +02:00

23 lines
460 B
Plaintext

[pixel shader]
float4 main(float4 pos : SV_POSITION) : SV_TARGET
{
int i;
float x = 0.0;
for (i = 0; i < 10; i++)
{
x += i;
if (pos.x == 1.5 && i == 5)
break;
if (pos.x == 2.5 && i >= 7)
continue;
x -= 1;
}
return float4(i, x, 0.0, 0.0);
}
[test]
draw quad
probe rgba (0, 0) (10.0, 35.0, 0.0, 0.0)
probe rgba (1, 0) (5.0, 10.0, 0.0, 0.0)
probe rgba (2, 0) (10.0, 38.0, 0.0, 0.0)