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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user