Merge pull request #2000 from CookiePLMonster/copyrects-fallback

Add a fallback to CopyRects for cases which StretchRect can't handle
This commit is contained in:
PatrickvL 2020-10-21 01:04:09 +02:00 committed by GitHub
commit 7938142faf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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");
}
}
}
}