diff options
author | Marek Olšák <[email protected]> | 2015-03-15 17:54:29 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-03-16 12:54:18 +0100 |
commit | 4f20a8f278aa92fb0dc6abc6998171b3ddea7dc1 (patch) | |
tree | 266ec3ab358ae2286bb239e016b6dc17f30ae0e6 /src/gallium/drivers/radeonsi | |
parent | f7796a966d20b04c00025bdc170883f4179a5697 (diff) |
radeonsi: split sample locations into its own state atom
Sample locations are not updated as often as framebuffers.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 1 |
5 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 1cacc2660c3..30bf41f2316 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -145,6 +145,7 @@ void si_begin_new_cs(struct si_context *ctx) ctx->clip_regs.dirty = true; ctx->framebuffer.atom.dirty = true; + ctx->msaa_sample_locs.dirty = true; ctx->msaa_config.dirty = true; ctx->db_render_state.dirty = true; ctx->b.streamout.enable_atom.dirty = true; diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 993b153d1f4..8b4246cfeff 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -112,6 +112,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void * sctx->cache_flush = si_atom_cache_flush; sctx->atoms.s.cache_flush = &sctx->cache_flush; + sctx->msaa_sample_locs = si_atom_msaa_sample_locs; + sctx->atoms.s.msaa_sample_locs = &sctx->msaa_sample_locs; + sctx->msaa_config = si_atom_msaa_config; sctx->atoms.s.msaa_config = &sctx->msaa_config; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 059fe0dc99b..1496d5fedd7 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -151,6 +151,7 @@ struct si_context { struct r600_atom *streamout_begin; struct r600_atom *streamout_enable; /* must be after streamout_begin */ struct r600_atom *framebuffer; + struct r600_atom *msaa_sample_locs; struct r600_atom *db_render_state; struct r600_atom *msaa_config; struct r600_atom *clip_regs; @@ -181,6 +182,7 @@ struct si_context { unsigned border_color_offset; struct r600_atom clip_regs; + struct r600_atom msaa_sample_locs; struct r600_atom msaa_config; int ps_iter_samples; diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index b20042ce831..f844fc19201 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2093,6 +2093,8 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, constbuf.buffer_size = sctx->framebuffer.nr_samples * 2 * 4; ctx->set_constant_buffer(ctx, PIPE_SHADER_FRAGMENT, SI_DRIVER_STATE_CONST_BUF, &constbuf); + + sctx->msaa_sample_locs.dirty = true; } } @@ -2196,10 +2198,19 @@ static void si_emit_framebuffer_state(struct si_context *sctx, struct r600_atom /* PA_SC_WINDOW_SCISSOR_TL is set in si_init_config() */ r600_write_context_reg(cs, R_028208_PA_SC_WINDOW_SCISSOR_BR, S_028208_BR_X(state->width) | S_028208_BR_Y(state->height)); +} + +static void si_emit_msaa_sample_locs(struct r600_common_context *rctx, + struct r600_atom *atom) +{ + struct si_context *sctx = (struct si_context *)rctx; + struct radeon_winsys_cs *cs = sctx->b.rings.gfx.cs; cayman_emit_msaa_sample_locs(cs, sctx->framebuffer.nr_samples); } +const struct r600_atom si_atom_msaa_sample_locs = { si_emit_msaa_sample_locs, 18 }; /* number of CS dwords */ + static void si_emit_msaa_config(struct r600_common_context *rctx, struct r600_atom *atom) { struct si_context *sctx = (struct si_context *)rctx; diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index d1ed53065ca..4e6b1e27c46 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -269,6 +269,7 @@ void si_init_shader_functions(struct si_context *sctx); /* si_state_draw.c */ extern const struct r600_atom si_atom_cache_flush; +extern const struct r600_atom si_atom_msaa_sample_locs; extern const struct r600_atom si_atom_msaa_config; void si_emit_cache_flush(struct r600_common_context *sctx, struct r600_atom *atom); void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo); |