From: Lucas Stach Date: Wed, 15 Nov 2017 16:33:17 +0000 (+0100) Subject: etnaviv: enable full overwrite when no color buffer is present X-Git-Tag: android-x86-8.1-r1~7773 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f5d477f447bb23433f8c9e1376ef61c3f6d905ea;p=android-x86%2Fexternal-mesa.git etnaviv: enable full overwrite when no color buffer is present The OVERWRITE bit disables destination fetches, which is exactly what we want when there is no valid color buffer bound. Signed-off-by: Lucas Stach Reviewed-by: Wladimir J. van der Laan --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c b/src/gallium/drivers/etnaviv/etnaviv_blend.c index 1b432bd6871..9c23411d4ff 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_blend.c +++ b/src/gallium/drivers/etnaviv/etnaviv_blend.c @@ -131,8 +131,8 @@ etna_update_blend(struct etna_context *ctx) * - The color mask is 1111 * - No blending is used */ - bool full_overwrite = (rt0->colormask == 0xf) && - blend->fo_allowed; + bool full_overwrite = ((rt0->colormask == 0xf) && blend->fo_allowed) || + !pfb->cbufs[0]; blend->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_COMPONENTS(colormask) | COND(full_overwrite, VIVS_PE_COLOR_FORMAT_OVERWRITE); diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 59a72816462..004e3cd132d 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -185,7 +185,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx, /* Clearing VIVS_PE_COLOR_FORMAT_COMPONENTS__MASK and * VIVS_PE_COLOR_FORMAT_OVERWRITE prevents us from overwriting the * color target */ - cs->PE_COLOR_FORMAT = 0; + cs->PE_COLOR_FORMAT = VIVS_PE_COLOR_FORMAT_OVERWRITE; cs->PE_COLOR_STRIDE = 0; cs->TS_COLOR_STATUS_BASE.bo = NULL; cs->TS_COLOR_SURFACE_BASE.bo = NULL;