Module: wine Branch: master Commit: 7bab2b6c37121dba070f75db95b78dd5816bfbd5 URL: https://gitlab.winehq.org/wine/wine/-/commit/7bab2b6c37121dba070f75db95b78dd...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Apr 10 13:55:35 2024 +0200
winewayland: Remove now unnecessary swapchain extents checks.
---
dlls/winewayland.drv/vulkan.c | 63 +------------------------------------------ 1 file changed, 1 insertion(+), 62 deletions(-)
diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c index f93ece1c068..99f20fe76d4 100644 --- a/dlls/winewayland.drv/vulkan.c +++ b/dlls/winewayland.drv/vulkan.c @@ -75,8 +75,6 @@ struct wine_vk_swapchain { struct list entry; VkSwapchainKHR host_swapchain; - HWND hwnd; - VkExtent2D extent; };
static struct wine_vk_surface *wine_vk_surface_from_handle(VkSurfaceKHR handle) @@ -141,58 +139,6 @@ static struct wine_vk_swapchain *wine_vk_swapchain_from_handle(VkSwapchainKHR ha return NULL; }
-static void vk_result_update_out_of_date(VkResult *res) -{ - /* If the current result is less severe than out_of_date, which for - * now applies to all non-failure results, update it. - * TODO: Handle VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT when - * it is supported by winevulkan, since it's also considered - * less severe than out_of_date. */ - if (*res >= 0) *res = VK_ERROR_OUT_OF_DATE_KHR; -} - -static VkResult check_queue_present(const VkPresentInfoKHR *present_info, - VkResult present_res) -{ - VkResult res = present_res; - uint32_t i; - - for (i = 0; i < present_info->swapchainCount; ++i) - { - struct wine_vk_swapchain *wine_vk_swapchain = - wine_vk_swapchain_from_handle(present_info->pSwapchains[i]); - HWND hwnd = wine_vk_swapchain->hwnd; - struct wayland_surface *wayland_surface; - - if ((wayland_surface = wayland_surface_lock_hwnd(hwnd))) - { - int client_width = wayland_surface->window.client_rect.right - - wayland_surface->window.client_rect.left; - int client_height = wayland_surface->window.client_rect.bottom - - wayland_surface->window.client_rect.top; - - pthread_mutex_unlock(&wayland_surface->mutex); - - if (client_width == wine_vk_swapchain->extent.width && - client_height == wine_vk_swapchain->extent.height) - { - /* The window is still available and matches the swapchain size, - * so there is no new error to report. */ - continue; - } - } - - /* We use the out_of_date error even if the window is no longer - * available, to match win32 behavior (e.g., nvidia). The application - * will get surface_lost when it tries to recreate the swapchain. */ - if (present_info->pResults) - vk_result_update_out_of_date(&present_info->pResults[i]); - vk_result_update_out_of_date(&res); - } - - return res; -} - static VkResult wayland_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *create_info, const VkAllocationCallbacks *allocator, @@ -216,9 +162,6 @@ static VkResult wayland_vkCreateSwapchainKHR(VkDevice device, if (!wine_vk_swapchain) return VK_ERROR_OUT_OF_HOST_MEMORY;
- wine_vk_swapchain->hwnd = wine_vk_surface_get_hwnd(wine_vk_surface); - wine_vk_swapchain->extent = create_info->imageExtent; - create_info_host = *create_info; create_info_host.surface = wine_vk_surface->host_surface;
@@ -356,13 +299,9 @@ static VkBool32 wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysica
static VkResult wayland_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info, HWND *surfaces) { - VkResult res; - TRACE("%p, %p\n", queue, present_info);
- res = pvkQueuePresentKHR(queue, present_info); - - return check_queue_present(present_info, res); + return pvkQueuePresentKHR(queue, present_info); }
static const char *wayland_get_host_surface_extension(void)