diff options
author | Marek Olšák <[email protected]> | 2012-07-07 07:15:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-07-12 02:08:30 +0200 |
commit | 0ea76916e63f8fc556f5e8f5a46c196d317cd5ad (patch) | |
tree | 6601131d601467def4ef09a5db80fdb7678c6847 /src/gallium/drivers/r600/evergreen_state.c | |
parent | 5ba15d8d38d98cb7b625fa55e7d818ef9c6629ce (diff) |
r600g: move CB_TARGET_MASK setup into new cb_misc_state
to remove some overhead from draw_vbo. This is a derived state.
BTW, I've got no idea how compute interacts with 3D here, but it should
use cb_misc_state, so that 3D and compute don't conflict.
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r-- | src/gallium/drivers/r600/evergreen_state.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index 60825bc7244..61efa287bab 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -1728,6 +1728,21 @@ static void evergreen_set_framebuffer_state(struct pipe_context *ctx, if (state->zsbuf) { evergreen_polygon_offset_update(rctx); } + + if (rctx->cb_misc_state.nr_cbufs != state->nr_cbufs) { + rctx->cb_misc_state.nr_cbufs = state->nr_cbufs; + r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); + } +} + +static void evergreen_emit_cb_misc_state(struct r600_context *rctx, struct r600_atom *atom) +{ + struct radeon_winsys_cs *cs = rctx->cs; + struct r600_cb_misc_state *a = (struct r600_cb_misc_state*)atom; + unsigned fb_colormask = (1ULL << ((unsigned)a->nr_cbufs * 4)) - 1; + + r600_write_context_reg(cs, R_028238_CB_TARGET_MASK, + a->blend_colormask & fb_colormask); } static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_atom *atom) @@ -1862,6 +1877,8 @@ static void evergreen_emit_ps_constant_buffer(struct r600_context *rctx, struct void evergreen_init_state_functions(struct r600_context *rctx) { + r600_init_atom(&rctx->cb_misc_state.atom, evergreen_emit_cb_misc_state, 0, 0); + r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); r600_init_atom(&rctx->db_misc_state.atom, evergreen_emit_db_misc_state, 6, 0); r600_atom_dirty(rctx, &rctx->db_misc_state.atom); r600_init_atom(&rctx->vertex_buffer_state, evergreen_emit_vertex_buffers, 0, 0); |