From cea230bc686ef87db4cff47e367bbf824b90377d Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 3 Oct 2023 00:05:39 +0800 Subject: Use const ref for mesh payload (#3254) * Use const ref for mesh payload * Test mesh payload hlsl output --- source/slang/slang-lower-to-ir.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 09992fb14..065263a59 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2527,19 +2527,17 @@ void addCallArgsForParam( /// Compute the direction for a parameter based on its declaration ParameterDirection getParameterDirection(VarDeclBase* paramDecl) { - if( paramDecl->hasModifier() + if( paramDecl->hasModifier()) + { + return kParameterDirection_Ref; + } + if (paramDecl->hasModifier() || paramDecl->hasModifier() ) { - // The AST specified `ref` or `payload`: - // The payload types are a groupshared variable, and we really don't // want to copy that into registers in every invocation on platforms // where this matters, so treat them as by-reference here. - return kParameterDirection_Ref; - } - if (paramDecl->hasModifier()) - { return kParameterDirection_ConstRef; } if( paramDecl->hasModifier() ) -- cgit v1.2.3