diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-02-15 00:32:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-15 00:32:14 -0500 |
| commit | c360ea0d9d5caaa0d305711eb1a86ad30d6353da (patch) | |
| tree | 6b4855c836b69a6b45c505db1d83349d2ed39337 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | 0fc36bbfa94fb33e423d7a39d59b62a9b768d018 (diff) | |
| parent | 5db6bd6054c6d535142102a3f54d8fa239f33b1c (diff) | |
Merge pull request #13344 from Tilka/dither
VideoCommon: simplify dither calculation
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index a76681634f..0b027b2496 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1308,9 +1308,9 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos if (uid_data->dither) { // Flipper uses a standard 2x2 Bayer Matrix for 6 bit dithering - // Here the matrix is encoded into the two factor constants out.Write("\tint2 dither = int2(rawpos.xy) & 1;\n"); - out.Write("\tprev.rgb = (prev.rgb - (prev.rgb >> 6)) + abs(dither.y * 3 - dither.x * 2);\n"); + out.Write( + "\tprev.rgb = (prev.rgb - (prev.rgb >> 6)) + (dither.x ^ dither.y) * 2 + dither.y;\n"); } WriteFog(out, uid_data); |
