Fancy, passes all of my HW tests:
The software renderer got all of it right apart from the order of multiplication and lerp (mul first, then lerp .. not the other way around) and the +128 (i.e. "rounding" mode).
3 days worth spent, I'd say... xD
Code:
u16 c2 = c+(c>>7);
s16 expected = (4*a*(256-c2) + 4*b*c2+128)>>8;
The software renderer got all of it right apart from the order of multiplication and lerp (mul first, then lerp .. not the other way around) and the +128 (i.e. "rounding" mode).
3 days worth spent, I'd say... xD