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.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 408b87e49..f8d2b3117 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -2755,6 +2755,11 @@ namespace Slang return (IRRefType*) getPtrType(kIROp_RefType, valueType); } + IRConstRefType* IRBuilder::getConstRefType(IRType* valueType) + { + return (IRConstRefType*)getPtrType(kIROp_ConstRefType, valueType); + } + IRSPIRVLiteralType* IRBuilder::getSPIRVLiteralType(IRType* type) { IRInst* operands[] = { type }; @@ -3588,6 +3593,7 @@ namespace Slang case kIROp_OutType: case kIROp_RawPointerType: case kIROp_RefType: + case kIROp_ConstRefType: case kIROp_ComPtrType: case kIROp_NativePtrType: case kIROp_NativeStringType: @@ -3697,6 +3703,7 @@ namespace Slang case kIROp_OutType: case kIROp_RawPointerType: case kIROp_RefType: + case kIROp_ConstRefType: return 3; case kIROp_VoidType: return 4; -- cgit v1.2.3