From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/hlsl/for.shader_test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index 9407c81bc..600adfbcf 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -28,6 +28,33 @@ probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0) probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0) probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0)
+% Identical to the previous, except for dirty tricks to prevent DXC from unrolling the loop so we can test non-trivial control flow +[pixel shader] +float4 main(float tex : texcoord) : sv_target +{ + int i; + float x = 0.0; + uint iter = 10; + if (tex > 1000) + iter = tex; + for (i = 0; i < iter; i++) + { + x += i; + if (tex > 0.5 && i == 5) + break; + if (tex > -0.5 && i >= 7) + continue; + x -= 1; + } + return float4(i, x, 0.0, 0.0); +} + +[test] +todo(sm>=6) draw quad +probe ( 0, 0, 159, 480) rgba (10.0, 35.0, 0.0, 0.0) +probe (161, 0, 479, 480) rgba (10.0, 38.0, 0.0, 0.0) +probe (481, 0, 640, 480) rgba ( 5.0, 10.0, 0.0, 0.0) + [pixel shader] float4 main(float tex : texcoord) : sv_target {