From 155e0804edbc9e7175cb0a6ed60d3daff0ba5e01 Mon Sep 17 00:00:00 2001 From: Darren Wihandi <65404740+fairywreath@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:26:26 -0400 Subject: Add SPIRV atomic debug type (#6616) Co-authored-by: Ellie Hermaszewska --- tests/spirv/debug-type-atomic-pointer.slang | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/spirv/debug-type-atomic-pointer.slang (limited to 'tests') diff --git a/tests/spirv/debug-type-atomic-pointer.slang b/tests/spirv/debug-type-atomic-pointer.slang new file mode 100644 index 000000000..c3374f413 --- /dev/null +++ b/tests/spirv/debug-type-atomic-pointer.slang @@ -0,0 +1,31 @@ +//TEST(compute, vulkan):SIMPLE(filecheck=CHECK_SPV): -stage compute -entry computeMain -target spirv -emit-spirv-directly -g2 + + +// CHECK_SPV: [[STRING_uint:%[1-9][0-9]*]] = OpString "uint" +// CHECK_SPV: [[TYPE_uint:%[1-9][0-9]*]] = OpExtInst %void %{{[0-9]*}} DebugTypeBasic [[STRING_uint]] + +// Debug type qualifier for atomic is 3 +// CHECK_SPV: [[TYPE_atomic_uint:%[1-9][0-9]*]] = OpExtInst %void %{{[0-9]*}} DebugTypeQualifier [[TYPE_uint]] %uint_3 +// CHECK_SPV: OpExtInst %void %{{[0-9]*}} DebugTypePointer [[TYPE_atomic_uint]] + +struct Test { + Atomic atomicMember; +}; + +struct PC { + Atomic* atomicMember; + Test* test; +} + +[[vk::push_constant]] +PC pc; + +[shader("compute")] +[numthreads(1,1,1)] +public void computeMain() { + Atomic* atomicMember = pc.atomicMember; + atomicMember.store(10); + + Test* test = pc.test; + test.atomicMember.store(10); +} -- cgit v1.2.3