Sample locations are not updated as often as framebuffers.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
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;
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;
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;
unsigned border_color_offset;
struct r600_atom clip_regs;
+ struct r600_atom msaa_sample_locs;
struct r600_atom msaa_config;
int ps_iter_samples;
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;
}
}
/* 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;
/* 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);