mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Test support for HLSL vector and matrix types.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f30f92f193
commit
b4aacec5cd
@ -71,6 +71,7 @@ vkd3d_shader_tests = \
|
||||
tests/hlsl-majority-pragma.shader_test \
|
||||
tests/hlsl-majority-typedef.shader_test \
|
||||
tests/hlsl-nested-arrays.shader_test \
|
||||
tests/hlsl-numeric-types.shader_test \
|
||||
tests/hlsl-return-implicit-conversion.shader_test \
|
||||
tests/hlsl-return-void.shader_test \
|
||||
tests/hlsl-shape.shader_test \
|
||||
@ -294,6 +295,7 @@ XFAIL_TESTS = \
|
||||
tests/hlsl-majority-pragma.shader_test \
|
||||
tests/hlsl-majority-typedef.shader_test \
|
||||
tests/hlsl-nested-arrays.shader_test \
|
||||
tests/hlsl-numeric-types.shader_test \
|
||||
tests/hlsl-return-implicit-conversion.shader_test \
|
||||
tests/hlsl-return-void.shader_test \
|
||||
tests/hlsl-shape.shader_test \
|
||||
|
102
tests/hlsl-numeric-types.shader_test
Normal file
102
tests/hlsl-numeric-types.shader_test
Normal file
@ -0,0 +1,102 @@
|
||||
[pixel shader]
|
||||
vector main() : sv_target
|
||||
{
|
||||
float4 ret = vector(1.0, 2.0, 3.0, 4.0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (1.0, 2.0, 3.0, 4.0)
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
vector<float, 4> ret = float4(1.0, 2.0, 3.0, 4.0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (1.0, 2.0, 3.0, 4.0)
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
vector<float, 3> ret = vector<float, 3>(1.0, 2.0, 3.0);
|
||||
return vector(ret, 0.0);
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (1.0, 2.0, 3.0, 0.0)
|
||||
|
||||
[pixel shader fail]
|
||||
vector main() : sv_target
|
||||
{
|
||||
vector ret = vector(1.0, 2.0, 3.0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
vector main() : sv_target
|
||||
{
|
||||
vector<float> ret = vector(1.0, 2.0, 3.0, 4.0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
matrix m = matrix<float, 4, 4>(1.0, 2.0, 3.0, 4.0,
|
||||
5.0, 6.0, 7.0, 8.0,
|
||||
9.0, 10.0, 11.0, 12.0,
|
||||
13.0, 14.0, 15.0, 16.0);
|
||||
return m[1];
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (5.0, 6.0, 7.0, 8.0)
|
||||
|
||||
[pixel shader]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
matrix<float, 2, 3> m = float2x3(1.0, 2.0, 3.0,
|
||||
5.0, 6.0, 7.0);
|
||||
return float4(m[1], 0.0);
|
||||
}
|
||||
|
||||
[test]
|
||||
draw quad
|
||||
probe all rgba (5.0, 6.0, 7.0, 0.0)
|
||||
|
||||
[pixel shader fail]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
matrix m = matrix<float>(1.0, 2.0, 3.0, 4.0,
|
||||
5.0, 6.0, 7.0, 8.0,
|
||||
9.0, 10.0, 11.0, 12.0,
|
||||
13.0, 14.0, 15.0, 16.0);
|
||||
return m[1];
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
matrix m = matrix<float, 4>(1.0, 2.0, 3.0, 4.0,
|
||||
5.0, 6.0, 7.0, 8.0,
|
||||
9.0, 10.0, 11.0, 12.0,
|
||||
13.0, 14.0, 15.0, 16.0);
|
||||
return m[1];
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
float4 main() : sv_target
|
||||
{
|
||||
matrix m = matrix(1.0, 2.0, 3.0, 4.0,
|
||||
5.0, 6.0, 7.0, 8.0,
|
||||
9.0, 10.0, 11.0, 12.0,
|
||||
13.0, 14.0, 15.0);
|
||||
return m[1];
|
||||
}
|
Loading…
Reference in New Issue
Block a user