summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2018-11-14 14:56:59 +0100
committerLucas Stach <[email protected]>2019-01-07 11:50:23 +0100
commitb56d903b5abe7bf0157f99d707a9114b03231632 (patch)
treed2c46f37030089ccce064d0713e90fdd9f226353 /src
parent6dade5d534a752ba769f2ea91153c6c5d2acb956 (diff)
etnaviv: enable full overwrite in a few more cases
Take into account the render target format when checking if the color mask affects all channels of the RT. This allows to enable full overwrite in a few cases where a non-alpha format is used. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_blend.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c
index 0e2299a50b3..061c9af5247 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_blend.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c
@@ -114,6 +114,7 @@ etna_update_blend(struct etna_context *ctx)
struct pipe_blend_state *pblend = ctx->blend;
struct etna_blend_state *blend = etna_blend_state(pblend);
const struct pipe_rt_blend_state *rt0 = &pblend->rt[0];
+ const struct util_format_description *desc;
uint32_t colormask;
if (pfb->cbufs[0] &&
@@ -128,11 +129,13 @@ etna_update_blend(struct etna_context *ctx)
}
/* If the complete render target is written, set full_overwrite:
- * - The color mask is 1111
- * - No blending is used
+ * - The color mask covers all channels of the render target
+ * - No blending or logicop is used
*/
- bool full_overwrite = ((rt0->colormask == 0xf) && blend->fo_allowed) ||
- !pfb->cbufs[0];
+ if (pfb->cbufs[0])
+ desc = util_format_description(pfb->cbufs[0]->format);
+ bool full_overwrite = !pfb->cbufs[0] || ((blend->fo_allowed &&
+ util_format_colormask_full(desc, colormask)));
blend->PE_COLOR_FORMAT =
VIVS_PE_COLOR_FORMAT_COMPONENTS(colormask) |
COND(full_overwrite, VIVS_PE_COLOR_FORMAT_OVERWRITE);