summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/host_shaders/astc_decoder.comp14
1 files 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) {
418} 418}
419 419
420uint BitsOp(uint bits, uint start, uint end) { 420uint BitsOp(uint bits, uint start, uint end) {
421 if (start == end) {
422 return BitsBracket(bits, start);
423 } else if (start > end) {
424 uint t = start;
425 start = end;
426 end = t;
427 }
428
429 uint mask = (1 << (end - start + 1)) - 1; 421 uint mask = (1 << (end - start + 1)) - 1;
430 return ((bits >> start) & mask); 422 return ((bits >> start) & mask);
431} 423}
@@ -665,10 +657,8 @@ ivec2 BitTransferSigned(int a, int b) {
665} 657}
666 658
667uvec4 ClampByte(ivec4 color) { 659uvec4 ClampByte(ivec4 color) {
668 for (uint i = 0; i < 4; ++i) { 660 const uvec4 clamped = uvec4(clamp(color, 0, 255));
669 color[i] = (color[i] < 0) ? 0 : ((color[i] > 255) ? 255 : color[i]); 661 return clamped;
670 }
671 return uvec4(color);
672} 662}
673 663
674ivec4 BlueContract(int a, int r, int g, int b) { 664ivec4 BlueContract(int a, int r, int g, int b) {