mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 14:45:39 +00:00
Fix bug when going from smaller to higher bit depth
This commit is contained in:
parent
ad17404bf7
commit
9a0fbebac3
|
@ -54,6 +54,7 @@
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace PVRTCC {
|
namespace PVRTCC {
|
||||||
|
|
||||||
|
@ -119,8 +120,8 @@ namespace PVRTCC {
|
||||||
uint8 ret = 0;
|
uint8 ret = 0;
|
||||||
while(bitsLeft > oldDepth) {
|
while(bitsLeft > oldDepth) {
|
||||||
ret |= val;
|
ret |= val;
|
||||||
ret <<= oldDepth;
|
|
||||||
bitsLeft -= oldDepth;
|
bitsLeft -= oldDepth;
|
||||||
|
ret <<= std::min(bitsLeft, oldDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret | (val >> (oldDepth - bitsLeft));
|
return ret | (val >> (oldDepth - bitsLeft));
|
||||||
|
|
Loading…
Reference in a new issue