summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index b4165a4669b..c9ed7256f04 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2784,8 +2784,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
*
* Only flush and wait for CB if there is actually a bound color buffer.
*/
- if (sctx->framebuffer.nr_samples <= 1 &&
- sctx->framebuffer.state.nr_cbufs)
+ if (sctx->framebuffer.uncompressed_cb_mask)
si_make_CB_shader_coherent(sctx, sctx->framebuffer.nr_samples,
sctx->framebuffer.CB_has_shader_readable_metadata);
@@ -2829,6 +2828,7 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
sctx->framebuffer.color_is_int10 = 0;
sctx->framebuffer.compressed_cb_mask = 0;
+ sctx->framebuffer.uncompressed_cb_mask = 0;
sctx->framebuffer.nr_samples = util_framebuffer_get_num_samples(state);
sctx->framebuffer.log_samples = util_logbase2(sctx->framebuffer.nr_samples);
sctx->framebuffer.any_dst_linear = false;
@@ -2861,9 +2861,10 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
if (surf->color_is_int10)
sctx->framebuffer.color_is_int10 |= 1 << i;
- if (rtex->fmask.size) {
+ if (rtex->fmask.size)
sctx->framebuffer.compressed_cb_mask |= 1 << i;
- }
+ else
+ sctx->framebuffer.uncompressed_cb_mask |= 1 << i;
if (rtex->surface.is_linear)
sctx->framebuffer.any_dst_linear = true;
@@ -4449,8 +4450,7 @@ static void si_texture_barrier(struct pipe_context *ctx, unsigned flags)
si_update_fb_dirtiness_after_rendering(sctx);
/* Multisample surfaces are flushed in si_decompress_textures. */
- if (sctx->framebuffer.nr_samples <= 1 &&
- sctx->framebuffer.state.nr_cbufs)
+ if (sctx->framebuffer.uncompressed_cb_mask)
si_make_CB_shader_coherent(sctx, sctx->framebuffer.nr_samples,
sctx->framebuffer.CB_has_shader_readable_metadata);
}
@@ -4493,8 +4493,7 @@ static void si_memory_barrier(struct pipe_context *ctx, unsigned flags)
* si_decompress_textures when needed.
*/
if (flags & PIPE_BARRIER_FRAMEBUFFER &&
- sctx->framebuffer.nr_samples <= 1 &&
- sctx->framebuffer.state.nr_cbufs) {
+ sctx->framebuffer.uncompressed_cb_mask) {
sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_CB;
if (sctx->b.chip_class <= VI)