mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
radv: Move indirect check from index buffer emission to caller.
This improves the CPU overhead of radv_emit_all_graphics_states. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20659>
This commit is contained in:
parent
8436fe5af4
commit
0d14f7a304
1 changed files with 3 additions and 8 deletions
|
|
@ -3689,7 +3689,7 @@ radv_emit_guardband_state(struct radv_cmd_buffer *cmd_buffer)
|
|||
}
|
||||
|
||||
static void
|
||||
radv_emit_index_buffer(struct radv_cmd_buffer *cmd_buffer, bool indirect)
|
||||
radv_emit_index_buffer(struct radv_cmd_buffer *cmd_buffer)
|
||||
{
|
||||
struct radeon_cmdbuf *cs = cmd_buffer->cs;
|
||||
struct radv_cmd_state *state = &cmd_buffer->state;
|
||||
|
|
@ -3699,11 +3699,6 @@ radv_emit_index_buffer(struct radv_cmd_buffer *cmd_buffer, bool indirect)
|
|||
if (state->index_type < 0)
|
||||
return;
|
||||
|
||||
/* For the direct indexed draws we use DRAW_INDEX_2, which includes
|
||||
* the index_va and max_index_count already. */
|
||||
if (!indirect)
|
||||
return;
|
||||
|
||||
if (state->max_index_count ||
|
||||
!cmd_buffer->device->physical_device->rad_info.has_zero_index_buffer_bug) {
|
||||
radeon_emit(cs, PKT3(PKT3_INDEX_BASE, 1, 0));
|
||||
|
|
@ -9136,8 +9131,8 @@ radv_emit_all_graphics_states(struct radv_cmd_buffer *cmd_buffer, const struct r
|
|||
if (cmd_buffer->state.dirty & RADV_CMD_DIRTY_GUARDBAND)
|
||||
radv_emit_guardband_state(cmd_buffer);
|
||||
|
||||
if (info->indexed && cmd_buffer->state.dirty & RADV_CMD_DIRTY_INDEX_BUFFER)
|
||||
radv_emit_index_buffer(cmd_buffer, info->indirect);
|
||||
if (info->indexed && info->indirect && cmd_buffer->state.dirty & RADV_CMD_DIRTY_INDEX_BUFFER)
|
||||
radv_emit_index_buffer(cmd_buffer);
|
||||
|
||||
radv_cmd_buffer_flush_dynamic_state(cmd_buffer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue