radv/gfx10: enable VK_EXT_transform_feedback
[mesa.git] / src / amd / vulkan / radv_wsi.c
index 204841771354fddc3e75ad6064cd182abd4484ea..fadb68a9504e02ca5b1e6c0adca92131c9e5947d 100644 (file)
@@ -42,7 +42,8 @@ radv_init_wsi(struct radv_physical_device *physical_device)
                               radv_physical_device_to_handle(physical_device),
                               radv_wsi_proc_addr,
                               &physical_device->instance->alloc,
-                              physical_device->master_fd);
+                              physical_device->master_fd,
+                              &physical_device->instance->dri_options);
 }
 
 void
@@ -72,10 +73,8 @@ VkResult radv_GetPhysicalDeviceSurfaceSupportKHR(
        RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice);
 
        return wsi_common_get_surface_support(&device->wsi_device,
-                                             device->local_fd,
                                              queueFamilyIndex,
                                              surface,
-                                             &device->instance->alloc,
                                              pSupported);
 }
 
@@ -172,7 +171,6 @@ VkResult radv_CreateSwapchainKHR(
 
        return wsi_common_create_swapchain(&device->physical_device->wsi_device,
                                           radv_device_to_handle(device),
-                                          device->physical_device->local_fd,
                                           pCreateInfo,
                                           alloc,
                                           pSwapchain);
@@ -206,27 +204,42 @@ VkResult radv_GetSwapchainImagesKHR(
 }
 
 VkResult radv_AcquireNextImageKHR(
-       VkDevice                                     _device,
+       VkDevice                                     device,
        VkSwapchainKHR                               swapchain,
        uint64_t                                     timeout,
        VkSemaphore                                  semaphore,
-       VkFence                                      _fence,
+       VkFence                                      fence,
+       uint32_t*                                    pImageIndex)
+{
+       VkAcquireNextImageInfoKHR acquire_info = {
+               .sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR,
+               .swapchain = swapchain,
+               .timeout = timeout,
+               .semaphore = semaphore,
+               .fence = fence,
+               .deviceMask = 0,
+       };
+
+       return radv_AcquireNextImage2KHR(device, &acquire_info, pImageIndex);
+}
+
+VkResult radv_AcquireNextImage2KHR(
+       VkDevice                                     _device,
+       const VkAcquireNextImageInfoKHR*             pAcquireInfo,
        uint32_t*                                    pImageIndex)
 {
        RADV_FROM_HANDLE(radv_device, device, _device);
        struct radv_physical_device *pdevice = device->physical_device;
-       RADV_FROM_HANDLE(radv_fence, fence, _fence);
+       RADV_FROM_HANDLE(radv_fence, fence, pAcquireInfo->fence);
 
-       VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device,
-                                                       _device,
-                                                       swapchain,
-                                                       timeout,
-                                                       semaphore,
-                                                       pImageIndex);
+       VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
+                                                        _device,
+                                                         pAcquireInfo,
+                                                        pImageIndex);
 
        if (fence && (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR)) {
-               fence->submitted = true;
-               fence->signalled = true;
+               if (fence->fence)
+                       device->ws->signal_fence(fence->fence);
                if (fence->temp_syncobj) {
                        device->ws->signal_syncobj(device->ws, fence->temp_syncobj);
                } else if (fence->syncobj) {
@@ -270,3 +283,16 @@ VkResult radv_GetDeviceGroupSurfacePresentModesKHR(
 
    return VK_SUCCESS;
 }
+
+VkResult radv_GetPhysicalDevicePresentRectanglesKHR(
+       VkPhysicalDevice                            physicalDevice,
+       VkSurfaceKHR                                surface,
+       uint32_t*                                   pRectCount,
+       VkRect2D*                                   pRects)
+{
+       RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice);
+
+       return wsi_common_get_present_rectangles(&device->wsi_device,
+                                                surface,
+                                                pRectCount, pRects);
+}