Parcourir la source

st/nine: Ignore window size if error

Check GetWindowInfo and ignore the computed sizes
if there is an error.

Fixes a regression caused by earlier commit when
using old wine gallium nine patches.

Should also address a crash at window destruction.

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

Cc: mesa-stable@lists.freedesktop.org
Fixes: 2318ca68bb ("st/nine: Handle window resize when a presentation
buffer is used")

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
tags/19.1-branchpoint
Axel Davy il y a 6 ans
Parent
révision
86666f051e
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8
    1
      src/gallium/state_trackers/nine/swapchain9.c

+ 8
- 1
src/gallium/state_trackers/nine/swapchain9.c Voir le fichier

@@ -750,9 +750,16 @@ present( struct NineSwapChain9 *This,
if (This->params.SwapEffect == D3DSWAPEFFECT_DISCARD)
handle_draw_cursor_and_hud(This, resource);

ID3DPresent_GetWindowInfo(This->present, hDestWindowOverride, &target_width, &target_height, &target_depth);
hr = ID3DPresent_GetWindowInfo(This->present, hDestWindowOverride, &target_width, &target_height, &target_depth);
(void)target_depth;

/* Can happen with old Wine (presentation can still succeed),
* or at window destruction. */
if (FAILED(hr) || 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

Chargement…
Annuler
Enregistrer