mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 03:30:10 +01:00
zink: improve no-op acquire detection
the swapchain may have successfully completed the acquire in a previous batch, in which case a new acquire is not needed Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17149>
This commit is contained in:
parent
49d9a3605b
commit
8606e5cff8
1 changed files with 10 additions and 1 deletions
|
|
@ -450,7 +450,16 @@ static VkResult
|
|||
kopper_acquire(struct zink_screen *screen, struct zink_resource *res, uint64_t timeout)
|
||||
{
|
||||
struct kopper_displaytarget *cdt = kopper_displaytarget(res->obj->dt);
|
||||
if (res->obj->acquire)
|
||||
|
||||
/* if:
|
||||
* - we don't need a new image
|
||||
* - we have a swapchain image
|
||||
* - that image is either acquired or acquiring
|
||||
*
|
||||
* then this is a no-op
|
||||
*/
|
||||
if (!res->obj->new_dt && res->obj->dt_idx != UINT32_MAX &&
|
||||
(cdt->swapchain->images[res->obj->dt_idx].acquire || cdt->swapchain->images[res->obj->dt_idx].acquired))
|
||||
return VK_SUCCESS;
|
||||
res->obj->acquire = VK_NULL_HANDLE;
|
||||
VkSemaphore acquire = VK_NULL_HANDLE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue