summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-16 02:16:16 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-06-16 02:19:01 +0200
commit5fc8393125ef0084491b7acaec13e62fe593adf1 (patch)
tree160ed78eb6e0df36e8462e4982b4eaa7ce9d66b1
parentyuzu_cmd/config: Add Accelerate ASTC and missing NVDEC emulation settings (diff)
downloadyuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.gz
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.bz2
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.lz
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.xz
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.tar.zst
yuzu-5fc8393125ef0084491b7acaec13e62fe593adf1.zip
-rw-r--r--src/video_core/host_shaders/astc_decoder.comp2
-rw-r--r--src/video_core/textures/astc.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp
index 703e34587..eaba1b103 100644
--- a/src/video_core/host_shaders/astc_decoder.comp
+++ b/src/video_core/host_shaders/astc_decoder.comp
@@ -763,7 +763,7 @@ void ComputeEndpoints(out uvec4 ep1, out uvec4 ep2, uint color_endpoint_mode) {
case 1: {
READ_UINT_VALUES(2)
uint L0 = (v[0] >> 2) | (v[1] & 0xC0);
- uint L1 = max(L0 + (v[1] & 0x3F), 0xFFU);
+ uint L1 = min(L0 + (v[1] & 0x3F), 0xFFU);
ep1 = uvec4(0xFF, L0, L0, L0);
ep2 = uvec4(0xFF, L1, L1, L1);
break;
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,
case 1: {
READ_UINT_VALUES(2)
u32 L0 = (v[0] >> 2) | (v[1] & 0xC0);
- u32 L1 = std::max(L0 + (v[1] & 0x3F), 0xFFU);
+ u32 L1 = std::min(L0 + (v[1] & 0x3F), 0xFFU);
ep1 = Pixel(0xFF, L0, L0, L0);
ep2 = Pixel(0xFF, L1, L1, L1);
} break;