tests/hlsl: Test loop unrolling edge cases.

This commit is contained in:
Victor Chiletto 2024-05-17 18:35:50 -03:00 committed by Henri Verbeet
parent 2034a8bab9
commit 76ae871f5b
Notes: Henri Verbeet 2024-07-11 00:40:50 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/786
2 changed files with 66 additions and 0 deletions

View File

@ -241,6 +241,7 @@ vkd3d_shader_tests = \
tests/hlsl/unsigned.shader_test \
tests/hlsl/uniform-parameters.shader_test \
tests/hlsl/uniform-semantics.shader_test \
tests/hlsl/unroll.shader_test \
tests/hlsl/vector-indexing-uniform.shader_test \
tests/hlsl/vector-indexing.shader_test \
tests/hlsl/vertex-shader-ops.shader_test \

View File

@ -0,0 +1,65 @@
% Unrolling edge cases.
[pixel shader todo(sm<4)]
float a : register(c0);
float4 main() : sv_target
{
int i;
if (a > 0)
{
[unroll]
for (i = 0; i < 10; ++i);
return float4(i, a, 2.0, 3.0);
}
return float4(0.0, a, 3.0, 4.0);
}
[test]
uniform 0 float 1
todo(glsl|sm<4) draw quad
probe (0,0) rgba(10.0, 1.0, 2.0, 3.0)
[pixel shader]
float4 main() : sv_target
{
int i;
[unroll(4)]
for (i = 0; i < 8; ++i);
return float4(i, 0, 0, 0);
}
[test]
todo(glsl) draw quad
probe (0,0) rgba(4.0, 0.0, 0.0, 0.0)
[pixel shader fail(sm<6)]
float4 main() : sv_target
{
int i;
[unroll]
for (i = 0; i < 1024; ++i);
return float4(i, 0, 0, 0);
}
[test]
todo(glsl) draw quad
probe (0,0) rgba(1024.0, 0, 0, 0)
[pixel shader]
float4 main() : sv_target
{
int i;
[unroll(1337)]
for (i = 0; i < 1337; ++i);
return float4(i, 0, 0, 0);
}
[test]
todo(glsl) draw quad
probe (0,0) rgba(1337.0, 0, 0, 0)