summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-emit-spirv-ops-debug-info-ext.h10
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,