tests: Test hull shader function overloads.

This commit is contained in:
Shaun Ren 2024-08-27 10:55:41 -04:00 committed by Henri Verbeet
parent ed1e74dd62
commit 62fad1c185
Notes: Henri Verbeet 2024-09-04 18:50:05 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1015
2 changed files with 113 additions and 0 deletions

View File

@ -133,6 +133,7 @@ vkd3d_shader_tests = \
tests/hlsl/half.shader_test \
tests/hlsl/hard-copy-prop.shader_test \
tests/hlsl/hull-shader-attributes.shader_test \
tests/hlsl/hull-shader-syntax.shader_test \
tests/hlsl/initializer-flatten.shader_test \
tests/hlsl/initializer-implicit-array.shader_test \
tests/hlsl/initializer-invalid-arg-count.shader_test \

View File

@ -0,0 +1,112 @@
[require]
shader model >= 5.0
%% Test patch constant function overloads.
%% For SM < 6, the last declaration that is defined is picked.
%% For SM >= 6, the last valid declaration is picked, even if it is not defined.
[hull shader]
struct patch_constant_data
{
float edges[2] : SV_TessFactor;
};
patch_constant_data patch_constant(float x);
patch_constant_data patch_constant(float x, uint y);
patch_constant_data patch_constant()
{
return (patch_constant_data)0;
}
// Missing valid return semantics (SV_TessFactor).
float patch_constant(uint x);
[domain("isoline")]
[outputcontrolpoints(3)]
[partitioning("integer")]
[outputtopology("point")]
[patchconstantfunc("patch_constant")]
float4 main() : POSITION
{
return 0;
}
[hull shader fail(sm>=6)]
struct patch_constant_data
{
float edges[2] : SV_TessFactor;
};
patch_constant_data patch_constant(float x);
patch_constant_data patch_constant(float x, uint y);
patch_constant_data patch_constant()
{
return (patch_constant_data)0;
}
patch_constant_data patch_constant(uint x : SV_PrimitiveID);
[domain("isoline")]
[outputcontrolpoints(3)]
[partitioning("integer")]
[outputtopology("point")]
[patchconstantfunc("patch_constant")]
float4 main() : POSITION
{
return 0;
}
[hull shader]
struct patch_constant_data
{
float edges[2] : SV_TessFactor;
};
patch_constant_data patch_constant()
{
return (patch_constant_data)0;
}
patch_constant_data patch_constant(uint x : SV_PrimitiveID)
{
return (patch_constant_data)x;
}
[domain("isoline")]
[outputcontrolpoints(3)]
[partitioning("integer")]
[outputtopology("point")]
[patchconstantfunc("patch_constant")]
float4 main() : POSITION
{
return 0;
}
[hull shader fail todo]
struct patch_constant_data
{
float edges[2] : SV_TessFactor;
};
patch_constant_data patch_constant()
{
return (patch_constant_data)0;
}
// x is missing a semantic.
patch_constant_data patch_constant(uint x)
{
return (patch_constant_data)x;
}
[domain("isoline")]
[outputcontrolpoints(3)]
[partitioning("integer")]
[outputtopology("point")]
[patchconstantfunc("patch_constant")]
float4 main() : POSITION
{
return 0;
}