diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-08-07 02:18:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-07 02:18:01 -0400 |
| commit | e6ed939952f108aeaedc2763b391f2471203305e (patch) | |
| tree | e930a51b682869debdb2b3c0f6db0597357d699d /Source/Core/VideoBackends/Software/SWEfbInterface.cpp | |
| parent | 3111a785a106e4d184d9c3037e1df9a35ce06d31 (diff) | |
| parent | 9ff5943ac6417fe9e38d58a10a1933f3d08f0e33 (diff) | |
Merge pull request #13839 from Tilka/videosw3
VideoSW: allow disabling the copy filter
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWEfbInterface.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWEfbInterface.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/SWEfbInterface.cpp b/Source/Core/VideoBackends/Software/SWEfbInterface.cpp index 1bfc00b938..e2e4003cb4 100644 --- a/Source/Core/VideoBackends/Software/SWEfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/SWEfbInterface.cpp @@ -11,6 +11,8 @@ #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" +#include "Core/Config/GraphicsSettings.h" + #include "VideoBackends/Software/CopyRegion.h" #include "VideoCommon/BPMemory.h" #include "VideoCommon/LookUpTables.h" @@ -494,10 +496,25 @@ static u32 VerticalFilter(const std::array<u32, 3>& colors, // * Coefficients 2, 3 and 4 sample from the current pixel. // * Coefficients 0 and 1 sample from the pixel above this one // * Coefficients 5 and 6 sample from the pixel below this one - int sum = - in_colors[0][i] * (filterCoefficients[0] + filterCoefficients[1]) + - in_colors[1][i] * (filterCoefficients[2] + filterCoefficients[3] + filterCoefficients[4]) + - in_colors[2][i] * (filterCoefficients[5] + filterCoefficients[6]); + // + // We normally don't implement enhancements in the software renderer. + // However, disabling the copy filter is useful for debugging. + const bool disable_copy_filter = Config::Get(Config::GFX_ENHANCE_DISABLE_COPY_FILTER); + int sum; + if (disable_copy_filter) + { + sum = + in_colors[1][i] * (filterCoefficients[0] + filterCoefficients[1] + filterCoefficients[2] + + filterCoefficients[3] + filterCoefficients[4] + filterCoefficients[5] + + filterCoefficients[6]); + } + else + { + sum = in_colors[0][i] * (filterCoefficients[0] + filterCoefficients[1]) + + in_colors[1][i] * + (filterCoefficients[2] + filterCoefficients[3] + filterCoefficients[4]) + + in_colors[2][i] * (filterCoefficients[5] + filterCoefficients[6]); + } // TODO: this clamping behavior appears to be correct, but isn't confirmed on hardware. out_color[i] = std::min(255, sum >> 6); // clamp larger values to 255 |
