From 784abe5cf4b7e95e9a992cf44400bd66e3f37fcd Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 18 Dec 2019 00:07:02 +0000 Subject: [PATCH] [d3d9] Move auto depth stencil creation to after swapchain creation If the app specifies w == 0 and/or h == 0 then this will be filled in by then in the presentation params. Impacts #1278 --- src/d3d9/d3d9_device.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 8b98ebc0..9b1331ca 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -6469,6 +6469,11 @@ namespace dxvk { } } + if (auto* implicitSwapchain = GetInternalSwapchain(0)) + implicitSwapchain->Reset(pPresentationParameters, pFullscreenDisplayMode); + else + m_swapchains.emplace_back(new D3D9SwapChainEx(this, pPresentationParameters, pFullscreenDisplayMode)); + if (pPresentationParameters->EnableAutoDepthStencil) { D3D9_COMMON_TEXTURE_DESC desc; desc.Width = pPresentationParameters->BackBufferWidth; @@ -6492,11 +6497,6 @@ namespace dxvk { SetDepthStencilSurface(m_autoDepthStencil.ptr()); } - if (auto* implicitSwapchain = GetInternalSwapchain(0)) - implicitSwapchain->Reset(pPresentationParameters, pFullscreenDisplayMode); - else - m_swapchains.emplace_back(new D3D9SwapChainEx(this, pPresentationParameters, pFullscreenDisplayMode)); - SetRenderTarget(0, GetInternalSwapchain(0)->GetBackBuffer(0)); // Force this if we end up binding the same RT to make scissor change go into effect.