Module: vkd3d Branch: master Commit: 6cb7487fb02e92a205acde2805361cb93e10bc77 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/6cb7487fb02e92a205acde2805361c...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Mon Jan 15 12:08:56 2024 +0100
tests: Add a test with non-trivial control flow.
---
tests/hlsl/for.shader_test | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index 9407c81b..7abd2067 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -28,6 +28,40 @@ 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)
+[require] +shader model >= 4.0 + +% Identical to the previous, except we prevent DXC from unrolling the +% loop so we can test non-trivial control flow +[pixel shader] +uniform uint iter; + +float4 main(float tex : texcoord) : sv_target +{ + int i; + float x = 0.0; + 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] +uniform 0 uint4 10 0 0 0 +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) + +[require] +% Reset requirements + [pixel shader] float4 main(float tex : texcoord) : sv_target {