diff options
| author | Lujin Wang <143145775+lujinwangnv@users.noreply.github.com> | 2025-06-18 16:03:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-18 23:03:29 +0000 |
| commit | ef6c21af908ad72a04c6d7d22ad9cd189a44f2e3 (patch) | |
| tree | 2470837f6b67e6e9b54898428dab2bbe68663bfa /source | |
| parent | 1fb60f25bb46c0f0f5a1780f52ee721a04ea9306 (diff) | |
Use 1-based argument index for DebugLocalVariable (#7438)
* Use 1-based argument index for DebugLocalVariable
GLSLANG/DXC NSDI uses 1-based index of the argument. Slang should
follow this convention like other SPIR-V generators.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-spirv-ops-debug-info-ext.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-emit-spirv-ops-debug-info-ext.h b/source/slang/slang-emit-spirv-ops-debug-info-ext.h index 90a0d44a8..138204af7 100644 --- a/source/slang/slang-emit-spirv-ops-debug-info-ext.h +++ b/source/slang/slang-emit-spirv-ops-debug-info-ext.h @@ -513,6 +513,13 @@ SpvInst* emitOpDebugLocalVariable( { static_assert(isSingular<T>); if (argIndex) + { + // Note +1 logic for argIndex is to follow the convention that + // 1-based index of the argument is used by GLSLANG/DXC NSDI. + IRBuilder builder(argIndex); + IRInst* newArgIndex = + builder.getIntValue(builder.getUIntType(), as<IRIntLit>(argIndex)->getValue() + 1); + return emitInst( parent, inst, @@ -528,7 +535,8 @@ SpvInst* emitOpDebugLocalVariable( col, scope, flags, - argIndex); + newArgIndex); + } return emitInst( parent, inst, |
