D3D: Fix EFB->XFB copies incorrectly scaling, match GL behavior

This commit is contained in:
Stenzek 2015-11-28 20:04:36 +10:00
parent 861bd98e3a
commit 5e803c3db3
2 changed files with 7 additions and 6 deletions

View File

@ -199,12 +199,13 @@ void XFBSource::CopyEFB(float Gamma)
// Copy EFB data to XFB and restore render target again
const D3D11_VIEWPORT vp = CD3D11_VIEWPORT(0.f, 0.f, (float)texWidth, (float)texHeight);
const D3D11_RECT rect = CD3D11_RECT(0, 0, texWidth, texHeight);
D3D::context->RSSetViewports(1, &vp);
D3D::context->OMSetRenderTargets(1, &tex->GetRTV(), nullptr);
D3D::SetLinearCopySampler();
D3D::SetPointCopySampler();
D3D::drawShadedTexQuad(FramebufferManager::GetEFBColorTexture()->GetSRV(), sourceRc.AsRECT(),
D3D::drawShadedTexQuad(FramebufferManager::GetEFBColorTexture()->GetSRV(), &rect,
Renderer::GetTargetWidth(), Renderer::GetTargetHeight(), PixelShaderCache::GetColorCopyProgram(true),
VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout(),
GeometryShaderCache::GetCopyGeometryShader(), Gamma);

View File

@ -783,10 +783,10 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
//drawRc.right *= hScale;
TargetRectangle sourceRc;
sourceRc.left = 0;
sourceRc.top = 0;
sourceRc.right = (int)xfbSource->texWidth;
sourceRc.bottom = (int)xfbSource->texHeight;
sourceRc.left = xfbSource->sourceRc.left;
sourceRc.top = xfbSource->sourceRc.top;
sourceRc.right = xfbSource->sourceRc.right;
sourceRc.bottom = xfbSource->sourceRc.bottom;
sourceRc.right -= Renderer::EFBToScaledX(fbStride - fbWidth);