}
static VkResult wsi_signal_present_id_timeline(struct wsi_swapchain *swapchain,
- VkQueue queue, uint64_t present_id)
+ VkQueue queue, uint64_t present_id,
+ VkFence present_fence)
{
- assert(swapchain->present_id_timeline);
+ assert(swapchain->present_id_timeline || present_fence);
const VkTimelineSemaphoreSubmitInfo timeline_info = {
.sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO,
.pSignalSemaphores = &swapchain->present_id_timeline,
};
- return swapchain->wsi->QueueSubmit(queue, 1, &submit_info, VK_NULL_HANDLE);
+ uint32_t submit_count = present_id ? 1 : 0;
+ return swapchain->wsi->QueueSubmit(queue, submit_count, &submit_info, present_fence);
}
VkResult
vk_find_struct_const(pPresentInfo->pNext, PRESENT_REGIONS_KHR);
const VkPresentIdKHR *present_ids =
vk_find_struct_const(pPresentInfo->pNext, PRESENT_ID_KHR);
+ const VkSwapchainPresentFenceInfoEXT *present_fence_info =
+ vk_find_struct_const(pPresentInfo->pNext, SWAPCHAIN_PRESENT_FENCE_INFO_EXT);
for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) {
VK_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
uint64_t present_id = 0;
if (present_ids && present_ids->pPresentIds)
present_id = present_ids->pPresentIds[i];
+ VkFence present_fence = VK_NULL_HANDLE;
+ if (present_fence_info && present_fence_info->pFences)
+ present_fence = present_fence_info->pFences[i];
- if (present_id) {
- result = wsi_signal_present_id_timeline(swapchain, queue, present_id);
+ if (present_id || present_fence) {
+ result = wsi_signal_present_id_timeline(swapchain, queue, present_id, present_fence);
if (result != VK_SUCCESS)
goto fail_present;
}