winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2024
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
590 discussions
Start a n
N
ew thread
Rémi Bernon : winevulkan: Remove unnecessary vkGetSwapchainImagesKHR driver entry.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: a0ace8f09f72af9a2deb3d3de25f08cea33838d1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a0ace8f09f72af9a2deb3d3de25f08…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Feb 24 12:40:06 2024 +0100 winevulkan: Remove unnecessary vkGetSwapchainImagesKHR driver entry. --- dlls/win32u/vulkan.c | 2 -- dlls/winemac.drv/vulkan.c | 10 ---------- dlls/winevulkan/make_vulkan | 1 - dlls/winewayland.drv/vulkan.c | 11 ----------- dlls/winex11.drv/vulkan.c | 10 ---------- include/wine/vulkan_driver.h | 3 +-- 6 files changed, 1 insertion(+), 36 deletions(-) diff --git a/dlls/win32u/vulkan.c b/dlls/win32u/vulkan.c index eac6793fea5..6866dbcb076 100644 --- a/dlls/win32u/vulkan.c +++ b/dlls/win32u/vulkan.c @@ -53,7 +53,6 @@ static void *win32u_vkGetDeviceProcAddr( VkDevice device, const char *name ) if (!strcmp( name, "vkCreateSwapchainKHR" )) return vulkan_funcs.p_vkCreateSwapchainKHR; if (!strcmp( name, "vkDestroySwapchainKHR" )) return vulkan_funcs.p_vkDestroySwapchainKHR; if (!strcmp( name, "vkGetDeviceProcAddr" )) return win32u_vkGetDeviceProcAddr; - if (!strcmp( name, "vkGetSwapchainImagesKHR" )) return vulkan_funcs.p_vkGetSwapchainImagesKHR; if (!strcmp( name, "vkQueuePresentKHR" )) return vulkan_funcs.p_vkQueuePresentKHR; return p_vkGetDeviceProcAddr( device, name ); @@ -74,7 +73,6 @@ static void *win32u_vkGetInstanceProcAddr( VkInstance instance, const char *name if (!strcmp( name, "vkCreateSwapchainKHR" )) return vulkan_funcs.p_vkCreateSwapchainKHR; if (!strcmp( name, "vkDestroySwapchainKHR" )) return vulkan_funcs.p_vkDestroySwapchainKHR; if (!strcmp( name, "vkGetDeviceProcAddr" )) return win32u_vkGetDeviceProcAddr; - if (!strcmp( name, "vkGetSwapchainImagesKHR" )) return vulkan_funcs.p_vkGetSwapchainImagesKHR; if (!strcmp( name, "vkQueuePresentKHR" )) return vulkan_funcs.p_vkQueuePresentKHR; return p_vkGetInstanceProcAddr( instance, name ); diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c index 9cb026076f3..f32269c7237 100644 --- a/dlls/winemac.drv/vulkan.c +++ b/dlls/winemac.drv/vulkan.c @@ -81,7 +81,6 @@ static VkResult (*pvkCreateMetalSurfaceEXT)(VkInstance, const VkMetalSurfaceCrea static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilities2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *, VkSurfaceCapabilities2KHR *); -static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); static const struct vulkan_funcs vulkan_funcs; @@ -236,13 +235,6 @@ static VkBool32 macdrv_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysical return VK_TRUE; } -static VkResult macdrv_vkGetSwapchainImagesKHR(VkDevice device, - VkSwapchainKHR swapchain, uint32_t *count, VkImage *images) -{ - TRACE("%p, 0x%s %p %p\n", device, wine_dbgstr_longlong(swapchain), count, images); - return pvkGetSwapchainImagesKHR(device, swapchain, count, images); -} - static VkResult macdrv_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { TRACE("%p, %p\n", queue, present_info); @@ -272,7 +264,6 @@ static const struct vulkan_funcs vulkan_funcs = NULL, NULL, macdrv_vkGetPhysicalDeviceWin32PresentationSupportKHR, - macdrv_vkGetSwapchainImagesKHR, macdrv_vkQueuePresentKHR, macdrv_get_host_surface_extension, @@ -293,7 +284,6 @@ UINT macdrv_VulkanInit(UINT version, void *vulkan_handle, struct vulkan_funcs *d LOAD_FUNCPTR(vkCreateMetalSurfaceEXT) LOAD_FUNCPTR(vkDestroySurfaceKHR) LOAD_FUNCPTR(vkDestroySwapchainKHR) - LOAD_FUNCPTR(vkGetSwapchainImagesKHR) LOAD_FUNCPTR(vkQueuePresentKHR) #undef LOAD_FUNCPTR diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 7500d31d56a..2f7dec229ba 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -202,7 +202,6 @@ USER_DRIVER_FUNCS = { "vkGetDeviceProcAddr", "vkGetInstanceProcAddr", "vkGetPhysicalDeviceWin32PresentationSupportKHR", - "vkGetSwapchainImagesKHR", "vkQueuePresentKHR", } diff --git a/dlls/winewayland.drv/vulkan.c b/dlls/winewayland.drv/vulkan.c index 1d7492fae36..8fd13fa7761 100644 --- a/dlls/winewayland.drv/vulkan.c +++ b/dlls/winewayland.drv/vulkan.c @@ -58,7 +58,6 @@ static VkResult (*pvkCreateWaylandSurfaceKHR)(VkInstance, const VkWaylandSurface static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); static VkBool32 (*pvkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice, uint32_t, struct wl_display *); -static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); static const struct vulkan_funcs vulkan_funcs; @@ -366,14 +365,6 @@ static VkBool32 wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysica process_wayland.wl_display); } -static VkResult wayland_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, - uint32_t *count, VkImage *images) -{ - TRACE("%p, 0x%s %p %p\n", device, wine_dbgstr_longlong(swapchain), count, images); - - return pvkGetSwapchainImagesKHR(device, swapchain, count, images); -} - static VkResult wayland_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { VkResult res; @@ -402,7 +393,6 @@ static const struct vulkan_funcs vulkan_funcs = .p_vkDestroySurfaceKHR = wayland_vkDestroySurfaceKHR, .p_vkDestroySwapchainKHR = wayland_vkDestroySwapchainKHR, .p_vkGetPhysicalDeviceWin32PresentationSupportKHR = wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR, - .p_vkGetSwapchainImagesKHR = wayland_vkGetSwapchainImagesKHR, .p_vkQueuePresentKHR = wayland_vkQueuePresentKHR, .p_get_host_surface_extension = wayland_get_host_surface_extension, .p_wine_get_host_surface = wayland_wine_get_host_surface, @@ -425,7 +415,6 @@ UINT WAYLAND_VulkanInit(UINT version, void *vulkan_handle, struct vulkan_funcs * LOAD_FUNCPTR(vkDestroySurfaceKHR); LOAD_FUNCPTR(vkDestroySwapchainKHR); LOAD_FUNCPTR(vkGetPhysicalDeviceWaylandPresentationSupportKHR); - LOAD_FUNCPTR(vkGetSwapchainImagesKHR); LOAD_FUNCPTR(vkQueuePresentKHR); #undef LOAD_FUNCPTR diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 36b6e3a4162..36edcffa997 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -78,7 +78,6 @@ static VkResult (*pvkCreateXlibSurfaceKHR)(VkInstance, const VkXlibSurfaceCreate static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); static VkBool32 (*pvkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice, uint32_t, Display *, VisualID); -static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); static const struct vulkan_funcs vulkan_funcs; @@ -253,13 +252,6 @@ static VkBool32 X11DRV_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysical default_visual.visual->visualid); } -static VkResult X11DRV_vkGetSwapchainImagesKHR(VkDevice device, - VkSwapchainKHR swapchain, uint32_t *count, VkImage *images) -{ - TRACE("%p, 0x%s %p %p\n", device, wine_dbgstr_longlong(swapchain), count, images); - return pvkGetSwapchainImagesKHR(device, swapchain, count, images); -} - static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { TRACE("%p, %p\n", queue, present_info); @@ -289,7 +281,6 @@ static const struct vulkan_funcs vulkan_funcs = NULL, NULL, X11DRV_vkGetPhysicalDeviceWin32PresentationSupportKHR, - X11DRV_vkGetSwapchainImagesKHR, X11DRV_vkQueuePresentKHR, X11DRV_get_host_surface_extension, @@ -312,7 +303,6 @@ UINT X11DRV_VulkanInit( UINT version, void *vulkan_handle, struct vulkan_funcs * LOAD_FUNCPTR( vkDestroySurfaceKHR ); LOAD_FUNCPTR( vkDestroySwapchainKHR ); LOAD_FUNCPTR( vkGetPhysicalDeviceXlibPresentationSupportKHR ); - LOAD_FUNCPTR( vkGetSwapchainImagesKHR ); LOAD_FUNCPTR( vkQueuePresentKHR ); #undef LOAD_FUNCPTR diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 3dfa63de952..e707a56269c 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -21,7 +21,7 @@ #define __WINE_VULKAN_DRIVER_H /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ -#define WINE_VULKAN_DRIVER_VERSION 22 +#define WINE_VULKAN_DRIVER_VERSION 23 struct vulkan_funcs { @@ -36,7 +36,6 @@ struct vulkan_funcs void * (*p_vkGetDeviceProcAddr)(VkDevice, const char *); void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *); VkBool32 (*p_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice, uint32_t); - VkResult (*p_vkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); VkResult (*p_vkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *); /* winevulkan specific functions */
1
0
0
0
Rémi Bernon : winevulkan: Return VK_SUBOPTIMAL_KHR from vkAcquireNextImage(2)KHR after resize.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: e9200b18375b88cecce051b05c5739ac1003cba1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e9200b18375b88cecce051b05c5739…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Apr 5 10:02:36 2024 +0200 winevulkan: Return VK_SUBOPTIMAL_KHR from vkAcquireNextImage(2)KHR after resize. --- dlls/winevulkan/make_vulkan | 2 ++ dlls/winevulkan/vulkan.c | 47 +++++++++++++++++++++++++++++++++++++++++ dlls/winevulkan/vulkan_thunks.c | 31 ++++++--------------------- dlls/winevulkan/vulkan_thunks.h | 2 ++ 4 files changed, 58 insertions(+), 24 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 7990336706e..7500d31d56a 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -208,6 +208,8 @@ USER_DRIVER_FUNCS = { # functions for which the unix thunk is manually implemented MANUAL_UNIX_THUNKS = { + "vkAcquireNextImage2KHR", + "vkAcquireNextImageKHR", "vkAllocateCommandBuffers", "vkAllocateMemory", "vkCreateBuffer", diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 5f513b96480..972de3cedaf 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1630,6 +1630,53 @@ static BOOL extents_equals(const VkExtent2D *extents, const RECT *rect) extents->height == rect->bottom - rect->top; } +VkResult wine_vkAcquireNextImage2KHR(VkDevice device_handle, const VkAcquireNextImageInfoKHR *acquire_info, + uint32_t *image_index) +{ + struct wine_swapchain *swapchain = wine_swapchain_from_handle(acquire_info->swapchain); + struct wine_device *device = wine_device_from_handle(device_handle); + VkAcquireNextImageInfoKHR acquire_info_host = *acquire_info; + struct wine_surface *surface = swapchain->surface; + RECT client_rect; + VkResult res; + + acquire_info_host.swapchain = swapchain->host_swapchain; + res = device->funcs.p_vkAcquireNextImage2KHR(device->host_device, &acquire_info_host, image_index); + + if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect) && + !extents_equals(&swapchain->extents, &client_rect)) + { + WARN("Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR\n", + swapchain->extents.width, swapchain->extents.height, wine_dbgstr_rect(&client_rect)); + return VK_SUBOPTIMAL_KHR; + } + + return res; +} + +VkResult wine_vkAcquireNextImageKHR(VkDevice device_handle, VkSwapchainKHR swapchain_handle, uint64_t timeout, + VkSemaphore semaphore, VkFence fence, uint32_t *image_index) +{ + struct wine_swapchain *swapchain = wine_swapchain_from_handle(swapchain_handle); + struct wine_device *device = wine_device_from_handle(device_handle); + struct wine_surface *surface = swapchain->surface; + RECT client_rect; + VkResult res; + + res = device->funcs.p_vkAcquireNextImageKHR(device->host_device, swapchain->host_swapchain, timeout, + semaphore, fence, image_index); + + if (res == VK_SUCCESS && NtUserGetClientRect(surface->hwnd, &client_rect) && + !extents_equals(&swapchain->extents, &client_rect)) + { + WARN("Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR\n", + swapchain->extents.width, swapchain->extents.height, wine_dbgstr_rect(&client_rect)); + return VK_SUBOPTIMAL_KHR; + } + + return res; +} + VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCreateInfoKHR *create_info, const VkAllocationCallbacks *allocator, VkSwapchainKHR *swapchain_handle) { diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 7ec0300e8cb..5c1d6b1685d 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -7112,28 +7112,13 @@ static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle) } } -#ifdef _WIN64 -static inline void convert_VkAcquireNextImageInfoKHR_win64_to_host(const VkAcquireNextImageInfoKHR *in, VkAcquireNextImageInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->swapchain = wine_swapchain_from_handle(in->swapchain)->host_swapchain; - out->timeout = in->timeout; - out->semaphore = in->semaphore; - out->fence = in->fence; - out->deviceMask = in->deviceMask; -} -#endif /* _WIN64 */ - -static inline void convert_VkAcquireNextImageInfoKHR_win32_to_host(const VkAcquireNextImageInfoKHR32 *in, VkAcquireNextImageInfoKHR *out) +static inline void convert_VkAcquireNextImageInfoKHR_win32_to_unwrapped_host(const VkAcquireNextImageInfoKHR32 *in, VkAcquireNextImageInfoKHR *out) { if (!in) return; out->sType = in->sType; out->pNext = NULL; - out->swapchain = wine_swapchain_from_handle(in->swapchain)->host_swapchain; + out->swapchain = in->swapchain; out->timeout = in->timeout; out->semaphore = in->semaphore; out->fence = in->fence; @@ -30193,12 +30178,10 @@ static inline void convert_VkSemaphoreWaitInfo_win32_to_host(const VkSemaphoreWa static NTSTATUS thunk64_vkAcquireNextImage2KHR(void *args) { struct vkAcquireNextImage2KHR_params *params = args; - VkAcquireNextImageInfoKHR pAcquireInfo_host; TRACE("%p, %p, %p\n", params->device, params->pAcquireInfo, params->pImageIndex); - convert_VkAcquireNextImageInfoKHR_win64_to_host(params->pAcquireInfo, &pAcquireInfo_host); - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquireNextImage2KHR(wine_device_from_handle(params->device)->host_device, &pAcquireInfo_host, params->pImageIndex); + params->result = wine_vkAcquireNextImage2KHR(params->device, params->pAcquireInfo, params->pImageIndex); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -30216,8 +30199,8 @@ static NTSTATUS thunk32_vkAcquireNextImage2KHR(void *args) TRACE("%#x, %#x, %#x\n", params->device, params->pAcquireInfo, params->pImageIndex); - convert_VkAcquireNextImageInfoKHR_win32_to_host((const VkAcquireNextImageInfoKHR32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquireNextImage2KHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, &pAcquireInfo_host, (uint32_t *)UlongToPtr(params->pImageIndex)); + convert_VkAcquireNextImageInfoKHR_win32_to_unwrapped_host((const VkAcquireNextImageInfoKHR32 *)UlongToPtr(params->pAcquireInfo), &pAcquireInfo_host); + params->result = wine_vkAcquireNextImage2KHR((VkDevice)UlongToPtr(params->device), &pAcquireInfo_host, (uint32_t *)UlongToPtr(params->pImageIndex)); return STATUS_SUCCESS; } @@ -30228,7 +30211,7 @@ static NTSTATUS thunk64_vkAcquireNextImageKHR(void *args) TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %p\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - params->result = wine_device_from_handle(params->device)->funcs.p_vkAcquireNextImageKHR(wine_device_from_handle(params->device)->host_device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->timeout, params->semaphore, params->fence, params->pImageIndex); + params->result = wine_vkAcquireNextImageKHR(params->device, params->swapchain, params->timeout, params->semaphore, params->fence, params->pImageIndex); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -30248,7 +30231,7 @@ static NTSTATUS thunk32_vkAcquireNextImageKHR(void *args) TRACE("%#x, 0x%s, 0x%s, 0x%s, 0x%s, %#x\n", params->device, wine_dbgstr_longlong(params->swapchain), wine_dbgstr_longlong(params->timeout), wine_dbgstr_longlong(params->semaphore), wine_dbgstr_longlong(params->fence), params->pImageIndex); - params->result = wine_device_from_handle((VkDevice)UlongToPtr(params->device))->funcs.p_vkAcquireNextImageKHR(wine_device_from_handle((VkDevice)UlongToPtr(params->device))->host_device, wine_swapchain_from_handle(params->swapchain)->host_swapchain, params->timeout, params->semaphore, params->fence, (uint32_t *)UlongToPtr(params->pImageIndex)); + params->result = wine_vkAcquireNextImageKHR((VkDevice)UlongToPtr(params->device), params->swapchain, params->timeout, params->semaphore, params->fence, (uint32_t *)UlongToPtr(params->pImageIndex)); return STATUS_SUCCESS; } diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 699a21c580e..f27fae3f07c 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -15,6 +15,8 @@ #define WINE_VK_VERSION VK_API_VERSION_1_3 /* Functions for which we have custom implementations outside of the thunks. */ +VkResult wine_vkAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR *pAcquireInfo, uint32_t *pImageIndex); +VkResult wine_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex); VkResult wine_vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); VkResult wine_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo *pAllocateInfo, const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory); VkResult wine_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkBuffer *pBuffer);
1
0
0
0
Rémi Bernon : winevulkan: Return VK_SUBOPTIMAL_KHR from vkQueuePresentKHR after resize.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: 010b497cf6491bd3d4e103db3110b24de17d4a31 URL:
https://gitlab.winehq.org/wine/wine/-/commit/010b497cf6491bd3d4e103db3110b2…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Dec 10 11:03:54 2023 +0100 winevulkan: Return VK_SUBOPTIMAL_KHR from vkQueuePresentKHR after resize. --- dlls/vulkan-1/tests/vulkan.c | 3 --- dlls/winevulkan/vulkan.c | 34 ++++++++++++++++++++++++++++++++++ dlls/winevulkan/vulkan_private.h | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/dlls/vulkan-1/tests/vulkan.c b/dlls/vulkan-1/tests/vulkan.c index 716a524e796..71ad2c4cf34 100644 --- a/dlls/vulkan-1/tests/vulkan.c +++ b/dlls/vulkan-1/tests/vulkan.c @@ -762,11 +762,8 @@ static void test_win32_surface_swapchain_hwnd(VkDevice device, VkSwapchainKHR sw vr = vkQueuePresentKHR(queue, &present_info); if (expect_suboptimal) - { - todo_wine ok(vr == VK_SUBOPTIMAL_KHR || broken(vr == VK_ERROR_OUT_OF_DATE_KHR) /* Nvidia */, "Got unexpected vr %d.\n", vr); - } else if (IsWindow(hwnd)) ok(vr == VK_SUCCESS, "Got unexpected vr %d.\n", vr); else diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 21e5952caf4..5f513b96480 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1624,6 +1624,12 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface, free(object); } +static BOOL extents_equals(const VkExtent2D *extents, const RECT *rect) +{ + return extents->width == rect->right - rect->left && + extents->height == rect->bottom - rect->top; +} + VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCreateInfoKHR *create_info, const VkAllocationCallbacks *allocator, VkSwapchainKHR *swapchain_handle) { @@ -1661,6 +1667,9 @@ VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCrea return res; } + object->surface = surface; + object->extents = create_info->imageExtent; + *swapchain_handle = wine_swapchain_to_handle(object); add_handle_mapping(instance, *swapchain_handle, object->host_swapchain, &object->wrapper_entry); return VK_SUCCESS; @@ -1704,6 +1713,31 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr res = device->funcs.p_vkQueuePresentKHR(queue->host_queue, &present_info_host); + for (i = 0; i < present_info->swapchainCount; i++) + { + struct wine_swapchain *swapchain = wine_swapchain_from_handle(present_info->pSwapchains[i]); + VkResult swapchain_res = present_info->pResults ? present_info->pResults[i] : res; + struct wine_surface *surface = swapchain->surface; + RECT client_rect; + + if (swapchain_res < VK_SUCCESS) continue; + if (!NtUserGetClientRect(surface->hwnd, &client_rect)) + { + WARN("Swapchain window %p is invalid, returning VK_ERROR_OUT_OF_DATE_KHR\n", surface->hwnd); + if (present_info->pResults) present_info->pResults[i] = VK_ERROR_OUT_OF_DATE_KHR; + if (res >= VK_SUCCESS) res = VK_ERROR_OUT_OF_DATE_KHR; + } + else if (swapchain_res != VK_SUCCESS) + WARN("Present returned status %d for swapchain %p\n", swapchain_res, swapchain); + else if (!extents_equals(&swapchain->extents, &client_rect)) + { + WARN("Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR\n", + swapchain->extents.width, swapchain->extents.height, wine_dbgstr_rect(&client_rect)); + if (present_info->pResults) present_info->pResults[i] = VK_SUBOPTIMAL_KHR; + if (res == VK_SUCCESS) res = VK_SUBOPTIMAL_KHR; + } + } + if (swapchains != swapchains_buffer) free(swapchains); if (TRACE_ON(fps)) diff --git a/dlls/winevulkan/vulkan_private.h b/dlls/winevulkan/vulkan_private.h index f5109aa6377..5e66a6c9670 100644 --- a/dlls/winevulkan/vulkan_private.h +++ b/dlls/winevulkan/vulkan_private.h @@ -253,7 +253,9 @@ static inline VkSurfaceKHR wine_surface_to_handle(struct wine_surface *surface) struct wine_swapchain { + struct wine_surface *surface; /* parent */ VkSwapchainKHR host_swapchain; + VkExtent2D extents; struct wrapper_entry wrapper_entry; };
1
0
0
0
Rémi Bernon : winevulkan: Move vkQueuePresent FPS trace out of the drivers.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: 551b535cddeea76f9f277558209e99123d454e59 URL:
https://gitlab.winehq.org/wine/wine/-/commit/551b535cddeea76f9f277558209e99…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Dec 10 11:03:54 2023 +0100 winevulkan: Move vkQueuePresent FPS trace out of the drivers. --- dlls/winemac.drv/vulkan.c | 27 +-------------------------- dlls/winevulkan/vulkan.c | 23 +++++++++++++++++++++++ dlls/winex11.drv/vulkan.c | 29 +---------------------------- 3 files changed, 25 insertions(+), 54 deletions(-) diff --git a/dlls/winemac.drv/vulkan.c b/dlls/winemac.drv/vulkan.c index 288bd9af4b1..9cb026076f3 100644 --- a/dlls/winemac.drv/vulkan.c +++ b/dlls/winemac.drv/vulkan.c @@ -46,8 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); #ifdef SONAME_LIBVULKAN -WINE_DECLARE_DEBUG_CHANNEL(fps); - typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; #define VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK 1000123000 @@ -248,30 +246,7 @@ static VkResult macdrv_vkGetSwapchainImagesKHR(VkDevice device, static VkResult macdrv_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { TRACE("%p, %p\n", queue, present_info); - VkResult res = pvkQueuePresentKHR(queue, present_info); - - if (TRACE_ON(fps)) - { - static unsigned long frames, frames_total; - static long prev_time, start_time; - DWORD time; - - time = NtGetTickCount(); - frames++; - frames_total++; - if (time - prev_time > 1500) - { - TRACE_(fps)("%p @ approx %.2ffps, total %.2ffps\n", - queue, 1000.0 * frames / (time - prev_time), - 1000.0 * frames_total / (time - start_time)); - prev_time = time; - frames = 0; - if (!start_time) - start_time = time; - } - } - - return res; + return pvkQueuePresentKHR(queue, present_info); } static const char *macdrv_get_host_surface_extension(void) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index e906734a506..21e5952caf4 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -31,6 +31,7 @@ #include "ntuser.h" WINE_DEFAULT_DEBUG_CHANNEL(vulkan); +WINE_DECLARE_DEBUG_CHANNEL(fps); static PFN_vkCreateInstance p_vkCreateInstance; static PFN_vkEnumerateInstanceVersion p_vkEnumerateInstanceVersion; @@ -1705,6 +1706,28 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr if (swapchains != swapchains_buffer) free(swapchains); + if (TRACE_ON(fps)) + { + static unsigned long frames, frames_total; + static long prev_time, start_time; + DWORD time; + + time = NtGetTickCount(); + frames++; + frames_total++; + + if (time - prev_time > 1500) + { + TRACE_(fps)("%p @ approx %.2ffps, total %.2ffps\n", queue, + 1000.0 * frames / (time - prev_time), + 1000.0 * frames_total / (time - start_time)); + prev_time = time; + frames = 0; + + if (!start_time) start_time = time; + } + } + return res; } diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 4ff319c7ae2..36b6e3a4162 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -47,7 +47,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan); #ifdef SONAME_LIBVULKAN -WINE_DECLARE_DEBUG_CHANNEL(fps); static pthread_mutex_t vulkan_mutex; @@ -263,34 +262,8 @@ static VkResult X11DRV_vkGetSwapchainImagesKHR(VkDevice device, static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { - VkResult res; - TRACE("%p, %p\n", queue, present_info); - - res = pvkQueuePresentKHR(queue, present_info); - - if (TRACE_ON(fps)) - { - static unsigned long frames, frames_total; - static long prev_time, start_time; - DWORD time; - - time = NtGetTickCount(); - frames++; - frames_total++; - if (time - prev_time > 1500) - { - TRACE_(fps)("%p @ approx %.2ffps, total %.2ffps\n", - queue, 1000.0 * frames / (time - prev_time), - 1000.0 * frames_total / (time - start_time)); - prev_time = time; - frames = 0; - if (!start_time) - start_time = time; - } - } - - return res; + return pvkQueuePresentKHR(queue, present_info); } static const char *X11DRV_get_host_surface_extension(void)
1
0
0
0
Rémi Bernon : winevulkan: Add a manual vkQueuePresent wrapper.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: de4edeaa24ad789705f10d8d6e5cf74f3e2d8479 URL:
https://gitlab.winehq.org/wine/wine/-/commit/de4edeaa24ad789705f10d8d6e5cf7…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sun Dec 10 11:03:54 2023 +0100 winevulkan: Add a manual vkQueuePresent wrapper. --- dlls/winevulkan/make_vulkan | 1 + dlls/winevulkan/vulkan.c | 28 +++++++++++++++++ dlls/winevulkan/vulkan_thunks.c | 66 ++++------------------------------------- dlls/winevulkan/vulkan_thunks.h | 1 + 4 files changed, 35 insertions(+), 61 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 7e3a7d04b19..7990336706e 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -260,6 +260,7 @@ MANUAL_UNIX_THUNKS = { "vkGetPhysicalDeviceSurfaceFormats2KHR", "vkMapMemory", "vkMapMemory2KHR", + "vkQueuePresentKHR", "vkUnmapMemory", "vkUnmapMemory2KHR", } diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 571c1d54575..e906734a506 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1680,6 +1680,34 @@ void wine_vkDestroySwapchainKHR(VkDevice device_handle, VkSwapchainKHR swapchain free(swapchain); } +VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *present_info) +{ + VkSwapchainKHR swapchains_buffer[16], *swapchains = swapchains_buffer; + struct wine_queue *queue = wine_queue_from_handle(queue_handle); + VkPresentInfoKHR present_info_host = *present_info; + struct wine_device *device = queue->device; + VkResult res; + UINT i; + + if (present_info->swapchainCount > ARRAY_SIZE(swapchains_buffer) && + !(swapchains = malloc(present_info->swapchainCount * sizeof(*swapchains)))) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + for (i = 0; i < present_info->swapchainCount; i++) + { + struct wine_swapchain *swapchain = wine_swapchain_from_handle(present_info->pSwapchains[i]); + swapchains[i] = swapchain->host_swapchain; + } + + present_info_host.pSwapchains = swapchains; + + res = device->funcs.p_vkQueuePresentKHR(queue->host_queue, &present_info_host); + + if (swapchains != swapchains_buffer) free(swapchains); + + return res; +} + VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *alloc_info, const VkAllocationCallbacks *allocator, VkDeviceMemory *ret) { diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 9075b5ff11f..7ec0300e8cb 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -29299,57 +29299,7 @@ static inline const VkPresentRegionKHR *convert_VkPresentRegionKHR_array_win32_t return out; } -#ifdef _WIN64 -static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win64_to_driver(struct conversion_context *ctx, const VkSwapchainKHR *in, uint32_t count) -{ - VkSwapchainKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_swapchain_from_handle(in[i])->host_swapchain; - } - - return out; -} -#endif /* _WIN64 */ - -static inline const VkSwapchainKHR *convert_VkSwapchainKHR_array_win32_to_driver(struct conversion_context *ctx, const VkSwapchainKHR *in, uint32_t count) -{ - VkSwapchainKHR *out; - unsigned int i; - - if (!in || !count) return NULL; - - out = conversion_context_alloc(ctx, count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i] = wine_swapchain_from_handle(in[i])->host_swapchain; - } - - return out; -} - -#ifdef _WIN64 -static inline void convert_VkPresentInfoKHR_win64_to_driver(struct conversion_context *ctx, const VkPresentInfoKHR *in, VkPresentInfoKHR *out) -{ - if (!in) return; - - out->sType = in->sType; - out->pNext = in->pNext; - out->waitSemaphoreCount = in->waitSemaphoreCount; - out->pWaitSemaphores = in->pWaitSemaphores; - out->swapchainCount = in->swapchainCount; - out->pSwapchains = convert_VkSwapchainKHR_array_win64_to_driver(ctx, in->pSwapchains, in->swapchainCount); - out->pImageIndices = in->pImageIndices; - out->pResults = in->pResults; -} -#endif /* _WIN64 */ - -static inline void convert_VkPresentInfoKHR_win32_to_driver(struct conversion_context *ctx, const VkPresentInfoKHR32 *in, VkPresentInfoKHR *out) +static inline void convert_VkPresentInfoKHR_win32_to_unwrapped_host(struct conversion_context *ctx, const VkPresentInfoKHR32 *in, VkPresentInfoKHR *out) { const VkBaseInStructure32 *in_header; VkBaseOutStructure *out_header = (void *)out; @@ -29361,7 +29311,7 @@ static inline void convert_VkPresentInfoKHR_win32_to_driver(struct conversion_co out->waitSemaphoreCount = in->waitSemaphoreCount; out->pWaitSemaphores = (const VkSemaphore *)UlongToPtr(in->pWaitSemaphores); out->swapchainCount = in->swapchainCount; - out->pSwapchains = convert_VkSwapchainKHR_array_win32_to_driver(ctx, (const VkSwapchainKHR *)UlongToPtr(in->pSwapchains), in->swapchainCount); + out->pSwapchains = (const VkSwapchainKHR *)UlongToPtr(in->pSwapchains); out->pImageIndices = (const uint32_t *)UlongToPtr(in->pImageIndices); out->pResults = (VkResult *)UlongToPtr(in->pResults); @@ -45145,16 +45095,10 @@ static NTSTATUS thunk32_vkQueueNotifyOutOfBandNV(void *args) static NTSTATUS thunk64_vkQueuePresentKHR(void *args) { struct vkQueuePresentKHR_params *params = args; - VkPresentInfoKHR pPresentInfo_host; - struct conversion_context local_ctx; - struct conversion_context *ctx = &local_ctx; TRACE("%p, %p\n", params->queue, params->pPresentInfo); - init_conversion_context(ctx); - convert_VkPresentInfoKHR_win64_to_driver(ctx, params->pPresentInfo, &pPresentInfo_host); - params->result = wine_queue_from_handle(params->queue)->device->funcs.p_vkQueuePresentKHR(wine_queue_from_handle(params->queue)->host_queue, &pPresentInfo_host); - free_conversion_context(ctx); + params->result = wine_vkQueuePresentKHR(params->queue, params->pPresentInfo); return STATUS_SUCCESS; } #endif /* _WIN64 */ @@ -45174,8 +45118,8 @@ static NTSTATUS thunk32_vkQueuePresentKHR(void *args) TRACE("%#x, %#x\n", params->queue, params->pPresentInfo); init_conversion_context(ctx); - convert_VkPresentInfoKHR_win32_to_driver(ctx, (const VkPresentInfoKHR32 *)UlongToPtr(params->pPresentInfo), &pPresentInfo_host); - params->result = wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->device->funcs.p_vkQueuePresentKHR(wine_queue_from_handle((VkQueue)UlongToPtr(params->queue))->host_queue, &pPresentInfo_host); + convert_VkPresentInfoKHR_win32_to_unwrapped_host(ctx, (const VkPresentInfoKHR32 *)UlongToPtr(params->pPresentInfo), &pPresentInfo_host); + params->result = wine_vkQueuePresentKHR((VkQueue)UlongToPtr(params->queue), &pPresentInfo_host); free_conversion_context(ctx); return STATUS_SUCCESS; } diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 5fe178d52b5..699a21c580e 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -64,6 +64,7 @@ VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physica VkResult wine_vkGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, uint32_t *pSurfaceFormatCount, VkSurfaceFormat2KHR *pSurfaceFormats); VkResult wine_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void **ppData); VkResult wine_vkMapMemory2KHR(VkDevice device, const VkMemoryMapInfoKHR *pMemoryMapInfo, void **ppData); +VkResult wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo); void wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory); VkResult wine_vkUnmapMemory2KHR(VkDevice device, const VkMemoryUnmapInfoKHR *pMemoryUnmapInfo);
1
0
0
0
Rémi Bernon : mfmediaengine: Allow decoder / converter to be resolved between topology nodes.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: fa23650ff25680b37b7fae5b96b372beab011ace URL:
https://gitlab.winehq.org/wine/wine/-/commit/fa23650ff25680b37b7fae5b96b372…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Apr 3 16:14:24 2024 +0200 mfmediaengine: Allow decoder / converter to be resolved between topology nodes. --- dlls/mfmediaengine/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 444c6f1bb65..026b825a7a5 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -1060,6 +1060,7 @@ static HRESULT media_engine_create_effects(struct effect *effects, size_t count, for (i = 0; i < count; ++i) { + UINT32 method = MF_CONNECT_ALLOW_DECODER; IMFTopologyNode *node = NULL; if (FAILED(hr = MFCreateTopologyNode(MF_TOPOLOGY_TRANSFORM_NODE, &node))) @@ -1072,7 +1073,8 @@ static HRESULT media_engine_create_effects(struct effect *effects, size_t count, IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_NOSHUTDOWN_ON_REMOVE, FALSE); if (effects[i].optional) - IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_CONNECT_METHOD, MF_CONNECT_AS_OPTIONAL); + method |= MF_CONNECT_AS_OPTIONAL; + IMFTopologyNode_SetUINT32(node, &MF_TOPONODE_CONNECT_METHOD, method); IMFTopology_AddNode(topology, node); IMFTopologyNode_ConnectOutput(last, 0, node, 0);
1
0
0
0
Rémi Bernon : mfmediaengine/tests: Test that effects allow converters between them.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: a9871e4ad1b40512e654900072c5a043c42798ea URL:
https://gitlab.winehq.org/wine/wine/-/commit/a9871e4ad1b40512e654900072c5a0…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Apr 8 14:01:22 2024 +0200 mfmediaengine/tests: Test that effects allow converters between them. --- dlls/mfmediaengine/tests/mfmediaengine.c | 611 +++++++++++++++---------------- 1 file changed, 286 insertions(+), 325 deletions(-)
1
0
0
0
Dmitry Timoshkov : widl: Add support for inherited interfaces to SLTG typelib generator.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: 1d0eb24ce1513b0327db227a7f375e8be48a7043 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1d0eb24ce1513b0327db227a7f375e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Jan 19 18:44:00 2016 +0800 widl: Add support for inherited interfaces to SLTG typelib generator. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- tools/widl/write_sltg.c | 90 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c index ec233a119f3..94ebf678edb 100644 --- a/tools/widl/write_sltg.c +++ b/tools/widl/write_sltg.c @@ -205,6 +205,22 @@ struct sltg_function #endif }; +struct sltg_impl_info +{ + short res00; + short next; + short res04; + char impltypeflags; + char res07; + short res08; + short ref; + short res0c; + short res0e; + short res10; + short res12; + short pos; +}; + #include "poppack.h" static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type); @@ -1244,18 +1260,39 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v return data->size - old_size; } +static void write_impl_href(struct sltg_data *data, short href) +{ + struct sltg_impl_info impl_info; + + impl_info.res00 = 0x004a; + impl_info.next = -1; + impl_info.res04 = -1; + impl_info.impltypeflags = 0; + impl_info.res07 = 0x80; + impl_info.res08 = 0x0012; + impl_info.ref = href; + impl_info.res0c = 0x4001; + impl_info.res0e = -2; /* 0xfffe */ + impl_info.res10 = -1; + impl_info.res12 = 0x001d; + impl_info.pos = 0; + + append_data(data, &impl_info, sizeof(impl_info)); +} + static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) { const statement_t *stmt_func; importinfo_t *ref_importinfo = NULL; - type_t *inherit; + short inherit_href = -1; struct sltg_data data; struct sltg_hrefmap hrefmap; const char *index_name; struct sltg_typeinfo_header ti; struct sltg_member_header member; struct sltg_tail tail; - int member_offset, base_offset, func_count, func_data_size, i; + int member_offset, base_offset, func_data_size, i; + int func_count, inherited_func_count = 0; if (iface->typelib_idx != -1) return; @@ -1273,13 +1310,16 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) return; } - inherit = type_iface_get_inherit(iface); + hrefmap.href_count = 0; + hrefmap.href = NULL; - if (inherit) + if (type_iface_get_inherit(iface)) { - chat("add_interface_typeinfo: inheriting from base interface %s\n", inherit->name); + type_t *inherit; - warning("inheriting from base interface %s is not implemented\n", inherit->name); + inherit = type_iface_get_inherit(iface); + + chat("add_interface_typeinfo: inheriting from base interface %s\n", inherit->name); ref_importinfo = find_importinfo(typelib->typelib, inherit->name); @@ -1288,6 +1328,14 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) if (ref_importinfo) error("support for imported interfaces is not implemented\n"); + + inherit_href = local_href(&hrefmap, inherit->typelib_idx); + + while (inherit) + { + inherited_func_count += list_count(type_iface_get_stmts(inherit)); + inherit = type_iface_get_inherit(inherit); + } } /* check typelib_idx again, it could have been added while resolving the parent interface */ @@ -1296,9 +1344,6 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) iface->typelib_idx = typelib->block_count; /* pass 1: calculate function descriptions data size */ - hrefmap.href_count = 0; - hrefmap.href = NULL; - init_sltg_data(&data); STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(iface)) @@ -1321,19 +1366,21 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) write_hrefmap(&data, &hrefmap); member_offset = data.size; + base_offset = 0; member.res00 = 0x0001; member.res02 = 0xffff; member.res04 = 0x01; member.extra = func_data_size; + if (inherit_href != -1) + { + member.extra += sizeof(struct sltg_impl_info); + base_offset += sizeof(struct sltg_impl_info); + } append_data(&data, &member, sizeof(member)); - base_offset = 0; - - /* inheriting from base interface is not implemented yet - if (type_iface_get_inherit(iface)) - add_impl_type(typeinfo, type_iface_get_inherit(iface), ref_importinfo); - */ + if (inherit_href != -1) + write_impl_href(&data, inherit_href); i = 0; @@ -1341,7 +1388,8 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) { if (i == func_count - 1) i |= 0x80000000; - base_offset += add_func_desc(typelib, &data, stmt_func->u.var, i, base_offset, &hrefmap); + base_offset += add_func_desc(typelib, &data, stmt_func->u.var, + inherited_func_count + i, base_offset, &hrefmap); i++; } @@ -1352,10 +1400,18 @@ static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *iface) tail.funcs_bytes = func_data_size; tail.cbSizeInstance = pointer_size; tail.cbAlignment = pointer_size; - tail.cbSizeVft = func_count * pointer_size; + tail.cbSizeVft = (inherited_func_count + func_count) * pointer_size; tail.type_bytes = data.size - member_offset - sizeof(member); tail.res24 = 0; tail.res26 = 0; + if (inherit_href != -1) + { + tail.cImplTypes++; + tail.impls_off = 0; + tail.impls_bytes = 0; + + tail.funcs_off += sizeof(struct sltg_impl_info); + } append_data(&data, &tail, sizeof(tail)); add_block(typelib, data.data, data.size, index_name);
1
0
0
0
Dmitry Timoshkov : widl: Add support for interfaces to SLTG typelib generator.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: 7db6c30aead9d034c3d88f4b972000f46907990a URL:
https://gitlab.winehq.org/wine/wine/-/commit/7db6c30aead9d034c3d88f4b972000…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Tue Jan 19 17:01:01 2016 +0800 widl: Add support for interfaces to SLTG typelib generator. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- tools/widl/write_sltg.c | 432 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 418 insertions(+), 14 deletions(-)
1
0
0
0
Dmitry Timoshkov : widl: Add support for recursive type references to SLTG typelib generator.
by Alexandre Julliard
09 Apr '24
09 Apr '24
Module: wine Branch: master Commit: 61583ec2cd89688fd4b706e50d4a2be0c41ef8df URL:
https://gitlab.winehq.org/wine/wine/-/commit/61583ec2cd89688fd4b706e50d4a2b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 14 15:16:37 2016 +0800 widl: Add support for recursive type references to SLTG typelib generator. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> --- tools/widl/write_sltg.c | 53 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c index 7380d94016c..220fd933704 100644 --- a/tools/widl/write_sltg.c +++ b/tools/widl/write_sltg.c @@ -183,6 +183,12 @@ struct sltg_hrefinfo #include "poppack.h" +static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type); +static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *type); +static void add_enum_typeinfo(struct sltg_typelib *typelib, type_t *type); +static void add_union_typeinfo(struct sltg_typelib *typelib, type_t *type); +static void add_coclass_typeinfo(struct sltg_typelib *typelib, type_t *type); + static void init_sltg_data(struct sltg_data *data) { data->size = 0; @@ -644,8 +650,8 @@ static int local_href(struct sltg_hrefmap *hrefmap, int typelib_href) return href << 2; } -static short write_var_desc(struct sltg_data *data, type_t *type, short flags, short base_offset, - int *size_instance, struct sltg_hrefmap *hrefmap) +static short write_var_desc(struct sltg_typelib *typelib, struct sltg_data *data, type_t *type, short flags, + short base_offset, int *size_instance, struct sltg_hrefmap *hrefmap) { short vt, vt_flags, desc_offset; @@ -737,10 +743,10 @@ static short write_var_desc(struct sltg_data *data, type_t *type, short flags, s chat("write_var_desc: vt VT_PTR | 0x0400\n"); vt = VT_PTR | 0x0400; append_data(data, &vt, sizeof(vt)); - write_var_desc(data, ref, 0, base_offset, size_instance, hrefmap); + write_var_desc(typelib, data, ref, 0, base_offset, size_instance, hrefmap); } else - write_var_desc(data, ref, 0x0e00, base_offset, size_instance, hrefmap); + write_var_desc(typelib, data, ref, 0x0e00, base_offset, size_instance, hrefmap); return desc_offset; } @@ -759,6 +765,33 @@ static short write_var_desc(struct sltg_data *data, type_t *type, short flags, s chat("write_var_desc: VT_USERDEFINED, type %p, name %s, real type %d, href %d\n", type, type->name, type_get_type(type), type->typelib_idx); + if (type->typelib_idx == -1) + { + chat("write_var_desc: trying to ref not added type\n"); + + switch (type_get_type(type)) + { + case TYPE_STRUCT: + add_structure_typeinfo(typelib, type); + break; + case TYPE_INTERFACE: + add_interface_typeinfo(typelib, type); + break; + case TYPE_ENUM: + add_enum_typeinfo(typelib, type); + break; + case TYPE_UNION: + add_union_typeinfo(typelib, type); + break; + case TYPE_COCLASS: + add_coclass_typeinfo(typelib, type); + break; + default: + error("write_var_desc: VT_USERDEFINED - unhandled type %d\n", + type_get_type(type)); + } + } + if (type->typelib_idx == -1) error("write_var_desc: trying to ref not added type\n"); @@ -816,6 +849,8 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type) int member_offset, var_count = 0, var_data_size = 0, size_instance = 0; short *type_desc_offset = NULL; + if (type->typelib_idx != -1) return; + chat("add_structure_typeinfo: type %p, type->name %s\n", type, type->name); type->typelib_idx = typelib->block_count; @@ -825,8 +860,6 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type) init_sltg_data(&data); - index_name = add_typeinfo_block(typelib, type, TKIND_RECORD); - if (type_struct_get_fields(type)) { int i = 0; @@ -841,13 +874,13 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type) { short base_offset; - chat("add_structure_typeinfo: var %p, name %s, type %p\n", - var, var->name, var->declspec.type); + chat("add_structure_typeinfo: var %p (%s), type %p (%s)\n", + var, var->name, var->declspec.type, var->declspec.type->name); init_sltg_data(&var_data[i]); base_offset = var_data_size + (i + 1) * sizeof(struct sltg_variable); - type_desc_offset[i] = write_var_desc(&var_data[i], var->declspec.type, 0, base_offset, &size_instance, &hrefmap); + type_desc_offset[i] = write_var_desc(typelib, &var_data[i], var->declspec.type, 0, base_offset, &size_instance, &hrefmap); dump_var_desc(var_data[i].data, var_data[i].size); if (var_data[i].size > sizeof(short)) @@ -856,6 +889,8 @@ static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type) } } + index_name = add_typeinfo_block(typelib, type, TKIND_RECORD); + init_typeinfo(&ti, type, TKIND_RECORD, &hrefmap); append_data(&data, &ti, sizeof(ti));
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
59
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200