diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index abd600d8ed9..4ef64585922 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -3992,11 +3992,17 @@ tu6_draw_common(struct tu_cmd_buffer *cmd, cmd->state.drawcall_count++; cmd->state.total_drawcalls_cost += cmd->state.pipeline->drawcall_base_cost; + + /* add depth memory bandwidth cost */ if (cmd->state.rb_depth_cntl & A6XX_RB_DEPTH_CNTL_Z_WRITE_ENABLE) cmd->state.total_drawcalls_cost++; if (cmd->state.rb_depth_cntl & A6XX_RB_DEPTH_CNTL_Z_TEST_ENABLE) cmd->state.total_drawcalls_cost++; + /* add stencil memory bandwidth cost */ + if (cmd->state.rb_stencil_cntl & A6XX_RB_STENCIL_CONTROL_STENCIL_ENABLE) + cmd->state.total_drawcalls_cost += 2; + tu_emit_cache_flush_renderpass(cmd, cs); bool primitive_restart_enabled = pipeline->ia.primitive_restart;