zink: always reset batch states when finding a new one

this is a bit safer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9753>
This commit is contained in:
Mike Blumenkrantz 2021-03-21 10:45:48 -04:00 committed by Marge Bot
parent d54688f1e8
commit a8d925f52e

View file

@ -202,10 +202,11 @@ init_batch_state(struct zink_context *ctx, struct zink_batch *batch)
if (he) { //there may not be any entries available
bs = he->data;
_mesa_hash_table_remove(&ctx->batch_states[batch->queue], he);
zink_reset_batch_state(ctx, bs);
}
}
if (!bs) {
if (bs)
zink_reset_batch_state(ctx, bs);
else {
if (!batch->state) {
/* this is batch init, so create a few more states for later use */
for (int i = 0; i < 3; i++) {