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