From 4c3070e8b8dd8327bd8bacc8a0829dae6f1c336c Mon Sep 17 00:00:00 2001 From: winesync Date: Tue, 12 Sep 2023 11:42:51 -0700 Subject: [PATCH] [WINESYNC] wined3d: Lock wined3d mutex in wined3d_swapchain_present(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard wine commit id 9042fbe1e4838136bd68905df13fb3264af9a64d by Józef Kucia --- dll/directx/wine/d3d8/swapchain.c | 7 +------ dll/directx/wine/d3d9/swapchain.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/dll/directx/wine/d3d8/swapchain.c b/dll/directx/wine/d3d8/swapchain.c index 6e8b98e3b6def..c9abfffffda3c 100644 --- a/dll/directx/wine/d3d8/swapchain.c +++ b/dll/directx/wine/d3d8/swapchain.c @@ -88,7 +88,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_swapchain_Present(IDirect3DSwapChai { struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface); struct d3d8_device *device = impl_from_IDirect3DDevice8(swapchain->parent_device); - HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); @@ -99,12 +98,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_swapchain_Present(IDirect3DSwapChai if (dirty_region) FIXME("Ignoring dirty_region %p.\n", dirty_region); - wined3d_mutex_lock(); - hr = wined3d_swapchain_present(swapchain->wined3d_swapchain, + return wined3d_swapchain_present(swapchain->wined3d_swapchain, src_rect, dst_rect, dst_window_override, swapchain->swap_interval, 0); - wined3d_mutex_unlock(); - - return hr; } static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface, diff --git a/dll/directx/wine/d3d9/swapchain.c b/dll/directx/wine/d3d9/swapchain.c index 1279663dd52ba..00ead0fc3e3ef 100644 --- a/dll/directx/wine/d3d9/swapchain.c +++ b/dll/directx/wine/d3d9/swapchain.c @@ -140,7 +140,6 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_swapchain_Present(IDirect3DSwapChai { struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface); struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(swapchain->parent_device); - HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), @@ -152,12 +151,8 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_swapchain_Present(IDirect3DSwapChai if (dirty_region) FIXME("Ignoring dirty_region %p.\n", dirty_region); - wined3d_mutex_lock(); - hr = wined3d_swapchain_present(swapchain->wined3d_swapchain, + return wined3d_swapchain_present(swapchain->wined3d_swapchain, src_rect, dst_rect, dst_window_override, swapchain->swap_interval, flags); - wined3d_mutex_unlock(); - - return hr; } static HRESULT WINAPI d3d9_swapchain_GetFrontBufferData(IDirect3DSwapChain9Ex *iface, IDirect3DSurface9 *surface)