From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/vulkan.c | 2 +- dlls/winevulkan/vulkan.c | 12 +++--------- include/wine/vulkan_driver.h | 1 - 3 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index 77999d0a0b9..3b80debfe83 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -1256,7 +1256,7 @@ static VkResult win32u_vkCreateSwapchainKHR( VkDevice client_device, const VkSwa */ if (NtUserGetClientRect( surface->hwnd, &client_rect, NtUserGetWinMonitorDpi( surface->hwnd, MDT_RAW_DPI ) ) && !extents_equals( &create_info_host.imageExtent, &client_rect ) && - physical_device->has_surface_maintenance1 && physical_device->has_swapchain_maintenance1) + instance->extensions.has_VK_EXT_surface_maintenance1 && physical_device->has_swapchain_maintenance1) { scaling.scalingBehavior = VK_PRESENT_SCALING_STRETCH_BIT_EXT; create_info_host.pNext = &scaling; diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 9398b3056bd..de51382e411 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -386,8 +386,6 @@ static VkResult vulkan_physical_device_init(struct vulkan_physical_device *physi have_external_semaphore = TRUE; else if (!strcmp(host_properties[i].extensionName, "VK_EXT_map_memory_placed")) have_memory_placed = TRUE; - else if (!strcmp(host_properties[i].extensionName, "VK_EXT_surface_maintenance1")) - physical_device->has_surface_maintenance1 = true; else if (!strcmp(host_properties[i].extensionName, "VK_EXT_swapchain_maintenance1")) physical_device->has_swapchain_maintenance1 = true; else if (!strcmp(host_properties[i].extensionName, "VK_KHR_map_memory2")) @@ -571,7 +569,6 @@ static VkResult wine_vk_device_convert_create_info(struct vulkan_physical_device { bool has_swapchain_maintenance1 = false; bool has_external_memory_host = false; - bool has_surface_maintenance1 = false; bool has_map_memory_placed = false; bool has_external_memory = false; bool has_map_memory2 = false; @@ -602,7 +599,6 @@ static VkResult wine_vk_device_convert_create_info(struct vulkan_physical_device if (!strcmp(*extension, "VK_KHR_external_memory")) has_external_memory = true; if (!strcmp(*extension, "VK_EXT_external_memory_host")) has_external_memory_host = true; if (!strcmp(*extension, "VK_EXT_swapchain_maintenance1")) has_swapchain_maintenance1 = true; - if (!strcmp(*extension, "VK_EXT_surface_maintenance1")) has_surface_maintenance1 = true; if (!strcmp(*extension, "VK_KHR_swapchain")) has_swapchain = true; if (!strcmp(*extension, "VK_KHR_win32_keyed_mutex")) { @@ -653,12 +649,8 @@ static VkResult wine_vk_device_convert_create_info(struct vulkan_physical_device }
/* win32u uses VkSwapchainPresentScalingCreateInfoEXT if available. */ - if (physical_device->has_surface_maintenance1 && physical_device->has_swapchain_maintenance1 && - has_swapchain && !has_swapchain_maintenance1) - { - if (!has_surface_maintenance1) extensions[count++] = "VK_EXT_surface_maintenance1"; + if (physical_device->has_swapchain_maintenance1 && has_swapchain && !has_swapchain_maintenance1) extensions[count++] = "VK_EXT_swapchain_maintenance1"; - }
TRACE("Enabling %u device extensions\n", count); for (const char **extension = extensions, **end = extension + count; extension < end; extension++) @@ -797,6 +789,8 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context * pthread_rwlock_init(&instance->objects_lock, NULL); }
+ if (instance->obj.extensions.has_VK_KHR_win32_surface && instance_extensions.has_VK_EXT_surface_maintenance1) + instance->obj.extensions.has_VK_EXT_surface_maintenance1 = 1; if (use_external_memory()) { instance->obj.extensions.has_VK_KHR_get_physical_device_properties2 = 1; diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 4cc8f304cab..11568c72560 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -116,7 +116,6 @@ struct vulkan_physical_device { VULKAN_OBJECT_HEADER( VkPhysicalDevice, physical_device ); struct vulkan_instance *instance; - bool has_surface_maintenance1; bool has_swapchain_maintenance1;
VkExtensionProperties *extensions;