summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2022-07-17 00:07:50 -0400
committerGitHub <noreply@github.com>2022-07-17 00:07:50 -0400
commitf1d23ff9a48ce866f9cd391d32eacb4bfb1c244e (patch)
tree1dcb1a30c58a973c881092525eb797c6b1e635f5 /Source/Core/VideoCommon/BPStructs.cpp
parent2ef069e0e861e275497854e0fe2d19f0c333850a (diff)
parenta6e06f38adb933187605ac07ef7a0cb1940afa80 (diff)
Merge pull request #10466 from Pokechu22/efb-copy-gamma
Accurately handle the copy filter and gamma for EFB and XFB copies
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index c6746d444a..010dbf6abe 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -11,6 +11,7 @@
#include <fmt/format.h>
#include "Common/CommonTypes.h"
+#include "Common/EnumMap.h"
#include "Common/Logging/Log.h"
#include "Core/ConfigManager.h"
@@ -42,7 +43,8 @@
using namespace BPFunctions;
-static const float s_gammaLUT[] = {1.0f, 1.7f, 2.2f, 1.0f};
+static constexpr Common::EnumMap<float, GammaCorrection::Invalid2_2> s_gammaLUT = {1.0f, 1.7f, 2.2f,
+ 2.2f};
void BPInit()
{
@@ -276,9 +278,9 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
bool is_depth_copy = bpmem.zcontrol.pixel_format == PixelFormat::Z24;
g_texture_cache->CopyRenderTargetToTexture(
destAddr, PE_copy.tp_realFormat(), copy_width, copy_height, destStride, is_depth_copy,
- srcRect, PE_copy.intensity_fmt, PE_copy.half_scale, 1.0f, 1.0f,
- bpmem.triggerEFBCopy.clamp_top, bpmem.triggerEFBCopy.clamp_bottom,
- bpmem.copyfilter.GetCoefficients());
+ srcRect, PE_copy.intensity_fmt && PE_copy.auto_conv, PE_copy.half_scale, 1.0f,
+ s_gammaLUT[PE_copy.gamma], bpmem.triggerEFBCopy.clamp_top,
+ bpmem.triggerEFBCopy.clamp_bottom, bpmem.copyfilter.GetCoefficients());
}
else
{