X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Famd%2Fvulkan%2Fradv_wsi.c;h=346fb43d67541f67628e0fc1417382b65749fcce;hb=baa38c144f6ab544bccabff3739631bab33e4cd7;hp=2840b6667273d53fb58498f46cf49287218630b6;hpb=da997ebec92942193955386535813374286b7fb1;p=mesa.git diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index 2840b666727..346fb43d675 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -72,10 +72,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); } @@ -103,6 +101,18 @@ VkResult radv_GetPhysicalDeviceSurfaceCapabilities2KHR( pSurfaceCapabilities); } +VkResult radv_GetPhysicalDeviceSurfaceCapabilities2EXT( + VkPhysicalDevice physicalDevice, + VkSurfaceKHR surface, + VkSurfaceCapabilities2EXT* pSurfaceCapabilities) +{ + RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); + + return wsi_common_get_surface_capabilities2ext(&device->wsi_device, + surface, + pSurfaceCapabilities); +} + VkResult radv_GetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, @@ -160,7 +170,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); @@ -194,23 +203,38 @@ 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; @@ -258,3 +282,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); +}