pvr: Change push_constants_shader_stages to type pvr_stage_allocation
authorKarmjit Mahil <Karmjit.Mahil@imgtec.com>
Tue, 25 Apr 2023 14:06:26 +0000 (15:06 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 28 Apr 2023 09:16:02 +0000 (09:16 +0000)
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 <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22731>

src/imagination/vulkan/pvr_common.h
src/imagination/vulkan/pvr_descriptor_set.c

index e7642ea..7f19ee5 100644 (file)
@@ -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;
index 3ed9391..1e93779 100644 (file)
@@ -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 :