}
}
+static void si_update_display_dcc_dirty(struct si_context *sctx)
+{
+ const struct pipe_framebuffer_state *state = &sctx->framebuffer.state;
+ struct si_surface *surf;
+ struct si_texture *tex;
+ int i;
+
+ for (i = 0; i < state->nr_cbufs; i++) {
+ if (!state->cbufs[i])
+ continue;
+
+ surf = (struct si_surface *)state->cbufs[i];
+ tex = (struct si_texture *)surf->base.texture;
+
+ if (!tex->surface.display_dcc_offset)
+ continue;
+
+ tex->displayable_dcc_dirty = true;
+ }
+}
+
static void si_set_framebuffer_state(struct pipe_context *ctx,
const struct pipe_framebuffer_state *state)
{
sctx->framebuffer.compressed_cb_mask = 0;
sctx->framebuffer.uncompressed_cb_mask = 0;
- sctx->framebuffer.displayable_dcc_cb_mask = 0;
sctx->framebuffer.nr_samples = util_framebuffer_get_num_samples(state);
sctx->framebuffer.nr_color_samples = sctx->framebuffer.nr_samples;
sctx->framebuffer.log_samples = util_logbase2(sctx->framebuffer.nr_samples);
else
sctx->framebuffer.uncompressed_cb_mask |= 1 << i;
- if (tex->surface.display_dcc_offset)
- sctx->framebuffer.displayable_dcc_cb_mask |= 1 << i;
-
/* Don't update nr_color_samples for non-AA buffers.
* (e.g. destination of MSAA resolve)
*/
radeon_emit(cs, EVENT_TYPE(V_028A90_BREAK_BATCH) | EVENT_INDEX(0));
}
+ si_update_display_dcc_dirty(sctx);
+
sctx->framebuffer.dirty_cbufs = 0;
sctx->framebuffer.dirty_zsbuf = false;
}
cik_emit_prefetch_L2(sctx, false);
}
- /* Mark the displayable dcc buffer as dirty in order to update
- * it on the next call to si_flush_resource. */
- if (sctx->screen->info.use_display_dcc_with_retile_blit) {
- /* Don't use si_update_fb_dirtiness_after_rendering because it'll
- * cause unnecessary texture decompressions on each draw. */
- unsigned displayable_dcc_cb_mask = sctx->framebuffer.displayable_dcc_cb_mask;
- while (displayable_dcc_cb_mask) {
- unsigned i = u_bit_scan(&displayable_dcc_cb_mask);
- struct pipe_surface *surf = sctx->framebuffer.state.cbufs[i];
- struct si_texture *tex = (struct si_texture *)surf->texture;
- tex->displayable_dcc_dirty = true;
- }
- }
-
/* Clear the context roll flag after the draw call. */
sctx->context_roll = false;