Module: Mesa Branch: main Commit: a8f841dad92bcff5397d5599130c85695c66572a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8f841dad92bcff5397d5599130c85695c66572a
Author: Karmjit Mahil <[email protected]> Date: Tue Apr 25 15:06:26 2023 +0100 pvr: Change push_constants_shader_stages to type pvr_stage_allocation Previously the code was saving the mask as a VkShaderStageFlags but when allocating shareds it checked against pvr_stage_allocation. This causes problems as only the vertex bit matches the VkShaderStageFlagBits so the push constants utilized in fragment shaders weren't picked up properly. Signed-off-by: Karmjit Mahil <[email protected]> Reviewed-by: Frank Binns <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22731> --- src/imagination/vulkan/pvr_common.h | 3 ++- src/imagination/vulkan/pvr_descriptor_set.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/imagination/vulkan/pvr_common.h b/src/imagination/vulkan/pvr_common.h index e7642eaff39..7f19ee5d308 100644 --- a/src/imagination/vulkan/pvr_common.h +++ b/src/imagination/vulkan/pvr_common.h @@ -449,7 +449,8 @@ struct pvr_pipeline_layout { /* Contains set_count amount of descriptor set layouts. */ struct pvr_descriptor_set_layout *set_layout[PVR_MAX_DESCRIPTOR_SETS]; - VkShaderStageFlags push_constants_shader_stages; + /* Mask of enum pvr_stage_allocation. */ + uint8_t push_constants_shader_stages; uint32_t vert_push_constants_offset; uint32_t frag_push_constants_offset; uint32_t compute_push_constants_offset; diff --git a/src/imagination/vulkan/pvr_descriptor_set.c b/src/imagination/vulkan/pvr_descriptor_set.c index 3ed93910fae..1e93779aaec 100644 --- a/src/imagination/vulkan/pvr_descriptor_set.c +++ b/src/imagination/vulkan/pvr_descriptor_set.c @@ -995,7 +995,8 @@ VkResult pvr_CreatePipelineLayout(VkDevice _device, for (uint32_t i = 0; i < pCreateInfo->pushConstantRangeCount; i++) { const VkPushConstantRange *range = &pCreateInfo->pPushConstantRanges[i]; - layout->push_constants_shader_stages |= range->stageFlags; + layout->push_constants_shader_stages |= + vk_to_pvr_shader_stage_flags(range->stageFlags); /* From the Vulkan spec. 1.3.237 * VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292 :
