From ad45062fcc76cd622aaa1a9cb00515d42f8d3528 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 23 Jan 2024 19:37:10 -0800 Subject: SPIRV Legalization fixes. (#3479) * Fix CFG legalization for SPIRV backend. * Emit DepthReplacing execution mode. * Fix do-while lowering. --------- Co-authored-by: Yong He --- tests/spirv/depth-replacing.slang | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/spirv/depth-replacing.slang (limited to 'tests/spirv/depth-replacing.slang') diff --git a/tests/spirv/depth-replacing.slang b/tests/spirv/depth-replacing.slang new file mode 100644 index 000000000..df2ab17e1 --- /dev/null +++ b/tests/spirv/depth-replacing.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage fragment -entry main -emit-spirv-directly + +struct PSOut +{ + float4 color : SV_Target; + float depth : SV_Depth; +} +// CHECK: OpExecutionMode {{.*}} DepthReplacing + +PSOut main() +{ + PSOut psout; + psout.color = float4(1.0f, 0.0f, 0.0f, 1.0f); + psout.depth = 0.5f; + return psout; +} -- cgit v1.2.3