diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-10-03 00:05:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-02 09:05:39 -0700 |
| commit | cea230bc686ef87db4cff47e367bbf824b90377d (patch) | |
| tree | 4a99efe2c4a3a04a47842ce07f05953f1b1b5880 /source | |
| parent | ccf2611c024ab12dcccd978f3f501d4ee9fc52bc (diff) | |
Use const ref for mesh payload (#3254)
* Use const ref for mesh payload
* Test mesh payload hlsl output
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
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<RefModifier>() + if( paramDecl->hasModifier<RefModifier>()) + { + return kParameterDirection_Ref; + } + if (paramDecl->hasModifier<ConstRefModifier>() || paramDecl->hasModifier<HLSLPayloadModifier>() ) { - // 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<ConstRefModifier>()) - { return kParameterDirection_ConstRef; } if( paramDecl->hasModifier<InOutModifier>() ) |
