mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28: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>
(cherry picked from commit 020db79340)
This commit is contained in:
parent
440050346e
commit
73091e4d27
2 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue