diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 0618b0f24e3d..6a551abd0176 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -736,7 +736,8 @@ static void tu6_emit_cond_for_load_stores(struct tu_cmd_buffer *cmd, struct tu_cs *cs, uint32_t pipe, uint32_t slot, bool skip_wfm) { - if (cmd->state.tiling->binning_possible) { + if (cmd->state.tiling->binning_possible && + cmd->state.pass->has_cond_load_store) { tu_cs_emit_pkt7(cs, CP_REG_TEST, 1); tu_cs_emit(cs, A6XX_CP_REG_TEST_0_REG(REG_A6XX_VSC_STATE_REG(pipe)) | A6XX_CP_REG_TEST_0_BIT(slot) | @@ -855,8 +856,10 @@ tu6_emit_tile_load(struct tu_cmd_buffer *cmd, struct tu_cs *cs) { tu6_emit_blit_scissor(cmd, cs, true); + const bool cond_exec_allowed = cmd->state.tiling->binning && + cmd->state.pass->has_cond_load_store; for (uint32_t i = 0; i < cmd->state.pass->attachment_count; ++i) - tu_load_gmem_attachment(cmd, cs, i, cmd->state.tiling->binning, false); + tu_load_gmem_attachment(cmd, cs, i, cond_exec_allowed, false); } static void @@ -873,9 +876,11 @@ tu6_emit_tile_store(struct tu_cmd_buffer *cmd, struct tu_cs *cs) for (uint32_t a = 0; a < pass->attachment_count; ++a) { if (pass->attachments[a].gmem) { + const bool cond_exec_allowed = cmd->state.tiling->binning_possible && + cmd->state.pass->has_cond_load_store; tu_store_gmem_attachment(cmd, cs, a, a, fb->layers, subpass->multiview_mask, - cmd->state.tiling->binning_possible); + cond_exec_allowed); } } diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c index e84604575dbf..0b06dc31a227 100644 --- a/src/freedreno/vulkan/tu_pass.c +++ b/src/freedreno/vulkan/tu_pass.c @@ -547,6 +547,9 @@ tu_render_pass_cond_config(struct tu_render_pass *pass) (att->load || att->load_stencil) && !att->clear_mask && !att->will_be_resolved; att->cond_store_allowed = (att->store || att->store_stencil) && !att->clear_mask; + + pass->has_cond_load_store |= + att->cond_load_allowed | att->cond_store_allowed; } } diff --git a/src/freedreno/vulkan/tu_pass.h b/src/freedreno/vulkan/tu_pass.h index a43288ef4b11..3c0b0785fec3 100644 --- a/src/freedreno/vulkan/tu_pass.h +++ b/src/freedreno/vulkan/tu_pass.h @@ -108,7 +108,10 @@ struct tu_render_pass uint32_t sysmem_bandwidth_per_pixel; struct tu_subpass_attachment *subpass_attachments; + struct tu_render_pass_attachment *attachments; + bool has_cond_load_store; + struct tu_subpass_barrier end_barrier; struct tu_subpass subpasses[0]; };