diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-09-28 02:46:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-27 11:46:03 -0700 |
| commit | 8326248542c2196b4a4ba80f068adb8a0edd6006 (patch) | |
| tree | b8fc963b827547c1d13cd2aee4510abf16eaf702 /source/slang/slang-lower-to-ir.cpp | |
| parent | 771b3ef47d48f5277ac9f23ee8a49548a430d107 (diff) | |
WIP Mesh shaders for SPIR-V (#3226)
* SPIR-V impl for SetMeshOutputCounts and DispatchMesh
* Unsightly fix for legalization ordering differences between GLSL and SPIR-V
* spelling
* Start a new block after terminating one in the OpEmitMeshTasksExt SPIR-V asm block
* Emit mesh shader decorations in SPIR-V
* Mesh and task shader stages for spir-v
* Output explicit gl builtins for spir-v
* Be more hygenic when SOAizing mesh outputs
* Do not create builtin paramter block for spirv mesh outputs
* Pass mesh payloads around by ref
* comment
* less expected failure
* remove unused
* Add spirv op
* Correct type query for default flat modifier
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 452b24c30..ce577de6e 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2515,9 +2515,15 @@ void addCallArgsForParam( /// Compute the direction for a parameter based on its declaration ParameterDirection getParameterDirection(VarDeclBase* paramDecl) { - if( paramDecl->hasModifier<RefModifier>() ) + if( paramDecl->hasModifier<RefModifier>() + || paramDecl->hasModifier<HLSLPayloadModifier>() ) { - // The AST specified `ref`: + // 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<InOutModifier>() ) |
