summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 4d692b727..9ca22fead 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -870,8 +870,15 @@ LoweredValInfo emitCallToDeclRef(
return LoweredValInfo::simple(args[0]);
}
auto intrinsicOp = getIntrinsicOp(funcDecl, intrinsicOpModifier);
- return LoweredValInfo::simple(
- builder->emitIntrinsicInst(type, IROp(intrinsicOp), argCount, args));
+ switch (IROp(intrinsicOp))
+ {
+ case kIROp_GetOffsetPtr:
+ SLANG_ASSERT(argCount == 2);
+ return LoweredValInfo::simple(builder->emitGetOffsetPtr(args[0], args[1]));
+ default:
+ return LoweredValInfo::simple(
+ builder->emitIntrinsicInst(type, IROp(intrinsicOp), argCount, args));
+ }
}
// Fallback case is to emit an actual call.