tests: Add tests for any() intrinsic.

Currently only tests float and bool, scalar and vector.

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
This commit is contained in:
Ethan Lee 2023-04-13 13:50:11 -04:00 committed by Alexandre Julliard
parent 0668d32631
commit 81cc077b53
Notes: Alexandre Julliard 2023-04-19 22:12:42 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/157
2 changed files with 97 additions and 0 deletions

View File

@ -44,6 +44,7 @@ vkd3d_cross_tests = \
vkd3d_shader_tests = \ vkd3d_shader_tests = \
tests/abs.shader_test \ tests/abs.shader_test \
tests/all.shader_test \ tests/all.shader_test \
tests/any.shader_test \
tests/arithmetic-float.shader_test \ tests/arithmetic-float.shader_test \
tests/arithmetic-float-uniform.shader_test \ tests/arithmetic-float-uniform.shader_test \
tests/arithmetic-int.shader_test \ tests/arithmetic-int.shader_test \

96
tests/any.shader_test Normal file
View File

@ -0,0 +1,96 @@
[pixel shader]
uniform float4 f;
float4 main() : sv_target
{
return any(f);
}
[test]
uniform 0 float4 1.0 1.0 1.0 1.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 1.0 0.0 0.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 1.0 0.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 1.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
uniform 0 float4 -1.0 -1.0 -1.0 -1.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader]
uniform float f;
float4 main() : sv_target
{
return any(f);
}
[test]
uniform 0 float4 1.0 0.0 0.0 0.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 float4 0.0 0.0 0.0 0.0
draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
uniform 0 float4 -1.0 0.0 0.0 0.0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
[require]
shader model >= 4.0
[pixel shader]
uniform uint4 b;
float4 main() : sv_target
{
return any((bool4)b);
}
[test]
uniform 0 uint4 1 1 1 1
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 1 0 0 0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 0 1 0 0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 0 0 1 0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 0 0 0 1
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 0 0 0 0
draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader]
uniform uint b;
float4 main() : sv_target
{
return any((bool)b);
}
[test]
uniform 0 uint4 1 0 0 0
draw quad
probe all rgba (1.0, 1.0, 1.0, 1.0)
uniform 0 uint4 0 0 0 0
draw quad
probe all rgba (0.0, 0.0, 0.0, 0.0)