mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
zink: preserve present resources during async presentation
ensure that these have a lifetime great enough to be presented fixes #7781 cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20793>
This commit is contained in:
parent
482e215a67
commit
020db79340
1 changed files with 6 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
@ -783,6 +786,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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue