diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-05 22:36:02 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-05 22:36:02 -0800 |
| commit | 23c65b873f8002b74d60f61cacb3614da60e078d (patch) | |
| tree | 9629ffeed059cd67e70d5a98427922697ba46543 /source/slang/slang-ir-specialize.cpp | |
| parent | af035fb6da2a19ccc647515e9b1edf35777f8c89 (diff) | |
Add per-buffer data layout control. (#3551)
* Add per-buffer data layout control.
Fixes #3534.
* Fixes.
* Robustness.
* Update test.
* Fix.
Diffstat (limited to 'source/slang/slang-ir-specialize.cpp')
| -rw-r--r-- | source/slang/slang-ir-specialize.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index 3f75a8b32..b82daa9a4 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -2080,11 +2080,16 @@ struct SpecializationContext baseElementType, slotOperandCount, type->getExistentialArgs()); - - auto newPtrLikeType = builder.getType( + // Create a new type inst where the first operand is replaced + // with wrappedElementType. + ShortList<IRInst*> operands; + operands.add(wrappedElementType); + for (UInt i = 1; i < baseType->getOperandCount(); i++) + operands.add(baseType->getOperand(i)); + IRInst* newPtrLikeType = builder.getType( baseType->getOp(), - 1, - &wrappedElementType); + operands.getCount(), + operands.getArrayView().getBuffer()); addUsersToWorkList(type); addToWorkList(newPtrLikeType); addToWorkList(wrappedElementType); |
