summaryrefslogtreecommitdiff
path: root/src/video_core/textures/astc.cpp
diff options
context:
space:
mode:
authorGravatar ameerj2021-06-15 20:16:16 -0400
committerGravatar ameerj2021-06-15 20:19:01 -0400
commit5fc8393125ef0084491b7acaec13e62fe593adf1 (patch)
tree160ed78eb6e0df36e8462e4982b4eaa7ce9d66b1 /src/video_core/textures/astc.cpp
parentyuzu_cmd/config: Add Accelerate ASTC and missing NVDEC emulation settings (diff)
downloadyuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.gz
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.xz
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.zip
astc_decoder: Fix LDR CEM1 endpoint calculation
Per the spec, L1 is clamped to the value 0xff if it is greater than 0xff. An oversight caused us to take the maximum of L1 and 0xff, rather than the minimum. Huge thanks to wwylele for finding this. Co-Authored-By: Weiyi Wang <wwylele@gmail.com>
Diffstat (limited to 'src/video_core/textures/astc.cpp')
-rw-r--r--src/video_core/textures/astc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index 6079aa709..9b2177ebd 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -1217,7 +1217,7 @@ static void ComputeEndpoints(Pixel& ep1, Pixel& ep2, const u32*& colorValues,
1217 case 1: { 1217 case 1: {
1218 READ_UINT_VALUES(2) 1218 READ_UINT_VALUES(2)
1219 u32 L0 = (v[0] >> 2) | (v[1] & 0xC0); 1219 u32 L0 = (v[0] >> 2) | (v[1] & 0xC0);
1220 u32 L1 = std::max(L0 + (v[1] & 0x3F), 0xFFU); 1220 u32 L1 = std::min(L0 + (v[1] & 0x3F), 0xFFU);
1221 ep1 = Pixel(0xFF, L0, L0, L0); 1221 ep1 = Pixel(0xFF, L0, L0, L0);
1222 ep2 = Pixel(0xFF, L1, L1, L1); 1222 ep2 = Pixel(0xFF, L1, L1, L1);
1223 } break; 1223 } break;