mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-30 20:14:18 +01:00
Single color partition with alpha bugfix.
When we detect that a partition has a single color in each subset, we can generate almost an exact representation of this value for most compression modes. However, when we were doing this subset matching, we were ignoring the error introduced by modes that had completely opaque representations against data that had transparent pixels. This bug fix essentially includes this error in our "best fit" calculations and makes everything work out for the better.
This commit is contained in:
parent
6f6ca2d867
commit
f825b28051
@ -362,9 +362,12 @@ double BC7CompressionMode::CompressSingleColor(const RGBAVector &p, RGBAVector &
|
||||
const uint8 val = (pixel >> (ci * 8)) & 0xFF;
|
||||
int nBits = ci == 3? GetAlphaChannelPrecision() : m_Attributes->colorChannelPrecision;
|
||||
|
||||
// If we don't handle this channel, then we don't need to
|
||||
// worry about how well we interpolate.
|
||||
if(nBits == 0) { bestValI[ci] = bestValJ[ci] = 0xFF; continue; }
|
||||
// If we don't handle this channel, then it must be the full value (alpha)
|
||||
if(nBits == 0) {
|
||||
bestValI[ci] = bestValJ[ci] = 0xFF;
|
||||
dist = std::max(dist, (uint32)((uint8)0xFF - val));
|
||||
continue;
|
||||
}
|
||||
|
||||
const int nPossVals = (1 << nBits);
|
||||
int possValsH[256];
|
||||
|
Loading…
Reference in New Issue
Block a user