From 765061a77bcf4fe6300721263cc9e0f25595488d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 May 2022 19:42:48 -0700 Subject: Initial support for COM interface in host code. (#2230) Co-authored-by: Yong He Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> --- source/slang/slang-ir-generics-lowering-context.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ir-generics-lowering-context.cpp') diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp index 4fb4e007b..284e1fa11 100644 --- a/source/slang/slang-ir-generics-lowering-context.cpp +++ b/source/slang/slang-ir-generics-lowering-context.cpp @@ -170,9 +170,14 @@ namespace Slang } case kIROp_ThisType: { + auto interfaceType = cast(paramType)->getConstraintType(); - if (isBuiltin(cast(paramType)->getConstraintType())) + if (isBuiltin(interfaceType)) return (IRType*)paramType; + + if (interfaceType->findDecoration()) + return (IRType*)interfaceType; + auto anyValueSize = getInterfaceAnyValueSize( cast(paramType)->getConstraintType(), paramType->sourceLoc); @@ -187,6 +192,9 @@ namespace Slang if (isBuiltin(paramType)) return (IRType*)paramType; + if (paramType->findDecoration()) + return (IRType*)paramType; + // In the dynamic-dispatch case, a value of interface type // is going to be packed into the "any value" part of a tuple. // The size of the "any value" part depends on the interface -- cgit v1.2.3