mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
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:
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
@ -44,6 +44,7 @@ vkd3d_cross_tests = \
|
||||
vkd3d_shader_tests = \
|
||||
tests/abs.shader_test \
|
||||
tests/all.shader_test \
|
||||
tests/any.shader_test \
|
||||
tests/arithmetic-float.shader_test \
|
||||
tests/arithmetic-float-uniform.shader_test \
|
||||
tests/arithmetic-int.shader_test \
|
||||
|
96
tests/any.shader_test
Normal file
96
tests/any.shader_test
Normal 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)
|
Loading…
Reference in New Issue
Block a user