The first broken optimization is that it checks "a != 0x00" where it
should check "s != 0x00". The other is that it skips the computation
when alpha is 0xff. That is wrong because in the formula:
min (1, (1 - Aa)/Ab)
the render specification states that if Ab is 0, the quotient is
defined to positive infinity. That is the case even if (1 - Aa) is 0.
comp4_t s = combine_mask (src, mask, i);
comp2_t a = s >> A_SHIFT;
- if (a != 0x00)
+ if (s != 0x00)
{
- if (a != MASK)
- {
- comp4_t d = *(dest + i);
- a = combine_disjoint_out_part (d >> A_SHIFT, a);
- UNcx4_MUL_UNc_ADD_UNcx4 (d, a, s);
- s = d;
- }
+ comp4_t d = *(dest + i);
+ a = combine_disjoint_out_part (d >> A_SHIFT, a);
+ UNcx4_MUL_UNc_ADD_UNcx4 (d, a, s);
- *(dest + i) = s;
+ *(dest + i) = d;
}
}
}
}
return fuzzer_test_main("blitters", 2000000,
- 0x217CF14A,
+ 0x1DB8BDF8,
test_composite, argc, argv);
}