mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Add a simple test for function overloads.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1c8b0d1062
commit
6e182e0206
@ -58,6 +58,7 @@ vkd3d_shader_tests = \
|
|||||||
tests/hlsl-array-dimension.shader_test \
|
tests/hlsl-array-dimension.shader_test \
|
||||||
tests/hlsl-comma.shader_test \
|
tests/hlsl-comma.shader_test \
|
||||||
tests/hlsl-duplicate-modifiers.shader_test \
|
tests/hlsl-duplicate-modifiers.shader_test \
|
||||||
|
tests/hlsl-function-overload.shader_test \
|
||||||
tests/hlsl-invalid.shader_test \
|
tests/hlsl-invalid.shader_test \
|
||||||
tests/hlsl-majority-pragma.shader_test \
|
tests/hlsl-majority-pragma.shader_test \
|
||||||
tests/hlsl-majority-typedef.shader_test \
|
tests/hlsl-majority-typedef.shader_test \
|
||||||
@ -266,6 +267,7 @@ XFAIL_TESTS = \
|
|||||||
tests/hlsl-array-dimension.shader_test \
|
tests/hlsl-array-dimension.shader_test \
|
||||||
tests/hlsl-comma.shader_test \
|
tests/hlsl-comma.shader_test \
|
||||||
tests/hlsl-duplicate-modifiers.shader_test \
|
tests/hlsl-duplicate-modifiers.shader_test \
|
||||||
|
tests/hlsl-function-overload.shader_test \
|
||||||
tests/hlsl-majority-pragma.shader_test \
|
tests/hlsl-majority-pragma.shader_test \
|
||||||
tests/hlsl-majority-typedef.shader_test \
|
tests/hlsl-majority-typedef.shader_test \
|
||||||
tests/hlsl-nested-arrays.shader_test \
|
tests/hlsl-nested-arrays.shader_test \
|
||||||
|
40
tests/hlsl-function-overload.shader_test
Normal file
40
tests/hlsl-function-overload.shader_test
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
[pixel shader fail]
|
||||||
|
/* The same function signature cannot be defined twice. */
|
||||||
|
|
||||||
|
float func(int arg)
|
||||||
|
{
|
||||||
|
return 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float func(int arg)
|
||||||
|
{
|
||||||
|
return 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 main() : sv_target
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
[pixel shader]
|
||||||
|
/* Test a basic overload. */
|
||||||
|
float func(int arg)
|
||||||
|
{
|
||||||
|
return 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float func(uint arg)
|
||||||
|
{
|
||||||
|
return 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 main() : sv_target
|
||||||
|
{
|
||||||
|
int i = 1;
|
||||||
|
uint u = 1;
|
||||||
|
return float4(func(i), func(u), func(int2(1, 1)), func(uint2(1, 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
[test]
|
||||||
|
draw quad
|
||||||
|
probe all rgba (0.1, 0.2, 0.1, 0.2)
|
Loading…
Reference in New Issue
Block a user