diff options
author | Jonathan Marek <[email protected]> | 2019-07-03 14:04:20 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-07-17 23:07:35 -0400 |
commit | 5f73726013fabaa2b1bda595a2b2192a4db25760 (patch) | |
tree | 514876735bbeeec6b825f7010a6608f3d4cacfe2 /src/gallium/drivers/etnaviv/etnaviv_blend.c | |
parent | 6c3c05dc38a2e4243252b688282816be8824538b (diff) |
etnaviv: fix alpha blending cases
We need to check rgb_func/alpha_func when determining if blend or separate
alpha is required.
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_blend.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_blend.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c index 366be02f0ca..2e5538e3577 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blend.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c @@ -49,23 +49,26 @@ etna_blend_state_create(struct pipe_context *pctx, /* Enable blending if * - blend enabled in blend state - * - NOT source factor is ONE and destination factor ZERO for both rgb and - * alpha (which would mean that blending is effectively disabled) + * - NOT source factor is ONE and destination factor ZERO and eq is ADD for + * both rgb and alpha (which mean that blending is effectively disabled) */ alpha_enable = rt0->blend_enable && !(rt0->rgb_src_factor == PIPE_BLENDFACTOR_ONE && rt0->rgb_dst_factor == PIPE_BLENDFACTOR_ZERO && + rt0->rgb_func == PIPE_BLEND_ADD && rt0->alpha_src_factor == PIPE_BLENDFACTOR_ONE && - rt0->alpha_dst_factor == PIPE_BLENDFACTOR_ZERO); + rt0->alpha_dst_factor == PIPE_BLENDFACTOR_ZERO && + rt0->alpha_func == PIPE_BLEND_ADD); /* Enable separate alpha if * - Blending enabled (see above) - * - NOT source factor is equal to destination factor for both rgb abd - * alpha (which would effectively that mean alpha is not separate) + * - NOT source/destination factor and eq is same for both rgb and alpha + * (which would effectively that mean alpha is not separate), and */ bool separate_alpha = alpha_enable && !(rt0->rgb_src_factor == rt0->alpha_src_factor && - rt0->rgb_dst_factor == rt0->alpha_dst_factor); + rt0->rgb_dst_factor == rt0->alpha_dst_factor && + rt0->rgb_func == rt0->alpha_func); if (alpha_enable) { co->PE_ALPHA_CONFIG = |