Fix BC6H_SF decoding error.

Decoding error were caused by additional sign extend call after endpoint
transform, according to khronos documentation, you only suppose to sign
extend endpoints only once, further calls to sign extend mangles
endpoint data.
This commit is contained in:
REDxEYE 2022-07-18 20:38:23 +03:00 committed by ShadelessFox
parent f58c0ea533
commit b7715d1600
No known key found for this signature in database
GPG Key ID: 1CF8D77ADDADADD9

View File

@ -755,13 +755,6 @@ decode_bc6_block(rgb32f *col, const UINT8 *src, int sign) {
endpoints[i + 1] = (endpoints[i + 1] + endpoints[1]) & mask;
endpoints[i + 2] = (endpoints[i + 2] + endpoints[2]) & mask;
}
if (sign) {
for (i = 3; i < numep; i += 3) {
bc6_sign_extend(&endpoints[i + 0], info->rb);
bc6_sign_extend(&endpoints[i + 1], info->gb);
bc6_sign_extend(&endpoints[i + 2], info->bb);
}
}
}
for (i = 0; i < numep; i++) {
ueps[i] = bc6_unquantize(endpoints[i], info->epb, sign);