200
lp_build_blend_factor_complementary(unsigned src_factor, unsigned dst_factor)
202
return dst_factor == (src_factor ^ 0x10);
207
200
* Generate blend code in SOA mode.
208
201
* \param rt render target index (to index the blend / colormask state)
252
245
unsigned func = i < 3 ? blend->rt[rt].rgb_func : blend->rt[rt].alpha_func;
253
246
boolean func_commutative = lp_build_blend_func_commutative(func);
255
if (func == PIPE_BLEND_ADD &&
256
lp_build_blend_factor_complementary(src_factor, dst_factor) && 0) {
258
* Special case linear interpolation, (i.e., complementary factors).
262
if (src_factor < dst_factor) {
263
weight = lp_build_blend_soa_factor(&bld, src_factor, i);
264
res[i] = lp_build_lerp(&bld.base, weight, dst[i], src[i]);
266
weight = lp_build_blend_soa_factor(&bld, dst_factor, i);
267
res[i] = lp_build_lerp(&bld.base, weight, src[i], dst[i]);
272
if ((func == PIPE_BLEND_ADD ||
273
func == PIPE_BLEND_SUBTRACT ||
274
func == PIPE_BLEND_REVERSE_SUBTRACT) &&
275
src_factor == dst_factor &&
278
* Special common factor.
280
* XXX: Only for floating points for now, since saturation will
281
* cause different results.
285
factor = lp_build_blend_soa_factor(&bld, src_factor, i);
286
res[i] = lp_build_blend_func(&bld.base, func, src[i], dst[i]);
287
res[i] = lp_build_mul(&bld.base, res[i], factor);
292
249
* Compute src/dst factors.
298
255
bld.factor[1][1][i] = lp_build_blend_soa_factor(&bld, dst_factor, i);
258
* Check if lp_build_blend can perform any optimisations
260
res[i] = lp_build_blend(&bld.base,
301
276
* Compute src/dst terms