summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2018-05-01 19:31:54 +1000
committerGitHub <noreply@github.com>2018-05-01 19:31:54 +1000
commitc46882142bffbfc18103d4c977dd2551408e229c (patch)
tree5c27fdafb147e9cdea441dc192049c243f415496 /Source/Core/VideoCommon/BPStructs.cpp
parent42d73deaed9e79e8d2e45c1a0ebfa69d19a9c9b3 (diff)
parentea4090d92c51a53ee7aedcd1fe7871861a78550c (diff)
Merge pull request #6369 from stenzek/xfb-copy-filter
Implement copy filter (deflickering/brightness) and XFB gamma
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 4647c3de4e..0e0d639a63 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -229,10 +229,13 @@ static void BPWritten(const BPCmd& bp)
{
// bpmem.zcontrol.pixel_format to PEControl::Z24 is when the game wants to copy from ZBuffer
// (Zbuffer uses 24-bit Format)
+ static constexpr CopyFilterCoefficients::Values filter_coefficients = {
+ {0, 0, 21, 22, 21, 0, 0}};
bool is_depth_copy = bpmem.zcontrol.pixel_format == PEControl::Z24;
g_texture_cache->CopyRenderTargetToTexture(
destAddr, PE_copy.tp_realFormat(), srcRect.GetWidth(), srcRect.GetHeight(), destStride,
- is_depth_copy, srcRect, !!PE_copy.intensity_fmt, !!PE_copy.half_scale, 1.0f, 1.0f);
+ is_depth_copy, srcRect, !!PE_copy.intensity_fmt, !!PE_copy.half_scale, 1.0f, 1.0f,
+ bpmem.triggerEFBCopy.clamp_top, bpmem.triggerEFBCopy.clamp_bottom, filter_coefficients);
}
else
{
@@ -260,9 +263,10 @@ static void BPWritten(const BPCmd& bp)
bpmem.copyTexSrcWH.x + 1, destStride, height, yScale);
bool is_depth_copy = bpmem.zcontrol.pixel_format == PEControl::Z24;
- g_texture_cache->CopyRenderTargetToTexture(destAddr, EFBCopyFormat::XFB, srcRect.GetWidth(),
- height, destStride, is_depth_copy, srcRect, false,
- false, yScale, s_gammaLUT[PE_copy.gamma]);
+ g_texture_cache->CopyRenderTargetToTexture(
+ destAddr, EFBCopyFormat::XFB, srcRect.GetWidth(), height, destStride, is_depth_copy,
+ srcRect, false, false, yScale, s_gammaLUT[PE_copy.gamma], bpmem.triggerEFBCopy.clamp_top,
+ bpmem.triggerEFBCopy.clamp_bottom, bpmem.copyfilter.GetCoefficients());
// This stays in to signal end of a "frame"
g_renderer->RenderToXFB(destAddr, srcRect, destStride, height, s_gammaLUT[PE_copy.gamma]);
@@ -1015,9 +1019,9 @@ void GetBPRegInfo(const u8* data, std::string* name, std::string* desc)
"Copy to XFB: %s\n"
"Intensity format: %s\n"
"Automatic color conversion: %s",
- (copy.clamp0 && copy.clamp1) ?
+ (copy.clamp_top && copy.clamp_bottom) ?
"Top and Bottom" :
- (copy.clamp0) ? "Top only" : (copy.clamp1) ? "Bottom only" : "None",
+ (copy.clamp_top) ? "Top only" : (copy.clamp_bottom) ? "Bottom only" : "None",
no_yes[copy.yuv], static_cast<int>(copy.tp_realFormat()),
(copy.gamma == 0) ?
"1.0" :