diff --git a/.pick_status.json b/.pick_status.json index 9792d6d0485..fc19c5c4a92 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1084,7 +1084,7 @@ "description": "zink: preserve present resources during async presentation", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_kopper.c b/src/gallium/drivers/zink/zink_kopper.c index 992686cd31e..88b99e6be7d 100644 --- a/src/gallium/drivers/zink/zink_kopper.c +++ b/src/gallium/drivers/zink/zink_kopper.c @@ -733,8 +733,11 @@ kopper_present(void *data, void *gdata, int thread_idx) } util_dynarray_append(arr, VkSemaphore, cpi->sem); out: - if (thread_idx != -1) + if (thread_idx != -1) { p_atomic_dec(&swapchain->async_presents); + struct pipe_resource *pres = &cpi->res->base.b; + pipe_resource_reference(&pres, NULL); + } free(cpi); } @@ -778,6 +781,8 @@ zink_kopper_present_queue(struct zink_screen *screen, struct zink_resource *res) } if (util_queue_is_initialized(&screen->flush_queue)) { p_atomic_inc(&cpi->swapchain->async_presents); + struct pipe_resource *pres = NULL; + pipe_resource_reference(&pres, &res->base.b); util_queue_add_job(&screen->flush_queue, cpi, &cdt->present_fence, kopper_present, NULL, 0); } else {