[Mesa-dev] [PATCH 31/45] st/nine: Fix crash NineDevice9_CreateAdditionalSwapChain

Axel Davy axel.davy at ens.fr
Fri Jan 29 08:08:55 PST 2016


When no window is specified, we should revert to the focus window.

This deserves more tests however (what if the device swapchain is
already using the focus window ?)

Fixes crash for FFXIV

Signed-off-by: Axel Davy <axel.davy at ens.fr>
Reviewed-by: Patrick Rudolph <siro at das-labor.org>
---
 src/gallium/state_trackers/nine/device9.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 8724136..963c6e3 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -711,6 +711,10 @@ NineDevice9_CreateAdditionalSwapChain( struct NineDevice9 *This,
 
     user_assert(pPresentationParameters, D3DERR_INVALIDCALL);
 
+    /* TODO: this deserves more tests */
+    if (!pPresentationParameters->hDeviceWindow)
+        pPresentationParameters->hDeviceWindow = This->params.hFocusWindow;
+
     hr = ID3DPresentGroup_CreateAdditionalPresent(This->present, pPresentationParameters, &present);
 
     if (FAILED(hr))
-- 
2.7.0



More information about the mesa-dev mailing list