diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-01 17:30:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-01 17:30:55 -0700 |
| commit | 9043bc5522cc86560ac5d57ddfc6cfa7612c9222 (patch) | |
| tree | 9804bb8a682386b9f761e8fb164cb43ad5390411 /source/slang/slang-ir.cpp | |
| parent | 0bb826f8b92aec330875d0b966c1f4a6b99988bf (diff) | |
Fix compile failures when using debug symbol. (#4069)
* Fix compile failures when using debug symbol.
* Various fixes.
* Fix intrinsic.
* Fix test.
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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<IRInst*>& accessChain, + const ArrayView<IRInst*>& types) + { + for (Index i = 0; i < accessChain.getCount(); i++) + { + auto access = accessChain[i]; + auto type = (IRType*)types[i]; + if (auto structKey = as<IRStructKey>(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<IRUpdateElement>( |
