iris: Don't leak scratch BOs

Fixes: 4d219b0eb3 ("iris: implement scratch space!")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15897>
This commit is contained in:
Jason Ekstrand 2022-04-12 11:45:41 -05:00 committed by Marge Bot
parent 394b93bfeb
commit 6ca328988f

View file

@ -232,6 +232,11 @@ iris_destroy_context(struct pipe_context *ctx)
for (unsigned i = 0; i < ARRAY_SIZE(ice->shaders.scratch_surfs); i++)
pipe_resource_reference(&ice->shaders.scratch_surfs[i].res, NULL);
for (unsigned i = 0; i < ARRAY_SIZE(ice->shaders.scratch_bos); i++) {
for (unsigned j = 0; j < ARRAY_SIZE(ice->shaders.scratch_bos[i]); j++)
iris_bo_unreference(ice->shaders.scratch_bos[i][j]);
}
iris_destroy_program_cache(ice);
if (screen->measure.config)
iris_destroy_ctx_measure(ice);