From a4919e3e16d6958b70d665ed682aae910ecf1d4b Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 1 Mar 2024 16:11:43 -0800 Subject: Enable debug info for swizzledStore. (#3659) --- source/slang/slang-ir-insert-debug-value-store.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source') 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(inst)) + { + List 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(inst)) { auto funcValue = getResolvedInstForDecorations(callInst->getCallee()); -- cgit v1.2.3