[d3d9] Skip presenting if D3D9Swapchain has no associated window

This commit is contained in:
Robin Kertels 2024-03-07 15:28:52 +01:00
parent 27cc907279
commit 807c1075bd
No known key found for this signature in database
GPG Key ID: 3824904F14D40757
1 changed files with 10 additions and 4 deletions

View File

@ -172,6 +172,9 @@ namespace dxvk {
m_lastDialog = m_dialog; m_lastDialog = m_dialog;
if (m_window == nullptr)
return D3D_OK;
#ifdef _WIN32 #ifdef _WIN32
const bool useGDIFallback = m_partialCopy && !HasFrontBuffer(); const bool useGDIFallback = m_partialCopy && !HasFrontBuffer();
if (useGDIFallback) if (useGDIFallback)
@ -994,6 +997,9 @@ namespace dxvk {
void D3D9SwapChainEx::UpdateWindowCtx() { void D3D9SwapChainEx::UpdateWindowCtx() {
if (m_window == nullptr)
return;
if (!m_presenters.count(m_window)) { if (!m_presenters.count(m_window)) {
auto res = m_presenters.emplace( auto res = m_presenters.emplace(
std::piecewise_construct, std::piecewise_construct,
@ -1323,10 +1329,10 @@ namespace dxvk {
|| dstRect.right - dstRect.left != LONG(width) || dstRect.right - dstRect.left != LONG(width)
|| dstRect.bottom - dstRect.top != LONG(height); || dstRect.bottom - dstRect.top != LONG(height);
bool recreate = bool recreate = m_wctx != nullptr
m_wctx->presenter == nullptr && (m_wctx->presenter == nullptr
|| m_wctx->presenter->info().imageExtent.width != width || m_wctx->presenter->info().imageExtent.width != width
|| m_wctx->presenter->info().imageExtent.height != height; || m_wctx->presenter->info().imageExtent.height != height);
m_swapchainExtent = { width, height }; m_swapchainExtent = { width, height };
m_dstRect = dstRect; m_dstRect = dstRect;