state->bo_priority[idx] = priority;
}
+void si_pm4_free_state_simple(struct si_pm4_state *state)
+{
+ for (int i = 0; i < state->nbo; ++i)
+ r600_resource_reference(&state->bo[i], NULL);
+ FREE(state);
+}
+
void si_pm4_free_state(struct si_context *sctx,
struct si_pm4_state *state,
unsigned idx)
sctx->emitted.array[idx] = NULL;
}
- for (int i = 0; i < state->nbo; ++i) {
- r600_resource_reference(&state->bo[i], NULL);
- }
- FREE(state);
+ si_pm4_free_state_simple(state);
}
unsigned si_pm4_dirty_dw(struct si_context *sctx)
enum radeon_bo_usage usage,
enum radeon_bo_priority priority);
+void si_pm4_free_state_simple(struct si_pm4_state *state);
void si_pm4_free_state(struct si_context *sctx,
struct si_pm4_state *state,
unsigned idx);
static void si_shader_init_pm4_state(struct si_shader *shader)
{
+
+ if (shader->pm4)
+ si_pm4_free_state_simple(shader->pm4);
+
switch (shader->selector->type) {
case PIPE_SHADER_VERTEX:
if (shader->key.vs.as_es)