From ea98d4bdea91217d71aa173f64fc7d2105267fef Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 20 Oct 2020 19:40:46 +0200 Subject: [PATCH] Add a fallback to CopyRects for cases which StretchRect can't handle Fixes menus in World Racing 2 because CopyRects tries to copy a texture to texture. --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 541834118..ae4665977 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -5118,7 +5118,11 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_CopyRects) HRESULT hRet = g_pD3DDevice->StretchRect(pHostSourceSurface, &SourceRect, pHostDestSurface, &DestRect, D3DTEXF_LINEAR); if (FAILED(hRet)) { - LOG_TEST_CASE("D3DDevice_CopyRects: Failed to copy surface"); + // Fallback for cases which StretchRect cannot handle (such as copying from texture to texture) + hRet = D3DXLoadSurfaceFromSurface(pHostDestSurface, nullptr, &DestRect, pHostSourceSurface, nullptr, &SourceRect, D3DTEXF_LINEAR, 0); + if (FAILED(hRet)) { + LOG_TEST_CASE("D3DDevice_CopyRects: Failed to copy surface"); + } } } }