Mesa (master): r600g: make framebuffer atom rely on dual src blend state.

Dave Airlie airlied at kemper.freedesktop.org
Wed Mar 15 04:33:56 UTC 2017


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jan 26 13:35:08 2016 +1000

r600g: make framebuffer atom rely on dual src blend state.

In order to make ARB_shader_image_load_store, we have to share
the CB space with RATs, so we should only steal the dual src
space if we have dual src enabled.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/r600/evergreen_state.c   | 2 +-
 src/gallium/drivers/r600/r600_pipe.h         | 1 +
 src/gallium/drivers/r600/r600_state.c        | 2 +-
 src/gallium/drivers/r600/r600_state_common.c | 4 ++++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index c5dd9f7..5ffe6e8 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1584,7 +1584,7 @@ static void evergreen_emit_framebuffer_state(struct r600_context *rctx, struct r
 		radeon_emit(cs, reloc);
 	}
 	/* set CB_COLOR1_INFO for possible dual-src blending */
-	if (i == 1 && state->cbufs[0]) {
+	if (rctx->framebuffer.dual_src_blend && i == 1 && state->cbufs[0]) {
 		radeon_set_context_reg(cs, R_028C70_CB_COLOR0_INFO + 1 * 0x3C,
 				       cb->cb_color_info | tex->cb_color_info);
 		i++;
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index cf8eba3..1d65cb3 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -187,6 +187,7 @@ struct r600_framebuffer {
 	bool export_16bpc;
 	bool cb0_is_integer;
 	bool is_msaa_resolve;
+	bool dual_src_blend;
 };
 
 struct r600_sample_mask {
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 006bb62..6139bd2 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -1337,7 +1337,7 @@ static void r600_emit_framebuffer_state(struct r600_context *rctx, struct r600_a
 		radeon_emit(cs, cb[i] ? cb[i]->cb_color_info : 0);
 	}
 	/* set CB_COLOR1_INFO for possible dual-src blending */
-	if (i == 1 && cb[0]) {
+	if (rctx->framebuffer.dual_src_blend && i == 1 && cb[0]) {
 		radeon_emit(cs, cb[0]->cb_color_info);
 		i++;
 	}
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 5bce71c..6f8279f 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -187,6 +187,10 @@ static void r600_bind_blend_state_internal(struct r600_context *rctx,
 	if (update_cb) {
 		r600_mark_atom_dirty(rctx, &rctx->cb_misc_state.atom);
 	}
+	if (rctx->framebuffer.dual_src_blend != blend->dual_src_blend) {
+		rctx->framebuffer.dual_src_blend = blend->dual_src_blend;
+		r600_mark_atom_dirty(rctx, &rctx->framebuffer.atom);
+	}
 }
 
 static void r600_bind_blend_state(struct pipe_context *ctx, void *state)




More information about the mesa-commit mailing list