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

Author: Connor Abbott <[email protected]>
Date:   Tue Sep 12 20:53:31 2023 +0200

tu: Don't use pipeline for bandwidth validity

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25276>

---

 src/freedreno/vulkan/tu_cmd_buffer.cc | 1 +
 src/freedreno/vulkan/tu_cmd_buffer.h  | 2 +-
 src/freedreno/vulkan/tu_pipeline.cc   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/vulkan/tu_cmd_buffer.cc 
b/src/freedreno/vulkan/tu_cmd_buffer.cc
index 7dda7891608..a4eae51e94d 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.cc
+++ b/src/freedreno/vulkan/tu_cmd_buffer.cc
@@ -3080,6 +3080,7 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
 
    if (pipeline->bandwidth.valid)
       cmd->state.bandwidth = pipeline->bandwidth;
+   cmd->state.pipeline_bandwidth = pipeline->bandwidth.valid;
 
    struct tu_cs *cs = &cmd->draw_cs;
 
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.h 
b/src/freedreno/vulkan/tu_cmd_buffer.h
index 31fda5e2b96..fd6265e627a 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.h
+++ b/src/freedreno/vulkan/tu_cmd_buffer.h
@@ -485,7 +485,7 @@ struct tu_cmd_state
    bool stencil_back_write;
    bool pipeline_feedback_loop_ds;
 
-   bool pipeline_blend_lrz;
+   bool pipeline_blend_lrz, pipeline_bandwidth;
    uint32_t pipeline_draw_states;
 
    /* VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT and
diff --git a/src/freedreno/vulkan/tu_pipeline.cc 
b/src/freedreno/vulkan/tu_pipeline.cc
index 3a85ddce8e0..46120fe9270 100644
--- a/src/freedreno/vulkan/tu_pipeline.cc
+++ b/src/freedreno/vulkan/tu_pipeline.cc
@@ -3615,7 +3615,7 @@ tu_emit_draw_state(struct tu_cmd_buffer *cmd)
    }
    if (EMIT_STATE(bandwidth) ||
        ((cmd->state.dirty & TU_CMD_DIRTY_SUBPASS) &&
-        !cmd->state.pipeline->base.bandwidth.valid))
+        !cmd->state.pipeline_bandwidth))
       tu_calc_bandwidth(&cmd->state.bandwidth, 
&cmd->vk.dynamic_graphics_state.cb,
                         &cmd->state.vk_rp);
    DRAW_STATE(blend_constants, VK_DYNAMIC_STATE_BLEND_CONSTANTS,

Reply via email to