mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
radv: track DB_COUNT_CONTROL changes to avoid context rolls
This can be really noticeable for the BeginQuery/Draw/EndQuery pattern. It seems to improve a depth-only pass by +35% in one upcoming game because this removes a bunch of context rolls. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22556>
This commit is contained in:
parent
02443d752e
commit
c1d32880f7
2 changed files with 10 additions and 2 deletions
|
|
@ -3661,9 +3661,13 @@ radv_flush_occlusion_query_state(struct radv_cmd_buffer *cmd_buffer)
|
|||
}
|
||||
}
|
||||
|
||||
radeon_set_context_reg(cmd_buffer->cs, R_028004_DB_COUNT_CONTROL, db_count_control);
|
||||
if (db_count_control != cmd_buffer->state.last_db_count_control) {
|
||||
radeon_set_context_reg(cmd_buffer->cs, R_028004_DB_COUNT_CONTROL, db_count_control);
|
||||
|
||||
cmd_buffer->state.context_roll_without_scissor_emitted = true;
|
||||
cmd_buffer->state.context_roll_without_scissor_emitted = true;
|
||||
|
||||
cmd_buffer->state.last_db_count_control = db_count_control;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
|
|
@ -5842,6 +5846,7 @@ radv_BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBegi
|
|||
cmd_buffer->state.last_vrs_rates = -1;
|
||||
cmd_buffer->state.last_vrs_rates_sgpr_idx = -1;
|
||||
cmd_buffer->state.last_pa_sc_binner_cntl_0 = -1;
|
||||
cmd_buffer->state.last_db_count_control = -1;
|
||||
cmd_buffer->usage_flags = pBeginInfo->flags;
|
||||
|
||||
cmd_buffer->state.dirty |= RADV_CMD_DIRTY_DYNAMIC_ALL | RADV_CMD_DIRTY_GUARDBAND |
|
||||
|
|
@ -7651,6 +7656,7 @@ radv_CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCou
|
|||
primary->state.last_first_instance = -1;
|
||||
primary->state.last_drawid = -1;
|
||||
primary->state.last_vertex_offset = -1;
|
||||
primary->state.last_db_count_control = -1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -1627,6 +1627,8 @@ struct radv_cmd_state {
|
|||
uint32_t last_sx_blend_opt_epsilon;
|
||||
uint32_t last_sx_blend_opt_control;
|
||||
|
||||
uint32_t last_db_count_control;
|
||||
|
||||
/* Whether CP DMA is busy/idle. */
|
||||
bool dma_is_busy;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue