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>
This commit is contained in:
Chia-I Wu 2022-05-26 14:32:17 -07:00 committed by Marge Bot
parent 2dc10165a1
commit fe9a2374e6

View file

@ -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;