From d1596da69512217d70907c5cbb3430359698597d Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 25 Nov 2020 23:58:45 +1300 Subject: [PATCH] Resolve the rendertarget upscale factor once --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 4e3bc5b7f..4bb5d6fd7 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -4862,12 +4862,14 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_Clear) // Scale the fill based on our scale factor and MSAA scale float aaX, aaY; GetMultiSampleScaleRaw(aaX, aaY); + auto rtUpscale = GetRenderTargetUpscaleFactor(); + std::vector rects(Count); for (DWORD i = 0; i < Count; i++) { - rects[i].x1 = static_cast(pRects[i].x1 * aaX * GetRenderTargetUpscaleFactor()); - rects[i].x2 = static_cast(pRects[i].x2 * aaX * GetRenderTargetUpscaleFactor()); - rects[i].y1 = static_cast(pRects[i].y1 * aaY * GetRenderTargetUpscaleFactor()); - rects[i].y2 = static_cast(pRects[i].y2 * aaY * GetRenderTargetUpscaleFactor()); + rects[i].x1 = static_cast(pRects[i].x1 * aaX * rtUpscale); + rects[i].x2 = static_cast(pRects[i].x2 * aaX * rtUpscale); + rects[i].y1 = static_cast(pRects[i].y1 * aaY * rtUpscale); + rects[i].y2 = static_cast(pRects[i].y2 * aaY * rtUpscale); } hRet = g_pD3DDevice->Clear(Count, rects.data(), HostFlags, Color, Z, Stencil); } else {