according to spec, the maximum number of acquired images can be calculated with
swapchain_size - VkSurfaceCapabilitiesKHR::minImageCount + 1
the previous calculation was both wrong and occurring in the wrong place,
so this corrects both issues
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21095>
*result = error;
return NULL;
}
- cswap->max_acquires = cswap->scci.minImageCount - cdt->caps.minImageCount;
cswap->last_present = UINT32_MAX;
*result = VK_SUCCESS;
for (unsigned i = 0; i < cswap->num_images; i++)
cswap->images[i].image = images[i];
}
+ cswap->max_acquires = cswap->num_images - cswap->scci.minImageCount + 1;
return error;
}
res->obj->access_stage = 0;
}
if (timeout == UINT64_MAX && util_queue_is_initialized(&screen->flush_queue) &&
- p_atomic_read_relaxed(&cdt->swapchain->num_acquires) > cdt->swapchain->max_acquires) {
+ p_atomic_read_relaxed(&cdt->swapchain->num_acquires) >= cdt->swapchain->max_acquires) {
util_queue_fence_wait(&cdt->present_fence);
}
VkResult ret;