radeonsi: determine accurately whether the framebuffer state has DCC MSAA

We only need to check storage samples, which is what affects DCC.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
This commit is contained in:
Marek Olšák 2021-03-15 21:20:13 -04:00 committed by Marge Bot
parent 933df67296
commit 4707dc6a64
2 changed files with 6 additions and 1 deletions

View File

@ -745,6 +745,7 @@ struct si_framebuffer {
bool CB_has_shader_readable_metadata;
bool DB_has_shader_readable_metadata;
bool all_DCC_pipe_aligned;
bool has_dcc_msaa;
};
enum si_quant_mode

View File

@ -641,7 +641,7 @@ static void si_bind_blend_state(struct pipe_context *ctx, void *state)
if (old_blend->cb_target_mask != blend->cb_target_mask ||
old_blend->dual_src_blend != blend->dual_src_blend ||
(old_blend->dcc_msaa_corruption_4bit != blend->dcc_msaa_corruption_4bit &&
sctx->framebuffer.nr_samples >= 2 && sctx->screen->dcc_msaa_allowed))
sctx->framebuffer.has_dcc_msaa))
si_mark_atom_dirty(sctx, &sctx->atoms.s.cb_render_state);
if (old_blend->cb_target_mask != blend->cb_target_mask ||
@ -2782,6 +2782,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
sctx->framebuffer.CB_has_shader_readable_metadata = false;
sctx->framebuffer.DB_has_shader_readable_metadata = false;
sctx->framebuffer.all_DCC_pipe_aligned = true;
sctx->framebuffer.has_dcc_msaa = false;
sctx->framebuffer.min_bytes_per_pixel = 0;
for (i = 0; i < state->nr_cbufs; i++) {
@ -2830,6 +2831,9 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
if (sctx->chip_class >= GFX9 && !tex->surface.u.gfx9.dcc.pipe_aligned)
sctx->framebuffer.all_DCC_pipe_aligned = false;
if (tex->buffer.b.b.nr_storage_samples >= 2)
sctx->framebuffer.has_dcc_msaa = true;
}
si_context_add_resource_size(sctx, surf->base.texture);