=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Execute all CS commands before changing swapchain window.

Alexandre Julliard julliard at winehq.org
Mon Jun 11 13:10:51 CDT 2018


Module: wine
Branch: master
Commit: 49da19e51ba5623a5e169a59fe3de1414b80ebba
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=49da19e51ba5623a5e169a59fe3de1414b80ebba

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Jun 11 12:05:06 2018 +0200

wined3d: Execute all CS commands before changing swapchain window.

Fixes a race condition.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/swapchain.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 7a3f1ff..9df40ab 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -135,6 +135,8 @@ void * CDECL wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapch
 
 void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window)
 {
+    struct wined3d_device *device = swapchain->device;
+
     if (!window)
         window = swapchain->device_window;
     if (window == swapchain->win_handle)
@@ -142,6 +144,9 @@ void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWN
 
     TRACE("Setting swapchain %p window from %p to %p.\n",
             swapchain, swapchain->win_handle, window);
+
+    device->cs->ops->finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
+
     swapchain->win_handle = window;
 }
 




More information about the wine-cvs mailing list