diff options
| author | Yong He <yonghe@outlook.com> | 2022-08-10 14:11:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-10 14:11:27 -0700 |
| commit | 88f04c29244af23c1cdd472d8d1ae3e5a650494e (patch) | |
| tree | 398e55440e8f7ad157d15b2b75d9887236eaa126 /source/slang/slang-ir-any-value-marshalling.cpp | |
| parent | fcdb4629c4c3dd2931eaa88b96b668d914c4519c (diff) | |
`is` and `as` operator and `Optional<T>`. (#2355)
* `is` and `as` operator and `Optional<T>`.
* Fix.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-any-value-marshalling.cpp')
| -rw-r--r-- | source/slang/slang-ir-any-value-marshalling.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index 5c91766f7..39292e2b1 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -762,6 +762,13 @@ namespace Slang size += kRTTIHeaderSize; return alignUp(offset, 4) + alignUp((SlangInt)size, 4); } + case kIROp_ExtractExistentialType: + { + auto existentialValue = type->getOperand(0); + auto interfaceType = cast<IRInterfaceType>(existentialValue->getDataType()); + auto size = SharedGenericsLoweringContext::getInterfaceAnyValueSize(interfaceType, interfaceType->sourceLoc); + return alignUp(offset, 4) + alignUp((SlangInt)size, 4); + } default: if (as<IRTextureTypeBase>(type) || as<IRSamplerStateTypeBase>(type)) { |
