- for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) {
- ANV_FROM_HANDLE(anv_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
-
- assert(swapchain->device == queue->device);
-
- if (swapchain->fences[0] == VK_NULL_HANDLE) {
- result = anv_CreateFence(anv_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 {
- anv_ResetFences(anv_device_to_handle(queue->device),
- 1, &swapchain->fences[0]);
- }
-
- anv_QueueSubmit(_queue, 0, NULL, swapchain->fences[0]);
-
- result = swapchain->queue_present(swapchain, queue,
- pPresentInfo->pImageIndices[i]);
- /* TODO: What if one of them returns OUT_OF_DATE? */
- if (result != VK_SUCCESS)
- return result;
-
- VkFence last = swapchain->fences[2];
- swapchain->fences[2] = swapchain->fences[1];
- swapchain->fences[1] = swapchain->fences[0];
- swapchain->fences[0] = last;
-
- if (last != VK_NULL_HANDLE) {
- anv_WaitForFences(anv_device_to_handle(queue->device),
- 1, &last, true, 1);
- }
- }
+ return wsi_common_queue_present(&pdevice->wsi_device,
+ anv_device_to_handle(queue->device),
+ _queue, 0,
+ pPresentInfo);
+}
+
+VkResult anv_GetDeviceGroupPresentCapabilitiesKHR(
+ VkDevice device,
+ VkDeviceGroupPresentCapabilitiesKHR* pCapabilities)
+{
+ memset(pCapabilities->presentMask, 0,
+ sizeof(pCapabilities->presentMask));
+ pCapabilities->presentMask[0] = 0x1;
+ pCapabilities->modes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR;
+
+ return VK_SUCCESS;
+}
+
+VkResult anv_GetDeviceGroupSurfacePresentModesKHR(
+ VkDevice device,
+ VkSurfaceKHR surface,
+ VkDeviceGroupPresentModeFlagsKHR* pModes)
+{
+ *pModes = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR;