diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2022-02-07 12:11:15 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2022-07-15 12:29:40 -0700 |
| commit | bed278d3b7d200e25527b2deb1a1e5f70ed3ff05 (patch) | |
| tree | 167f5020e67403d266883b3d2c553f9136111957 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | dd41a72378ee45e2947fa65e6db03b5898272b45 (diff) | |
Create dedicated enum for EFB/XFB gamma correction
This also changes the behavior for the invalid gamma value, which was confirmed to behave the same as 2.2.
Note that currently, the gamma value is only used for XFB copies, even though hardware testing indicates it also works for EFB copies. This will be changed in a later commit.
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 2e34ef6d9b..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.auto_conv, 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 { |
