From 94c458243cf95567ec8f152d07a8754dcbfa9c93 Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Tue, 11 Feb 2025 10:39:03 +1000 Subject: Add WGSL to list of formats supporting multiple entry points (#6324) * Add WGSL to list of formats supporting multiple entry points * Add a test for generating multiple WGSL entrypoints --- tests/wgsl/multiple-entrypoints.slang | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/wgsl/multiple-entrypoints.slang (limited to 'tests') diff --git a/tests/wgsl/multiple-entrypoints.slang b/tests/wgsl/multiple-entrypoints.slang new file mode 100644 index 000000000..5e10f21d6 --- /dev/null +++ b/tests/wgsl/multiple-entrypoints.slang @@ -0,0 +1,28 @@ +//TEST:SIMPLE(filecheck=WGSL): -target wgsl + +//WGSL-DAG: @builtin(global_invocation_id) +//WGSL-DAG: @compute + +[shader("compute")] +void main_compute(uint3 dtid : SV_DispatchThreadID) +{ + // Empty compute shader +} + +//WGSL-DAG: @builtin(front_facing) +//WGSL-DAG: @fragment + +[shader("fragment")] +float4 main_fragment(bool isFront : SV_IsFrontFace) : SV_Target +{ + return float4(1,1,1,1); +} + +//WGSL-DAG: @builtin(vertex_index) +//WGSL-DAG: @vertex + +[shader("vertex")] +float4 main_vertex(uint vertexID : SV_VertexID) : SV_Position +{ + return float4(1,1,1,1); +} -- cgit v1.2.3