diff options
| author | Yong He <yonghe@outlook.com> | 2022-09-05 00:38:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-05 00:38:45 -0700 |
| commit | ea0845285b0307d153a91d6f0a5010fc2d7219ed (patch) | |
| tree | bf2d8f7258b2681deddf3391c551c5ff2b1a7918 /source/slang/slang-ir-generics-lowering-context.cpp | |
| parent | 2a869c105dcc23ede8f5e6e16b08261f45aa5aad (diff) | |
Multi parameter `__subscript` (#2392)
* Multi parameter `__subscript`
* Fix.
* Fix bugs.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-generics-lowering-context.cpp')
| -rw-r--r-- | source/slang/slang-ir-generics-lowering-context.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp index 0ed7d75d7..d0e1fabaf 100644 --- a/source/slang/slang-ir-generics-lowering-context.cpp +++ b/source/slang/slang-ir-generics-lowering-context.cpp @@ -374,12 +374,15 @@ namespace Slang } - bool SharedGenericsLoweringContext::doesTypeFitInAnyValue(IRType* concreteType, IRInterfaceType* interfaceType) + bool SharedGenericsLoweringContext::doesTypeFitInAnyValue(IRType* concreteType, IRInterfaceType* interfaceType, IRIntegerValue* outTypeSize, IRIntegerValue* outLimit) { auto anyValueSize = getInterfaceAnyValueSize(interfaceType, interfaceType->sourceLoc); + if (outLimit) *outLimit = anyValueSize; IRSizeAndAlignment sizeAndAlignment; Result result = getNaturalSizeAndAlignment(targetReq, concreteType, &sizeAndAlignment); + if (outTypeSize) *outTypeSize = sizeAndAlignment.size; + if(SLANG_FAILED(result) || (sizeAndAlignment.size > anyValueSize)) { // The value does not fit, either because it is too large, |
