BcnDecode: add comment about BC2&3 color blocks

This commit is contained in:
Jan Solanti 2020-01-09 05:25:03 +02:00 committed by Andrew Murray
parent ddd3a2b482
commit b08c514ee7

View File

@ -84,7 +84,10 @@ decode_bc1_color(rgba *dst, const UINT8 *src, int separate_alpha) {
r1 = p[1].r;
g1 = p[1].g;
b1 = p[1].b;
if (col.c0 > col.c1) {
/* NOTE: BC2 and BC3 reuse BC1 color blocks but always act like c0 > c1 */
if (col.c0 > col.c1 || separate_alpha) {
p[2].r = (2 * r0 + 1 * r1) / 3;
p[2].g = (2 * g0 + 1 * g1) / 3;
p[2].b = (2 * b0 + 1 * b1) / 3;