From 17da4d90dc9c3bb147667dbd86b45dcc3b1e725b Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 29 Feb 2024 10:00:43 -0800 Subject: [SPIRV Debug] Properly update output arguments after call. (#3648) --- source/slang/slang-ir.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 68b002153..ff9c6f6f8 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3221,10 +3221,18 @@ namespace Slang }; return emitIntrinsicInst(getVoidType(), kIROp_DebugLine, 5, args); } - IRInst* IRBuilder::emitDebugVar(IRType* type, IRInst* source, IRInst* line, IRInst* col) + IRInst* IRBuilder::emitDebugVar(IRType* type, IRInst* source, IRInst* line, IRInst* col, IRInst* argIndex) { - IRInst* args[] = { source, line, col }; - return emitIntrinsicInst(type, kIROp_DebugVar, 3, args); + if (argIndex) + { + IRInst* args[] = { source, line, col, argIndex }; + return emitIntrinsicInst(type, kIROp_DebugVar, 4, args); + } + else + { + IRInst* args[] = { source, line, col }; + return emitIntrinsicInst(type, kIROp_DebugVar, 3, args); + } } IRInst* IRBuilder::emitDebugValue(IRInst* debugVar, IRInst* debugValue, ArrayView accessChain) -- cgit v1.2.3