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 /source/slang/slang-emit-spirv.cpp | |
| parent | 4eb7a27ac4532a49b9d383d2b0d80bc0ec317b4c (diff) | |
Add SPIRV atomic debug type (#6616)
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index d43af8ac2..758e1ca7e 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -7440,6 +7440,7 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex HashSet<IRType*> m_emittingTypes; // Types that are being emitted. Dictionary<IRType*, SpvInst*> m_mapForwardRefsToDebugType; static constexpr const int kUnknownPhysicalLayout = 1 << 17; + static constexpr const int kDebugTypeAtomicQualifier = 3; SpvInst* emitDebugTypeImpl(IRType* type) { @@ -7692,6 +7693,19 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex builder.getIntValue(builder.getUIntType(), storageClass), builder.getIntValue(builder.getUIntType(), kUnknownPhysicalLayout)); } + else if (auto atomicType = as<IRAtomicType>(type)) + { + auto baseType = atomicType->getElementType(); + auto debugBaseType = emitDebugType(baseType); + + return emitOpDebugTypeQualifier( + getSection(SpvLogicalSectionID::ConstantsAndTypes), + nullptr, + m_voidType, + getNonSemanticDebugInfoExtInst(), + debugBaseType, + builder.getIntValue(builder.getUIntType(), kDebugTypeAtomicQualifier)); + } return ensureInst(m_voidType); } |
