mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-23 18:13:55 +00:00
Make sure to handle 0 bit depth a bit more gracefully
This commit is contained in:
parent
9a0fbebac3
commit
1ffbdea2b8
1 changed files with 7 additions and 3 deletions
|
@ -112,7 +112,7 @@ namespace PVRTCC {
|
||||||
assert(newDepth <= 8);
|
assert(newDepth <= 8);
|
||||||
assert(oldDepth <= 8);
|
assert(oldDepth <= 8);
|
||||||
|
|
||||||
if(oldDepth == newDepth) {
|
if(oldDepth == newDepth || oldDepth == 0) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
return val;
|
return val;
|
||||||
} else if(newDepth > oldDepth) {
|
} else if(newDepth > oldDepth) {
|
||||||
|
@ -128,9 +128,13 @@ namespace PVRTCC {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// oldDepth > newDepth
|
// oldDepth > newDepth
|
||||||
|
if(newDepth == 0) {
|
||||||
|
return 0xFF;
|
||||||
|
} else {
|
||||||
uint8 bitsWasted = oldDepth - newDepth;
|
uint8 bitsWasted = oldDepth - newDepth;
|
||||||
return val >> bitsWasted;
|
return val >> bitsWasted;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
assert(!"We shouldn't get here.");
|
assert(!"We shouldn't get here.");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue