zink: add some asserts for buffer replacement
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 3 Sep 2021 17:42:32 +0000 (13:42 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Sep 2021 03:40:54 +0000 (03:40 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12822>

src/gallium/drivers/zink/zink_context.c

index fc13f40..842b1aa 100644 (file)
@@ -3443,6 +3443,8 @@ zink_context_replace_buffer_storage(struct pipe_context *pctx, struct pipe_resou
    struct zink_context *ctx = zink_context(pctx);
 
    assert(d->internal_format == s->internal_format);
+   assert(d->obj);
+   assert(s->obj);
    util_idalloc_mt_free(&zink_screen(pctx->screen)->buffer_ids, delete_buffer_id);
    if (zink_resource_has_unflushed_usage(d))
       zink_batch_reference_resource(&ctx->batch, d);