mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-25 16:45:43 +00:00
Fix the way we quantize 16-bit pixel channels
This commit is contained in:
parent
2d52f1eabb
commit
374f5375d5
1 changed files with 6 additions and 1 deletions
|
@ -975,7 +975,12 @@ namespace ASTCC {
|
|||
|
||||
uint32 weight = weights[plane][j * blockWidth + i];
|
||||
uint32 C = (C0 * (64 - weight) + C1 * weight + 32) / 64;
|
||||
p.Component(c) = C >> 8;
|
||||
if(C == 65535) {
|
||||
p.Component(c) = 255;
|
||||
} else {
|
||||
double Cf = static_cast<double>(C);
|
||||
p.Component(c) = static_cast<uint16>(255.0 * (Cf / 65536.0) + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
outBuf[j * blockWidth + i] = p.Pack();
|
||||
|
|
Loading…
Reference in a new issue