From 9043bc5522cc86560ac5d57ddfc6cfa7612c9222 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 1 May 2024 17:30:55 -0700 Subject: Fix compile failures when using debug symbol. (#4069) * Fix compile failures when using debug symbol. * Various fixes. * Fix intrinsic. * Fix test. --- source/slang/slang-ir.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 5f49d1966..11f8cdb87 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -5032,6 +5032,27 @@ namespace Slang return basePtr; } + IRInst* IRBuilder::emitElementAddress( + IRInst* basePtr, + const ArrayView& accessChain, + const ArrayView& types) + { + for (Index i = 0; i < accessChain.getCount(); i++) + { + auto access = accessChain[i]; + auto type = (IRType*)types[i]; + if (auto structKey = as(access)) + { + basePtr = emitFieldAddress(type, basePtr, structKey); + } + else + { + basePtr = emitElementAddress(type, basePtr, access); + } + } + return basePtr; + } + IRInst* IRBuilder::emitUpdateElement(IRInst* base, IRInst* index, IRInst* newElement) { auto inst = createInst( -- cgit v1.2.3