Mesa (master): r600g: don't set per-MRT blend bits on R600

Alex Deucher agd5f at kemper.freedesktop.org
Mon Mar 14 21:55:51 UTC 2011


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

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Mon Mar 14 17:53:00 2011 -0400

r600g: don't set per-MRT blend bits on R600

It doesn't support them.  Also, we shouldn't be
emitting CB_BLENDx_CONTROL on R600 as the regs don't
exist there, but I'm not sure of the best way to deal
with this in the current r600 winsys.

Signed-off-by: Alex Deucher <alexdeucher at gmail.com>

---

 src/gallium/drivers/r600/r600_state.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 7378b30..d3adf03 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -117,9 +117,10 @@ static void r600_set_blend_color(struct pipe_context *ctx,
 static void *r600_create_blend_state(struct pipe_context *ctx,
 					const struct pipe_blend_state *state)
 {
+	struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
 	struct r600_pipe_blend *blend = CALLOC_STRUCT(r600_pipe_blend);
 	struct r600_pipe_state *rstate;
-	u32 color_control, target_mask;
+	u32 color_control = 0, target_mask;
 
 	if (blend == NULL) {
 		return NULL;
@@ -129,7 +130,10 @@ static void *r600_create_blend_state(struct pipe_context *ctx,
 	rstate->id = R600_PIPE_STATE_BLEND;
 
 	target_mask = 0;
-	color_control = S_028808_PER_MRT_BLEND(1);
+
+	/* R600 does not support per-MRT blends */
+	if (rctx->family > CHIP_R600)
+		color_control |= S_028808_PER_MRT_BLEND(1);
 	if (state->logicop_enable) {
 		color_control |= (state->logicop_func << 16) | (state->logicop_func << 20);
 	} else {
@@ -180,10 +184,11 @@ static void *r600_create_blend_state(struct pipe_context *ctx,
 			bc |= S_028804_ALPHA_DESTBLEND(r600_translate_blend_factor(dstA));
 		}
 
-		r600_pipe_state_add_reg(rstate, R_028780_CB_BLEND0_CONTROL + i * 4, bc, 0xFFFFFFFF, NULL);
-		if (i == 0) {
+		/* R600 does not support per-MRT blends */
+		if (rctx->family > CHIP_R600)
+			r600_pipe_state_add_reg(rstate, R_028780_CB_BLEND0_CONTROL + i * 4, bc, 0xFFFFFFFF, NULL);
+		if (i == 0)
 			r600_pipe_state_add_reg(rstate, R_028804_CB_BLEND_CONTROL, bc, 0xFFFFFFFF, NULL);
-		}
 	}
 	return rstate;
 }




More information about the mesa-commit mailing list