From 353ef3ac3e72dd8cf51f8bf164bc671dc2549258 Mon Sep 17 00:00:00 2001 From: Gabriele Di Bari Date: Tue, 24 May 2022 18:53:39 +0200 Subject: [PATCH] Add test for the instance param (geometry shader) --- Test/hlsl.instance.geom | 17 +++++++++++++++++ gtests/Hlsl.FromFile.cpp | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Test/hlsl.instance.geom diff --git a/Test/hlsl.instance.geom b/Test/hlsl.instance.geom new file mode 100644 index 00000000..5295f389 --- /dev/null +++ b/Test/hlsl.instance.geom @@ -0,0 +1,17 @@ +struct VertexShaderOutput +{ + float4 m_position : SV_POSITION; + float4 m_color : COLOR0; +}; + +[maxvertexcount(3)] +[instance(5)] +void GeometryShader(triangle VertexShaderOutput input[3], inout TriangleStream output, uint id : SV_GSInstanceID) +{ + [loop] + for (int i = 0; i < 3; ++i) + { + output.Append(input[i]); + } + output.RestartStrip(); +} \ No newline at end of file diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index 519be254..d3e38bb7 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -434,7 +434,8 @@ INSTANTIATE_TEST_SUITE_P( {"hlsl.typedef.frag", "PixelShaderFunction"}, {"hlsl.whileLoop.frag", "PixelShaderFunction"}, {"hlsl.void.frag", "PixelShaderFunction"}, - {"hlsl.type.type.conversion.all.frag", "main"} + {"hlsl.type.type.conversion.all.frag", "main"}, + {"hlsl.instance.geom", "GeometryShader"} }), FileNameAsCustomTestSuffix );