From 998246efc27950e3fbebc00a8ca3442dfabb9904 Mon Sep 17 00:00:00 2001 From: Ameer J <52414509+ameerj@users.noreply.github.com> Date: Sun, 30 Jul 2023 13:12:12 -0400 Subject: [PATCH] minor redundancy cleanup --- src/video_core/host_shaders/astc_decoder.comp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/video_core/host_shaders/astc_decoder.comp b/src/video_core/host_shaders/astc_decoder.comp index f65e1d1b9..90b40c55f 100644 --- a/src/video_core/host_shaders/astc_decoder.comp +++ b/src/video_core/host_shaders/astc_decoder.comp @@ -418,14 +418,6 @@ uint BitsBracket(uint bits, uint pos) { } uint BitsOp(uint bits, uint start, uint end) { - if (start == end) { - return BitsBracket(bits, start); - } else if (start > end) { - uint t = start; - start = end; - end = t; - } - uint mask = (1 << (end - start + 1)) - 1; return ((bits >> start) & mask); } @@ -665,10 +657,8 @@ ivec2 BitTransferSigned(int a, int b) { } uvec4 ClampByte(ivec4 color) { - for (uint i = 0; i < 4; ++i) { - color[i] = (color[i] < 0) ? 0 : ((color[i] > 255) ? 255 : color[i]); - } - return uvec4(color); + const uvec4 clamped = uvec4(clamp(color, 0, 255)); + return clamped; } ivec4 BlueContract(int a, int r, int g, int b) {