- VkResult result = VK_SUCCESS;
-
- for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) {
- RADV_FROM_HANDLE(radv_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
-
- assert(swapchain->device == queue->device);
- if (swapchain->fences[0] == VK_NULL_HANDLE) {
- result = radv_CreateFence(radv_device_to_handle(queue->device),
- &(VkFenceCreateInfo) {
- .sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
- .flags = 0,
- }, &swapchain->alloc, &swapchain->fences[0]);
- if (result != VK_SUCCESS)
- return result;
- } else {
- radv_ResetFences(radv_device_to_handle(queue->device),
- 1, &swapchain->fences[0]);
- }
-
- radv_QueueSubmit(_queue, 0, NULL, swapchain->fences[0]);
+ return wsi_common_queue_present(&queue->device->physical_device->wsi_device,
+ radv_device_to_handle(queue->device),
+ _queue,
+ queue->queue_family_index,
+ pPresentInfo);
+}