summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-insert-debug-value-store.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-01 16:11:43 -0800
committerGitHub <noreply@github.com>2024-03-01 16:11:43 -0800
commita4919e3e16d6958b70d665ed682aae910ecf1d4b (patch)
treeaf18aea83887ba07247f1efed15b1703346a3df8 /source/slang/slang-ir-insert-debug-value-store.cpp
parent9a1e327387ffa8552ac2f0aee8836a0b10a5578f (diff)
Enable debug info for swizzledStore. (#3659)
Diffstat (limited to 'source/slang/slang-ir-insert-debug-value-store.cpp')
-rw-r--r--source/slang/slang-ir-insert-debug-value-store.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-ir-insert-debug-value-store.cpp b/source/slang/slang-ir-insert-debug-value-store.cpp
index 6243e6c09..004598b5d 100644
--- a/source/slang/slang-ir-insert-debug-value-store.cpp
+++ b/source/slang/slang-ir-insert-debug-value-store.cpp
@@ -130,6 +130,18 @@ namespace Slang
setDebugValue(debugVar, varInst, storeInst->getVal(), accessChain.getArrayView());
}
}
+ else if (auto swizzledStore = as<IRSwizzledStore>(inst))
+ {
+ List<IRInst*> accessChain;
+ auto varInst = getRootAddr(swizzledStore->getDest(), accessChain);
+ IRInst* debugVar = nullptr;
+ if (mapVarToDebugVar.tryGetValue(varInst, debugVar))
+ {
+ builder.setInsertAfter(swizzledStore);
+ auto loadVal = builder.emitLoad(swizzledStore->getDest());
+ setDebugValue(debugVar, varInst, loadVal, accessChain.getArrayView());
+ }
+ }
else if (auto callInst = as<IRCall>(inst))
{
auto funcValue = getResolvedInstForDecorations(callInst->getCallee());