summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmeer J <52414509+ameerj@users.noreply.github.com>2023-07-30 19:12:12 +0200
committerAmeer J <52414509+ameerj@users.noreply.github.com>2023-08-06 20:54:57 +0200
commit998246efc27950e3fbebc00a8ca3442dfabb9904 (patch)
treef630dd0fd90aa75a99a9cee3e636dc21174a4ff3
parentextractbits robustness (diff)
downloadyuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.gz
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.bz2
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.lz
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.xz
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.tar.zst
yuzu-998246efc27950e3fbebc00a8ca3442dfabb9904.zip
-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) {
}
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) {