@@ -959,91 +959,3 @@ index 00000000000..3ab31201d3d
959959+ #endif /* defined(SONAME_LIBXFIXES) */
960960+
961961+ #endif /* __WINE_XFIXES_H */
962- From 5ebbeb4784aa9e67f92a295eda46ee1c74b9a1f2 Mon Sep 17 00:00:00 2001
963- From: antonino <antomani103@gmail.com>
964- Date: Tue, 28 Jun 2022 22:04:04 +0200
965- Subject: [PATCH] winex11: Moved child window buffer copy to vkQueuePresentKHR
966-
967- ---
968- dlls/winex11.drv/vulkan.c | 44 ++++++++++++++++++++++++++++++++-------
969- 1 file changed, 36 insertions(+), 8 deletions(-)
970-
971- diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
972- index e46cff364de..d3453ff6a32 100644
973- --- a/dlls/winex11.drv/vulkan.c
974- +++ b/dlls/winex11.drv/vulkan.c
975- @@ -317,8 +317,6 @@ static VkResult X11DRV_vkAcquireNextImageKHR(VkDevice device,
976- VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore,
977- VkFence fence, uint32_t *image_index)
978- {
979- - static int once;
980- - struct x11drv_escape_present_drawable escape;
981- struct wine_vk_surface *surface = NULL;
982- VkResult result;
983- VkFence orig_fence;
984- @@ -353,12 +351,6 @@ static VkResult X11DRV_vkAcquireNextImageKHR(VkDevice device,
985- if (result == VK_SUCCESS && hdc && surface && surface->offscreen)
986- {
987- if (wait_fence) pvkWaitForFences(device, 1, &fence, 0, timeout);
988- - escape.code = X11DRV_PRESENT_DRAWABLE;
989- - escape.drawable = surface->window;
990- - escape.flush = TRUE;
991- - NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (char *)&escape, 0, NULL );
992- - if (surface->present_mode == VK_PRESENT_MODE_MAILBOX_KHR)
993- - if (once++) FIXME("Application requires child window rendering with mailbox present mode, expect possible tearing!\n");
994- }
995-
996- if (fence != orig_fence) pvkDestroyFence(device, fence, NULL);
997- @@ -790,6 +782,15 @@ static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *
998- {
999- VkResult res;
1000-
1001- + VkSwapchainKHR swapchain;
1002- +
1003- + static int once;
1004- + struct x11drv_escape_present_drawable escape;
1005- + struct wine_vk_surface *surface = NULL;
1006- + VkFence orig_fence;
1007- + BOOL wait_fence = FALSE;
1008- + HDC hdc = 0;
1009- +
1010- TRACE("%p, %p\n", queue, present_info);
1011-
1012- res = pvkQueuePresentKHR(queue, present_info);
1013- @@ -815,6 +816,33 @@ static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *
1014- }
1015- }
1016-
1017- + if(res == VK_SUCCESS)
1018- + {
1019- + for(uint32_t i = 0; i < present_info->swapchainCount; i++)
1020- + {
1021- + swapchain = present_info->pSwapchains[i];
1022- +
1023- + pthread_mutex_lock(&vulkan_mutex);
1024- + if (!XFindContext(gdi_display, (XID)swapchain, vulkan_swapchain_context, (char **)&surface))
1025- + {
1026- + wine_vk_surface_grab(surface);
1027- + hdc = surface->hdc;
1028- + }
1029- + pthread_mutex_unlock(&vulkan_mutex);
1030- +
1031- + if (hdc && surface && surface->offscreen)
1032- + {
1033- + escape.code = X11DRV_PRESENT_DRAWABLE;
1034- + escape.drawable = surface->window;
1035- + escape.flush = TRUE;
1036- +
1037- + ExtEscape(hdc, X11DRV_ESCAPE, sizeof(escape), (char *)&escape, 0, NULL);
1038- + if (surface->present_mode == VK_PRESENT_MODE_MAILBOX_KHR)
1039- + if (once++) FIXME("Application requires child window rendering with mailbox present mode, expect possible tearing!\n");
1040- + }
1041- + }
1042- + }
1043- +
1044- return res;
1045- }
1046-
1047- - -
1048- 2.36.1
1049-
0 commit comments