[SPIR-V] Fix mesh payload global variable for VK_EXT_mesh_shaders #6526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing logic from
VK_NV_mesh_shader
was incorrectly adapted for theVK_EXT_mesh_shader
implementation when it comes to the handling of payloads as in/out variables. BecauseTaskPayloadWorkgroupEXT
must be applied to a single globalOpVariable
for each task/mesh shader, the struct should not be flattened. Further, Location assignment is not necessary for these input and output variables, so the usual reason for flattening structs does not apply.This change now removes the inner struct member global variables and ensures the parent payload is decorated with
TaskPayloadWorkgroupEXT
. Note that for amplification/task shaders, the payload variable is created with thegroupshared
decl, and then its storage class needs to be updated when that variable is used as a parameter to theDispatchMesh
call, as described in: https://docs.vulkan.org/spec/latest/proposals/proposals/VK_EXT_mesh_shader.html#_hlsl_changesTested with new validation checks from: KhronosGroup/SPIRV-Tools#5640
Fixes #5981