summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-insert-debug-value-store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-insert-debug-value-store.cpp')
-rw-r--r--source/slang/slang-ir-insert-debug-value-store.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/slang/slang-ir-insert-debug-value-store.cpp b/source/slang/slang-ir-insert-debug-value-store.cpp
index 91b7738f1..aeeb744ef 100644
--- a/source/slang/slang-ir-insert-debug-value-store.cpp
+++ b/source/slang/slang-ir-insert-debug-value-store.cpp
@@ -140,6 +140,17 @@ void DebugValueStoreContext::insertDebugValueStore(IRFunc* func)
mapVarToDebugVar[param] = debugVar;
+ // Map any in-param proxy vars to the debug var.
+ bool hasProxyVar = false;
+ for (auto use = param->firstUse; use; use = use->nextUse)
+ {
+ if (auto inParamProxyVarDecor = as<IRInParamProxyVarDecoration>(use->getUser()))
+ {
+ mapVarToDebugVar[inParamProxyVarDecor->parent] = debugVar;
+ hasProxyVar = true;
+ }
+ }
+
// Store the initial value of the parameter into the debug var.
IRInst* paramVal = nullptr;
if (!isRefParam)
@@ -153,7 +164,7 @@ void DebugValueStoreContext::insertDebugValueStore(IRFunc* func)
paramVal = builder.emitLoad(param);
}
- if (paramVal)
+ if (paramVal && !hasProxyVar)
{
builder.emitDebugValue(debugVar, paramVal);
}