radeonsi: move code around si_pm4_emit_state into si_pm4_emit_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24732>
This commit is contained in:
@@ -332,10 +332,14 @@ void si_pm4_emit_commands(struct si_context *sctx, struct si_pm4_state *state)
|
||||
radeon_end();
|
||||
}
|
||||
|
||||
void si_pm4_emit_state(struct si_context *sctx, struct si_pm4_state *state)
|
||||
void si_pm4_emit_state(struct si_context *sctx, unsigned index)
|
||||
{
|
||||
struct si_pm4_state *state = sctx->queued.array[index];
|
||||
struct radeon_cmdbuf *cs = &sctx->gfx_cs;
|
||||
|
||||
/* All places should unset dirty_states if this doesn't pass. */
|
||||
assert(state && state != sctx->emitted.array[index]);
|
||||
|
||||
if (state->is_shader) {
|
||||
radeon_add_to_buffer_list(sctx, cs, ((struct si_shader*)state)->bo,
|
||||
RADEON_USAGE_READ | RADEON_PRIO_SHADER_BINARY);
|
||||
@@ -347,6 +351,8 @@ void si_pm4_emit_state(struct si_context *sctx, struct si_pm4_state *state)
|
||||
|
||||
if (state->atom.emit)
|
||||
state->atom.emit(sctx, -1);
|
||||
|
||||
sctx->emitted.array[index] = state;
|
||||
}
|
||||
|
||||
void si_pm4_reset_emitted(struct si_context *sctx)
|
||||
|
||||
@@ -62,7 +62,7 @@ void si_pm4_clear_state(struct si_pm4_state *state, struct si_screen *sscreen,
|
||||
void si_pm4_free_state(struct si_context *sctx, struct si_pm4_state *state, unsigned idx);
|
||||
|
||||
void si_pm4_emit_commands(struct si_context *sctx, struct si_pm4_state *state);
|
||||
void si_pm4_emit_state(struct si_context *sctx, struct si_pm4_state *state);
|
||||
void si_pm4_emit_state(struct si_context *sctx, unsigned index);
|
||||
void si_pm4_reset_emitted(struct si_context *sctx);
|
||||
struct si_pm4_state *si_pm4_create_sized(struct si_screen *sscreen, unsigned max_dw,
|
||||
bool is_compute_queue);
|
||||
|
||||
@@ -1954,13 +1954,7 @@ static void si_emit_all_states(struct si_context *sctx, unsigned skip_atom_mask)
|
||||
if (mask) {
|
||||
do {
|
||||
unsigned i = u_bit_scan(&mask);
|
||||
struct si_pm4_state *state = sctx->queued.array[i];
|
||||
|
||||
/* All places should unset dirty_states if this doesn't pass. */
|
||||
assert(state && state != sctx->emitted.array[i]);
|
||||
|
||||
si_pm4_emit_state(sctx, state);
|
||||
sctx->emitted.array[i] = state;
|
||||
si_pm4_emit_state(sctx, i);
|
||||
} while (mask);
|
||||
|
||||
sctx->dirty_states = 0;
|
||||
|
||||
Reference in New Issue
Block a user