freedreno: Flush batches upon destroying the ctx.
authorEmma Anholt <emma@anholt.net>
Tue, 15 Jun 2021 20:58:50 +0000 (13:58 -0700)
committerEmma Anholt <emma@anholt.net>
Thu, 17 Jun 2021 16:11:57 +0000 (09:11 -0700)
commitac9ae97d304c5050262285db6d2fe4897a932653
tree9a94067bc08b5cabce0e0e223d3fac64af72f807
parent2a9225d05f544925cd8f92fff41af61f71a69dfa
freedreno: Flush batches upon destroying the ctx.

The invalidate would take it out of the bc tracking, so you could go
allocate a new batch->idx matching this one, while this one is still in
the bc using that idx.

You can't generate any new rendering with the ctx's old batches at this
point, anyway, so just flush for simplicity.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>
src/gallium/drivers/freedreno/freedreno_batch_cache.c
src/gallium/drivers/freedreno/freedreno_batch_cache.h
src/gallium/drivers/freedreno/freedreno_context.c