diff options
Diffstat (limited to 'source/slang/slang-ir-any-value-marshalling.cpp')
| -rw-r--r-- | source/slang/slang-ir-any-value-marshalling.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index 79a41f0d5..27bba3fde 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -666,6 +666,7 @@ namespace Slang case kIROp_IntType: case kIROp_FloatType: case kIROp_UIntType: + case kIROp_BoolType: return alignUp(offset, 4) + 4; case kIROp_UInt64Type: case kIROp_Int64Type: @@ -755,6 +756,21 @@ namespace Slang size += kRTTIHeaderSize; return alignUp(offset, 4) + alignUp((SlangInt)size, 4); } + case kIROp_AssociatedType: + { + auto associatedType = cast<IRAssociatedType>(type); + SlangInt maxSize = 0; + for (UInt i = 0; i < associatedType->getOperandCount(); i++) + maxSize = Math::Max(maxSize, _getAnyValueSizeRaw((IRType*)associatedType->getOperand(i), offset)); + return maxSize; + } + case kIROp_ThisType: + { + auto thisType = cast<IRThisType>(type); + auto interfaceType = thisType->getConstraintType(); + auto size = SharedGenericsLoweringContext::getInterfaceAnyValueSize(interfaceType, interfaceType->sourceLoc); + return alignUp(offset, 4) + alignUp((SlangInt)size, 4); + } case kIROp_ExtractExistentialType: { auto existentialValue = type->getOperand(0); |
