Mesa (master): freedreno/a3xx: disable blending for integer formats

Rob Clark robclark at kemper.freedesktop.org
Sun Nov 30 22:59:36 UTC 2014


Module: Mesa
Branch: master
Commit: f866446e8c4c77cfe0f1f78929ff22ba1d4ae4aa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f866446e8c4c77cfe0f1f78929ff22ba1d4ae4aa

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Nov 29 02:10:15 2014 -0500

freedreno/a3xx: disable blending for integer formats

Also add support for the BLENDABLE bind flag, similarly predicated on
non-int formats.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/freedreno/a3xx/fd3_emit.c   |   11 ++++++++++-
 src/gallium/drivers/freedreno/a3xx/fd3_screen.c |    5 ++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
index 64b1c32..44f8ac4 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.c
@@ -573,9 +573,18 @@ fd3_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
 		for (i = 0; i < ARRAY_SIZE(blend->rb_mrt); i++) {
 			bool is_float = util_format_is_float(
 					pipe_surface_format(ctx->framebuffer.cbufs[i]));
+			bool is_int = util_format_is_pure_integer(
+					pipe_surface_format(ctx->framebuffer.cbufs[i]));
+			uint32_t control = blend->rb_mrt[i].control;
+
+			if (is_int) {
+				control &= (A3XX_RB_MRT_CONTROL_COMPONENT_ENABLE__MASK |
+							A3XX_RB_MRT_CONTROL_DITHER_MODE__MASK);
+				control |= A3XX_RB_MRT_CONTROL_ROP_CODE(ROP_COPY);
+			}
 
 			OUT_PKT0(ring, REG_A3XX_RB_MRT_CONTROL(i), 1);
-			OUT_RING(ring, blend->rb_mrt[i].control);
+			OUT_RING(ring, control);
 
 			OUT_PKT0(ring, REG_A3XX_RB_MRT_BLEND_CONTROL(i), 1);
 			OUT_RING(ring, blend->rb_mrt[i].blend_control |
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
index 3871660..5fc63e8 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
@@ -63,13 +63,16 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen,
 	if ((usage & (PIPE_BIND_RENDER_TARGET |
 				PIPE_BIND_DISPLAY_TARGET |
 				PIPE_BIND_SCANOUT |
-				PIPE_BIND_SHARED)) &&
+				PIPE_BIND_SHARED |
+				PIPE_BIND_BLENDABLE)) &&
 			(fd3_pipe2color(format) != ~0) &&
 			(fd3_pipe2tex(format) != ~0)) {
 		retval |= usage & (PIPE_BIND_RENDER_TARGET |
 				PIPE_BIND_DISPLAY_TARGET |
 				PIPE_BIND_SCANOUT |
 				PIPE_BIND_SHARED);
+		if (!util_format_is_pure_integer(format))
+			retval |= usage & PIPE_BIND_BLENDABLE;
 	}
 
 	if ((usage & PIPE_BIND_DEPTH_STENCIL) &&




More information about the mesa-commit mailing list