diff options
| author | 2023-07-30 13:12:12 -0400 | |
|---|---|---|
| committer | 2023-08-06 14:54:57 -0400 | |
| commit | 998246efc27950e3fbebc00a8ca3442dfabb9904 (patch) | |
| tree | f630dd0fd90aa75a99a9cee3e636dc21174a4ff3 /src/video_core/host_shaders | |
| parent | extractbits robustness (diff) | |
| download | yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.gz yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.xz yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.zip | |
minor redundancy cleanup
Diffstat (limited to 'src/video_core/host_shaders')
| -rw-r--r-- | src/video_core/host_shaders/astc_decoder.comp | 14 |
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 | ||
| 420 | uint BitsOp(uint bits, uint start, uint end) { | 420 | uint 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 | ||
| 667 | uvec4 ClampByte(ivec4 color) { | 659 | uvec4 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 | ||
| 674 | ivec4 BlueContract(int a, int r, int g, int b) { | 664 | ivec4 BlueContract(int a, int r, int g, int b) { |