From 860237e775b72f3f23cd8e0c02155971763729c7 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Tue, 2 May 2023 00:54:57 +0200 Subject: [PATCH] [d3d9] Skip 0x0 clears --- src/d3d9/d3d9_device.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index d528fe9d..d66ba349 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -1602,6 +1602,10 @@ namespace dxvk { // This works around that. uint32_t alignment = m_d3d9Options.lenientClear ? 8 : 1; + if (extent.width == 0 || extent.height == 0) { + return D3D_OK; + } + if (!Count) { // Clear our viewport & scissor minified region in this rendertarget. ClearViewRect(alignment, offset, extent); @@ -1615,6 +1619,11 @@ namespace dxvk { 0 }; + if (std::min(pRects[i].x2, offset.x + extent.width) <= rectOffset.x + || std::min(pRects[i].y2, offset.y + extent.height) <= rectOffset.y) { + continue; + } + VkExtent3D rectExtent = { std::min(pRects[i].x2, offset.x + extent.width) - rectOffset.x, std::min(pRects[i].y2, offset.y + extent.height) - rectOffset.y,