diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 7569117ea..bdbbf25a6 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -929,6 +929,9 @@ namespace dxvk { ctx->resolveImage(cDstImage, cSrcImage, region, cFormat); }); + + if constexpr (!IsDeferred) + GetTypedContext()->m_hasPendingMsaaResolve = false; } if (dstTextureInfo->HasSequenceNumber()) @@ -4901,6 +4904,7 @@ namespace dxvk { return; bool needsUpdate = false; + bool isMultisampled = false; if (likely(NumRTVs != D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL)) { // Native D3D11 does not change the render targets if @@ -4920,6 +4924,9 @@ namespace dxvk { if (NumUAVs == D3D11_KEEP_UNORDERED_ACCESS_VIEWS) ResolveOmUavHazards(rtv); + + if (rtv && rtv->GetSampleCount() > 1u) + isMultisampled = true; } } @@ -4929,6 +4936,9 @@ namespace dxvk { m_state.om.dsv = dsv; needsUpdate = true; ResolveOmSrvHazards(dsv); + + if (dsv && dsv->GetSampleCount() > 1u) + isMultisampled = true; } m_state.om.maxRtv = NumRTVs; @@ -4972,7 +4982,12 @@ namespace dxvk { if constexpr (!IsDeferred) { // Doing this makes it less likely to flush during render passes - GetTypedContext()->ConsiderFlush(GpuFlushType::ImplicitWeakHint); + auto imm = GetTypedContext(); + + if (!imm->m_hasPendingMsaaResolve || !m_device->perfHints().preferRenderPassOps) + imm->ConsiderFlush(GpuFlushType::ImplicitMediumHint); + + imm->m_hasPendingMsaaResolve |= isMultisampled; } } } diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 90497b1e3..e762dd9eb 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -1035,6 +1035,9 @@ namespace dxvk { // Notify the device that the context has been flushed, // this resets some resource initialization heuristics. m_parent->NotifyContextFlush(); + + // No point in tracking this across submissions + m_hasPendingMsaaResolve = false; } @@ -1081,7 +1084,7 @@ namespace dxvk { if (pParent->GetOptions()->reproducibleCommandStream) return GpuFlushType::ExplicitFlush; else if (Device->perfHints().preferRenderPassOps) - return GpuFlushType::ImplicitStrongHint; + return GpuFlushType::ImplicitMediumHint; else return GpuFlushType::ImplicitWeakHint; } diff --git a/src/d3d11/d3d11_context_imm.h b/src/d3d11/d3d11_context_imm.h index ca4fc5670..a73dfe6d0 100644 --- a/src/d3d11/d3d11_context_imm.h +++ b/src/d3d11/d3d11_context_imm.h @@ -131,6 +131,8 @@ namespace dxvk { VkDeviceSize m_discardMemoryCounter = 0u; VkDeviceSize m_discardMemoryOnFlush = 0u; + bool m_hasPendingMsaaResolve = false; + D3D10Multithread m_multithread; D3D11VideoContext m_videoContext;