summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-21 08:49:15 -0700
committerGitHub <noreply@github.com>2024-10-21 08:49:15 -0700
commit3e84726f45c66b477569be9e62da71956ab78e94 (patch)
tree8c69306133ee04b6acd14dd07d12a0ed47bf0079 /source/slang/slang-ir.cpp
parent20fa42e82dfa8398c9c818773fa40817883fb7ec (diff)
Fix spirv codegen for pointer to empty structs. (#5355)
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index e0998779a..2fd090877 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -2881,6 +2881,13 @@ namespace Slang
operands);
}
+ IRPtrTypeBase* IRBuilder::getPtrTypeWithAddressSpace(IRType* valueType, IRPtrTypeBase* ptrWithAddrSpace)
+ {
+ if (ptrWithAddrSpace->hasAddressSpace())
+ return (IRPtrTypeBase*)getPtrType(ptrWithAddrSpace->getOp(), valueType, ptrWithAddrSpace->getAddressSpace());
+ return (IRPtrTypeBase*)getPtrType(ptrWithAddrSpace->getOp(), valueType);
+ }
+
IRPtrType* IRBuilder::getPtrType(IROp op, IRType* valueType, AddressSpace addressSpace)
{
return (IRPtrType*)getPtrType(op, valueType, getIntValue(getUInt64Type(), static_cast<IRIntegerValue>(addressSpace)));