Mesa (main): turnip: include stencil test for drawcall costs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 8 13:20:11 UTC 2022


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Thu May 26 14:32:17 2022 -0700

turnip: include stencil test for drawcall costs

Stencil test reads from and writes to the stencil buffer.

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

---

 src/freedreno/vulkan/tu_cmd_buffer.c | 6 ++++++
 1 file changed, 6 insertions(+)

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;



More information about the mesa-commit mailing list