Re: [Mesa-dev] [PATCH] etnaviv: enable full overwrite when no color buffer is present

2017-11-17 Thread Wladimir J. van der Laan
On Wed, Nov 15, 2017 at 05:33:17PM +0100, Lucas Stach wrote:
> 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 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] etnaviv: enable full overwrite when no color buffer is present

2017-11-15 Thread Lucas Stach
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 
---
 src/gallium/drivers/etnaviv/etnaviv_blend.c | 4 ++--
 src/gallium/drivers/etnaviv/etnaviv_state.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_blend.c 
b/src/gallium/drivers/etnaviv/etnaviv_blend.c
index 1b432bd68715..9c23411d4ff7 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 
 * - 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 fb033507f387..8b044b3ee8d3 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;
-- 
2.11.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev