Commit 75f7bd0e authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

dxgi: Unlock the wined3d mutex after storing the new target.

Otherwise a second thread might set it to something else between the unlock and assignment.
parent 52bdd0db
...@@ -410,12 +410,11 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen ...@@ -410,12 +410,11 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
swapchain_desc.output = dxgi_output->wined3d_output; swapchain_desc.output = dxgi_output->wined3d_output;
swapchain_desc.windowed = !fullscreen; swapchain_desc.windowed = !fullscreen;
hr = wined3d_swapchain_state_set_fullscreen(state, &swapchain_desc, NULL); hr = wined3d_swapchain_state_set_fullscreen(state, &swapchain_desc, NULL);
wined3d_mutex_unlock();
if (FAILED(hr)) if (FAILED(hr))
{ {
IDXGIOutput_Release(target); IDXGIOutput_Release(target);
hr = DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE; goto done;
} }
if (!fullscreen) if (!fullscreen)
...@@ -428,7 +427,9 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen ...@@ -428,7 +427,9 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
IDXGIOutput_Release(swapchain->target); IDXGIOutput_Release(swapchain->target);
swapchain->target = target; swapchain->target = target;
return S_OK; done:
wined3d_mutex_unlock();
return hr;
} }
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapChain1 *iface, static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapChain1 *iface,
...@@ -2098,13 +2099,20 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen ...@@ -2098,13 +2099,20 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen
if (FAILED(hr = wined3d_swapchain_desc_from_dxgi(&wined3d_desc, target, window, swapchain_desc, if (FAILED(hr = wined3d_swapchain_desc_from_dxgi(&wined3d_desc, target, window, swapchain_desc,
fullscreen_desc))) fullscreen_desc)))
goto fail; {
IDXGIOutput_Release(target);
return hr;
}
wined3d_mutex_lock(); wined3d_mutex_lock();
wined3d_desc.windowed = !fullscreen; wined3d_desc.windowed = !fullscreen;
hr = wined3d_swapchain_state_set_fullscreen(swapchain->state, &wined3d_desc, NULL); hr = wined3d_swapchain_state_set_fullscreen(swapchain->state, &wined3d_desc, NULL);
wined3d_mutex_unlock();
if (FAILED(hr)) if (FAILED(hr))
goto fail; {
IDXGIOutput_Release(target);
hr = DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
goto done;
}
fullscreen_desc->Windowed = wined3d_desc.windowed; fullscreen_desc->Windowed = wined3d_desc.windowed;
if (!fullscreen) if (!fullscreen)
...@@ -2117,12 +2125,9 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen ...@@ -2117,12 +2125,9 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d12_swapchain_SetFullscreen
IDXGIOutput_Release(swapchain->target); IDXGIOutput_Release(swapchain->target);
swapchain->target = target; swapchain->target = target;
return S_OK; done:
wined3d_mutex_unlock();
fail: return hr;
IDXGIOutput_Release(target);
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
} }
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapChain4 *iface, static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFullscreenState(IDXGISwapChain4 *iface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment