radeonsi: split sample locations into its own state atom

Sample locations are not updated as often as framebuffers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Marek Olšák
2015-03-15 17:54:29 +01:00
parent f7796a966d
commit 4f20a8f278
5 changed files with 18 additions and 0 deletions
@@ -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;
+3
View File
@@ -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;
+2
View File
@@ -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;
+11
View File
@@ -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;
+1
View File
@@ -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);