From c16f711d83df90f6826a65d61fc56cdbb932c92c Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 15 Aug 2023 20:55:21 -0700 Subject: SPIRV: debug source and debug line. (#3109) --- source/slang/slang-ir.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 131c8d407..421c60d1d 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -3123,6 +3123,23 @@ namespace Slang { return emitIntrinsicInst((IRType*)type, kIROp_OutImplicitCast, 1, &value); } + IRInst* IRBuilder::emitDebugSource(UnownedStringSlice fileName, UnownedStringSlice source) + { + IRInst* args[] = { getStringValue(fileName), getStringValue(source) }; + return emitIntrinsicInst(getVoidType(), kIROp_DebugSource, 2, args); + } + IRInst* IRBuilder::emitDebugLine(IRInst* source, IRIntegerValue lineStart, IRIntegerValue lineEnd, IRIntegerValue colStart, IRIntegerValue colEnd) + { + IRInst* args[] = + { + source, + getIntValue(getIntType(), lineStart), + getIntValue(getIntType(), lineEnd), + getIntValue(getIntType(), colStart), + getIntValue(getIntType(), colEnd) + }; + return emitIntrinsicInst(getVoidType(), kIROp_DebugLine, 5, args); + } IRLiveRangeStart* IRBuilder::emitLiveRangeStart(IRInst* referenced) { // This instruction doesn't produce any result, -- cgit v1.2.3