diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-03-19 16:26:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-19 20:26:26 +0000 |
| commit | 155e0804edbc9e7175cb0a6ed60d3daff0ba5e01 (patch) | |
| tree | 25797527a6e263a6a38c3ce3f04380a57d8c0d1e /tests/spirv | |
| parent | 4eb7a27ac4532a49b9d383d2b0d80bc0ec317b4c (diff) | |
Add SPIRV atomic debug type (#6616)
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests/spirv')
| -rw-r--r-- | tests/spirv/debug-type-atomic-pointer.slang | 31 |
1 files changed, 31 insertions, 0 deletions
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<uint32_t> atomicMember; +}; + +struct PC { + Atomic<uint>* atomicMember; + Test* test; +} + +[[vk::push_constant]] +PC pc; + +[shader("compute")] +[numthreads(1,1,1)] +public void computeMain() { + Atomic<uint32_t>* atomicMember = pc.atomicMember; + atomicMember.store(10); + + Test* test = pc.test; + test.atomicMember.store(10); +} |
