From b7d318f48db2cb83a41d665f1727ae93fc555124 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 28 Sep 2023 18:07:40 -0700 Subject: Support `constref` parameters passing. (#3249) * Support `constref` parameters passing. * Fix. * Fix. * Add test and diagnostic on mix use of __constref and no_diff. * check for [constref] on differentiable member method. --------- Co-authored-by: Yong He --- source/slang/slang-ir-marshal-native-call.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang-ir-marshal-native-call.cpp') diff --git a/source/slang/slang-ir-marshal-native-call.cpp b/source/slang/slang-ir-marshal-native-call.cpp index 3fcc02de0..401828daa 100644 --- a/source/slang/slang-ir-marshal-native-call.cpp +++ b/source/slang/slang-ir-marshal-native-call.cpp @@ -18,6 +18,7 @@ namespace Slang return builder.getNativePtrType((IRType*)as(type)->getOperand(0)); case kIROp_InOutType: case kIROp_RefType: + case kIROp_ConstRefType: case kIROp_OutType: return builder.getPtrType(getNativeType(builder, (IRType*)type->getOperand(0))); default: @@ -76,6 +77,7 @@ namespace Slang { case kIROp_InOutType: case kIROp_RefType: + case kIROp_ConstRefType: case kIROp_OutType: return marshalRefManagedValueToNativeValue( builder, originalArg, args); @@ -135,6 +137,7 @@ namespace Slang { case kIROp_InOutType: case kIROp_RefType: + case kIROp_ConstRefType: SLANG_UNREACHABLE("out and ref types should be handled before reaching here."); break; case kIROp_StringType: -- cgit v1.2.3