Module: Mesa
Branch: main
Commit: c6113def8420acda8d81c0ae35994e1bd0749908
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6113def8420acda8d81c0ae35994e1bd0749908

Author: Karmjit Mahil <[email protected]>
Date:   Wed Aug 31 15:11:00 2022 +0100

pvr: Set descriptor dirty flag based on other flags.

Set the flag if the descriptor set is updated.
Set the fragment descriptor dirty flag if blend consts are updated.

Signed-off-by: Karmjit Mahil <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18429>

---

 src/imagination/vulkan/pvr_cmd_buffer.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/imagination/vulkan/pvr_cmd_buffer.c 
b/src/imagination/vulkan/pvr_cmd_buffer.c
index 559e520d918..dc54bc82a5d 100644
--- a/src/imagination/vulkan/pvr_cmd_buffer.c
+++ b/src/imagination/vulkan/pvr_cmd_buffer.c
@@ -4424,6 +4424,8 @@ static VkResult pvr_validate_draw_state(struct 
pvr_cmd_buffer *cmd_buffer)
 {
    struct pvr_cmd_buffer_state *const state = &cmd_buffer->state;
    const struct pvr_graphics_pipeline *const gfx_pipeline = 
state->gfx_pipeline;
+   const struct pvr_pipeline_layout *const pipeline_layout =
+      gfx_pipeline->base.layout;
    const struct pvr_pipeline_stage_state *const fragment_state =
       &gfx_pipeline->fragment_shader_state.stage_state;
    struct pvr_sub_cmd_gfx *sub_cmd;
@@ -4528,6 +4530,17 @@ static VkResult pvr_validate_draw_state(struct 
pvr_cmd_buffer *cmd_buffer)
                                      state->dirty.gfx_pipeline_binding;
    state->dirty.fragment_descriptors = state->dirty.vertex_descriptors;
 
+   /* Account for dirty descriptor set. */
+   state->dirty.vertex_descriptors |=
+      state->dirty.gfx_desc_dirty &&
+      pipeline_layout
+         ->per_stage_descriptor_masks[PVR_STAGE_ALLOCATION_VERTEX_GEOMETRY];
+   state->dirty.fragment_descriptors |=
+      state->dirty.gfx_desc_dirty &&
+      
pipeline_layout->per_stage_descriptor_masks[PVR_STAGE_ALLOCATION_FRAGMENT];
+
+   state->dirty.fragment_descriptors |= state->dirty.blend_constants;
+
    if (state->dirty.fragment_descriptors) {
       result = pvr_setup_descriptor_mappings(
          cmd_buffer,

Reply via email to