From ada463badcc178a6957d6ad1c633c434cf4015b4 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sat, 7 Aug 2021 16:41:14 +0200 Subject: [PATCH] [d3d9] Mark mips as dirty on Clear if needed --- src/d3d9/d3d9_device.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index b15632d3..2450eab5 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -1493,10 +1493,17 @@ namespace dxvk { // Clear render targets if we need to. if (Flags & D3DCLEAR_TARGET) { for (uint32_t rt = m_boundRTs; rt; rt &= rt - 1) { - const auto& rtv = m_state.renderTargets[bit::tzcnt(rt)]->GetRenderTargetView(srgb); + const auto& rts = m_state.renderTargets[bit::tzcnt(rt)]; + const auto& rtv = rts->GetRenderTargetView(srgb); - if (likely(rtv != nullptr)) + if (likely(rtv != nullptr)) { ClearImageView(fullClear, offset, extent, rtv, VK_IMAGE_ASPECT_COLOR_BIT, clearValueColor); + + D3D9CommonTexture* dstTexture = rts->GetCommonTexture(); + + if (dstTexture->IsAutomaticMip()) + MarkTextureMipsDirty(dstTexture); + } } } };