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-ast-type.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ast-type.h') diff --git a/source/slang/slang-ast-type.h b/source/slang/slang-ast-type.h index 50d523cc5..3c50b1899 100644 --- a/source/slang/slang-ast-type.h +++ b/source/slang/slang-ast-type.h @@ -552,12 +552,23 @@ class InOutType : public OutTypeBase SLANG_AST_CLASS(InOutType) }; +class RefTypeBase : public ParamDirectionType +{ + SLANG_AST_CLASS(RefTypeBase) +}; + // The type for an `ref` parameter, e.g., `ref T` -class RefType : public ParamDirectionType +class RefType : public RefTypeBase { SLANG_AST_CLASS(RefType) }; +// The type for an `constref` parameter, e.g., `constref T` +class ConstRefType : public RefTypeBase +{ + SLANG_AST_CLASS(ConstRefType) +}; + class OptionalType : public BuiltinType { SLANG_AST_CLASS(OptionalType) -- cgit v1.2.3