mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Test hull shader function overloads.
This commit is contained in:
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
@ -133,6 +133,7 @@ vkd3d_shader_tests = \
|
|||||||
tests/hlsl/half.shader_test \
|
tests/hlsl/half.shader_test \
|
||||||
tests/hlsl/hard-copy-prop.shader_test \
|
tests/hlsl/hard-copy-prop.shader_test \
|
||||||
tests/hlsl/hull-shader-attributes.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-flatten.shader_test \
|
||||||
tests/hlsl/initializer-implicit-array.shader_test \
|
tests/hlsl/initializer-implicit-array.shader_test \
|
||||||
tests/hlsl/initializer-invalid-arg-count.shader_test \
|
tests/hlsl/initializer-invalid-arg-count.shader_test \
|
||||||
|
112
tests/hlsl/hull-shader-syntax.shader_test
Normal file
112
tests/hlsl/hull-shader-syntax.shader_test
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user