[Mesa-stable] [PATCH] st/nine: Ignore null sized windows

Axel Davy davyaxel0 at gmail.com
Thu Jan 3 20:48:11 UTC 2019


If for some reason the window size detected
is null, just render at normal size.

Fixes the regression caused by:
commit 2318ca68bbeb4fa6e21a4d8c650cec3f64246596
"st/nine: Handle window resize when a presentation buffer is used"

Fixes: https://github.com/iXit/Mesa-3D/issues/331
Fixes: https://github.com/iXit/Mesa-3D/issues/332

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Axel Davy <davyaxel0 at gmail.com>
---
It may not apply cleanly to mesa stable. I can do another
patch for stable if needed. Basically it's the very same code
except the part "/* Switch to using presentation buffers ...*/"
would be replaced by "pipe = NineDevice9_GetPipe(This->base.device);"

 src/gallium/state_trackers/nine/swapchain9.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index 6c22be24c7c..ceaa1cd848a 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -753,6 +753,12 @@ present( struct NineSwapChain9 *This,
     ID3DPresent_GetWindowInfo(This->present, hDestWindowOverride, &target_width, &target_height, &target_depth);
     (void)target_depth;
 
+    /* Can happen for a few frames. */
+    if (target_width == 0 || target_height == 0) {
+        target_width = resource->width0;
+        target_height = resource->height0;
+    }
+
     /* Switch to using presentation buffers on window resize.
      * Note: Most apps should resize the d3d back buffers when
      * a window resize is detected, which will result in a call to
-- 
2.19.2



More information about the mesa-stable mailing list