diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-15 20:55:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-15 20:55:21 -0700 |
| commit | c16f711d83df90f6826a65d61fc56cdbb932c92c (patch) | |
| tree | 3680ff05b91aa4521fd5c5e9caa9de171cbac558 /source/slang/slang-ir.cpp | |
| parent | 0c366bc0a4332ee14d08f2555396a18cb64229fa (diff) | |
SPIRV: debug source and debug line. (#3109)
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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, |
