diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2017-07-02 21:24:20 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2017-11-17 22:11:29 -0600 |
| commit | b285188de1a38565b9718bdac7fe698ee870d914 (patch) | |
| tree | 0eaaf2baf9ed5bd32c92afbcf4562842fbba0eb4 /Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | |
| parent | 5a372020ea989abb5dfaf10040d6e3fbd90c8001 (diff) | |
Video Backends: Implement vertical scaling for xfb copies. This fixes the
display of PAL games that run in 50hz mode.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp index 7c05215948..2aafb299bf 100644 --- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp +++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp @@ -26,6 +26,8 @@ struct EFBEncodeParams s32 SrcTop; u32 DestWidth; u32 ScaleFactor; + float y_scale; + u32 padding[3]; }; PSTextureEncoder::PSTextureEncoder() @@ -45,7 +47,7 @@ void PSTextureEncoder::Init() // EFB2RAM copies use max (EFB_WIDTH * 4) by (EFB_HEIGHT / 4) // XFB2RAM copies use max (EFB_WIDTH / 2) by (EFB_HEIGHT) D3D11_TEXTURE2D_DESC t2dd = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_B8G8R8A8_UNORM, EFB_WIDTH * 4, - EFB_HEIGHT, 1, 1, D3D11_BIND_RENDER_TARGET); + 1024, 1, 1, D3D11_BIND_RENDER_TARGET); hr = D3D::device->CreateTexture2D(&t2dd, nullptr, &m_out); CHECK(SUCCEEDED(hr), "create efb encode output texture"); D3D::SetDebugObjectName(m_out, "efb encoder output texture"); @@ -127,6 +129,7 @@ void PSTextureEncoder::Encode(u8* dst, const EFBCopyParams& params, u32 native_w encode_params.SrcTop = src_rect.top; encode_params.DestWidth = native_width; encode_params.ScaleFactor = scale_by_half ? 2 : 1; + encode_params.y_scale = params.y_scale; D3D::context->UpdateSubresource(m_encodeParams, 0, nullptr, &encode_params, 0, 0); D3D::stateman->SetPixelConstants(m_encodeParams); @@ -134,7 +137,7 @@ void PSTextureEncoder::Encode(u8* dst, const EFBCopyParams& params, u32 native_w // TODO: This only produces perfect downsampling for 2x IR, other resolutions will need more // complex down filtering to average all pixels and produce the correct result. // Also, box filtering won't be correct for anything other than 1x IR - if (scale_by_half || g_renderer->GetEFBScale() != 1) + if (scale_by_half || g_renderer->GetEFBScale() != 1 || params.y_scale > 1.0f) D3D::SetLinearCopySampler(); else D3D::SetPointCopySampler(); |
