From aee00ea55a50077294611733b535c93da5c3dc3b Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Tue, 15 Oct 2024 16:33:21 -0400 Subject: [PATCH] tests: Test hull shader uniform input parameters. --- tests/hlsl/hull-shader-syntax.shader_test | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/hlsl/hull-shader-syntax.shader_test b/tests/hlsl/hull-shader-syntax.shader_test index 5e5062e6..ebf11cb1 100644 --- a/tests/hlsl/hull-shader-syntax.shader_test +++ b/tests/hlsl/hull-shader-syntax.shader_test @@ -110,3 +110,56 @@ float4 main() : POSITION { return 0; } + +%% Test uniform input parameters. + +[hull shader fail(sm>=6)] +// SM6 requires all function paramaters to have semantics. + +struct patch_constant_data +{ + float edges[2] : SV_TessFactor; +}; + +uniform float4 a; +Texture2D tex; + +patch_constant_data patch_constant() +{ + return (patch_constant_data)tex[uint2(1, 1)]; +} + + [domain("isoline")] + [outputcontrolpoints(3)] + [partitioning("integer")] + [outputtopology("point")] + [patchconstantfunc("patch_constant")] +float4 main(uniform float4 b) : POSITION +{ + return a + b + tex[uint2(0, 0)]; +} + +% Patch constant function can't have uniform parameters. +[hull shader fail todo] +struct patch_constant_data +{ + float edges[2] : SV_TessFactor; +}; + +uniform float4 a; +Texture2D tex; + +patch_constant_data patch_constant(uniform float4 c) +{ + return (patch_constant_data)tex[uint2(1, 1)]; +} + + [domain("isoline")] + [outputcontrolpoints(3)] + [partitioning("integer")] + [outputtopology("point")] + [patchconstantfunc("patch_constant")] +float4 main(uniform float4 b) : POSITION +{ + return a + b + tex[uint2(0, 0)]; +}