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>
This commit is contained in:
Giovanni Mascellani 2021-09-15 16:00:16 +02:00 committed by Alexandre Julliard
parent d4adbe81a0
commit 3522d0f3a7
2 changed files with 24 additions and 0 deletions

View File

@ -64,6 +64,7 @@ vkd3d_shader_tests = \
tests/hlsl-clamp.shader_test \ tests/hlsl-clamp.shader_test \
tests/hlsl-comma.shader_test \ tests/hlsl-comma.shader_test \
tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
tests/hlsl-function-overload.shader_test \ tests/hlsl-function-overload.shader_test \
tests/hlsl-invalid.shader_test \ tests/hlsl-invalid.shader_test \
tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-pragma.shader_test \
@ -281,6 +282,7 @@ XFAIL_TESTS = \
tests/hlsl-clamp.shader_test \ tests/hlsl-clamp.shader_test \
tests/hlsl-comma.shader_test \ tests/hlsl-comma.shader_test \
tests/hlsl-duplicate-modifiers.shader_test \ tests/hlsl-duplicate-modifiers.shader_test \
tests/hlsl-for.shader_test \
tests/hlsl-function-overload.shader_test \ tests/hlsl-function-overload.shader_test \
tests/hlsl-majority-pragma.shader_test \ tests/hlsl-majority-pragma.shader_test \
tests/hlsl-majority-typedef.shader_test \ tests/hlsl-majority-typedef.shader_test \

View File

@ -0,0 +1,22 @@
[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)