iris: Destroy all batches with a new iris_destroy_batches() function
Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12692>
This commit is contained in:
@@ -460,7 +460,7 @@ iris_batch_reset(struct iris_batch *batch)
|
||||
iris_batch_maybe_noop(batch);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
iris_batch_free(struct iris_batch *batch)
|
||||
{
|
||||
struct iris_screen *screen = batch->screen;
|
||||
@@ -499,6 +499,13 @@ iris_batch_free(struct iris_batch *batch)
|
||||
intel_batch_decode_ctx_finish(&batch->decoder);
|
||||
}
|
||||
|
||||
void
|
||||
iris_destroy_batches(struct iris_context *ice)
|
||||
{
|
||||
for (int i = 0; i < IRIS_BATCH_COUNT; i++)
|
||||
iris_batch_free(&ice->batches[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* If we've chained to a secondary batch, or are getting near to the end,
|
||||
* then flush. This should only be called between draws.
|
||||
|
||||
@@ -179,7 +179,7 @@ struct iris_batch {
|
||||
|
||||
void iris_init_batches(struct iris_context *ice, int priority);
|
||||
void iris_chain_to_new_batch(struct iris_batch *batch);
|
||||
void iris_batch_free(struct iris_batch *batch);
|
||||
void iris_destroy_batches(struct iris_context *ice);
|
||||
void iris_batch_maybe_flush(struct iris_batch *batch, unsigned estimate);
|
||||
|
||||
void _iris_batch_flush(struct iris_batch *batch, const char *file, int line);
|
||||
|
||||
@@ -240,8 +240,7 @@ iris_destroy_context(struct pipe_context *ctx)
|
||||
u_upload_destroy(ice->state.dynamic_uploader);
|
||||
u_upload_destroy(ice->query_buffer_uploader);
|
||||
|
||||
iris_batch_free(&ice->batches[IRIS_BATCH_RENDER]);
|
||||
iris_batch_free(&ice->batches[IRIS_BATCH_COMPUTE]);
|
||||
iris_destroy_batches(ice);
|
||||
iris_destroy_binder(&ice->state.binder);
|
||||
|
||||
slab_destroy_child(&ice->transfer_pool);
|
||||
|
||||
Reference in New Issue
Block a user