diff options
author | Dave Airlie <[email protected]> | 2012-04-27 09:38:46 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-05-12 08:25:21 +0100 |
commit | 31a25dac98ea20ba853128f98987c6358d8e0598 (patch) | |
tree | b4018bddd143a950c370438ab198f597a5508c7f /src/gallium/drivers/r600/r600_state.c | |
parent | e253ead78e65a64b606e8f46cdceec2689aaf9f4 (diff) |
r600g: setup COLOR1 for possible dual-src in the framebuffer bind
As pointed out by Marek, if we have only one cb, we may as well add this
single register write here rather than adding it in the draw loop.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index acf59f80bf4..ed08fd698c0 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1509,8 +1509,12 @@ static void r600_cb(struct r600_context *rctx, struct r600_pipe_state *rstate, color_info |= S_0280A0_SOURCE_FORMAT(V_0280A0_EXPORT_NORM); } - if (cb == 0) - rctx->color0_format = color_info; + /* for possible dual-src MRT write color info 1 */ + if (cb == 0 && rctx->framebuffer.nr_cbufs == 1) { + r600_pipe_state_add_reg_bo(rstate, + R_0280A0_CB_COLOR0_INFO + 1 * 4, + color_info, &rtex->resource, RADEON_USAGE_READWRITE); + } r600_pipe_state_add_reg_bo(rstate, R_028040_CB_COLOR0_BASE + cb * 4, |