aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/host_shaders/astc_decoder.comp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-15 20:16:16 -0400
committerameerj <52414509+ameerj@users.noreply.github.com>2021-06-15 20:19:01 -0400
commit13b046aae1a129bcb6c726a50149d5d36fc0fa06 (patch)
tree160ed78eb6e0df36e8462e4982b4eaa7ce9d66b1 /src/video_core/host_shaders/astc_decoder.comp
parenta91f7f695738487b66d39999ff34a273447a4134 (diff)
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/host_shaders/astc_decoder.comp')
-rw-r--r--src/video_core/host_shaders/astc_decoder.comp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp
index 703e345875..eaba1b1033 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;