diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-17 10:22:37 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-17 10:45:52 -0700 |
commit | aef01dd2e54c293b5dfe7236e586e61ce2a18225 (patch) | |
tree | e21afabc3da7d1a6f5771dca27efba5472e0189c /src/gallium | |
parent | fbbb29aa5b5ee62b53c1af290c5dec58ccc7b40c (diff) |
panfrost: Cleanup default blend mode
Just encode the Mali magic number for `replace` rather than awkwardly
forcing Gallium structures through.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_blending.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/gallium/drivers/panfrost/pan_blending.c b/src/gallium/drivers/panfrost/pan_blending.c index f38868afec2..14f99f64edd 100644 --- a/src/gallium/drivers/panfrost/pan_blending.c +++ b/src/gallium/drivers/panfrost/pan_blending.c @@ -344,29 +344,21 @@ panfrost_make_constant(unsigned *factors, unsigned num_factors, const struct pip * representating, return false to handle degenerate cases with a blend shader */ -static const struct pipe_rt_blend_state default_blend = { - .blend_enable = 1, - - .rgb_func = PIPE_BLEND_ADD, - .rgb_src_factor = PIPE_BLENDFACTOR_ONE, - .rgb_dst_factor = PIPE_BLENDFACTOR_ZERO, - - .alpha_func = PIPE_BLEND_ADD, - .alpha_src_factor = PIPE_BLENDFACTOR_ONE, - .alpha_dst_factor = PIPE_BLENDFACTOR_ZERO, - - .colormask = PIPE_MASK_RGBA -}; - bool panfrost_make_fixed_blend_mode(const struct pipe_rt_blend_state *blend, struct panfrost_blend_state *so, unsigned colormask, const struct pipe_blend_color *blend_color) { struct mali_blend_equation *out = &so->equation; + /* Gallium and Mali represent colour masks identically. XXX: Static assert for future proof */ + out->color_mask = colormask; + /* If no blending is enabled, default back on `replace` mode */ - if (!blend->blend_enable) - return panfrost_make_fixed_blend_mode(&default_blend, so, colormask, blend_color); + if (!blend->blend_enable) { + out->rgb_mode = 0x122; + out->alpha_mode = 0x122; + return true; + } /* We have room only for a single float32 constant between the four * components. If we need more, spill to the programmable pipeline. */ @@ -395,8 +387,5 @@ panfrost_make_fixed_blend_mode(const struct pipe_rt_blend_state *blend, struct p out->rgb_mode = rgb_mode; out->alpha_mode = alpha_mode; - /* Gallium and Mali represent colour masks identically. XXX: Static assert for future proof */ - out->color_mask = colormask; - return true; } |