zink: only update last_finished during batch reset if the batch was used

0 is never a valid batch_id, so don't try to update this

minor cosmetic change

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11437>
This commit is contained in:
Mike Blumenkrantz 2021-04-08 09:09:06 -04:00 committed by Marge Bot
parent 56c7e69c4d
commit 618784732a
1 changed files with 2 additions and 1 deletions

View File

@ -91,7 +91,8 @@ zink_reset_batch_state(struct zink_context *ctx, struct zink_batch_state *bs)
*/
bs->fence.submitted = false;
bs->has_barriers = false;
zink_screen_update_last_finished(screen, bs->fence.batch_id);
if (bs->fence.batch_id)
zink_screen_update_last_finished(screen, bs->fence.batch_id);
bs->fence.batch_id = 0;
bs->draw_count = bs->compute_count = 0;
}