radeonsi: DCC MSAA blending bug - include logic op, limit to Navi14 and older
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jul 2019 21:28:50 +0000 (17:28 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 6 Aug 2019 21:08:50 +0000 (17:08 -0400)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h

index 6ec65f1b417bbbb33d44c9f22920d9b285170c4c..dbc667e714a2b5d6c22118b72d7f52f8aebc9839 100644 (file)
@@ -115,12 +115,12 @@ static void si_emit_cb_render_state(struct si_context *sctx)
                                   SI_TRACKED_CB_TARGET_MASK, cb_target_mask);
 
        if (sctx->chip_class >= GFX8) {
-               /* DCC MSAA workaround for blending.
+               /* DCC MSAA workaround.
                 * Alternatively, we can set CB_COLORi_DCC_CONTROL.OVERWRITE_-
                 * COMBINER_DISABLE, but that would be more complicated.
                 */
                bool oc_disable = blend &&
-                                 blend->blend_enable_4bit & cb_target_mask &&
+                                 blend->dcc_msaa_corruption_4bit & cb_target_mask &&
                                  sctx->framebuffer.nr_samples >= 2;
                unsigned watermark = sctx->framebuffer.dcc_overwrite_combiner_watermark;
 
@@ -621,6 +621,9 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
 
                blend->blend_enable_4bit |= 0xfu << (i * 4);
 
+               if (sctx->family <= CHIP_NAVI14)
+                       blend->dcc_msaa_corruption_4bit |= 0xfu << (i * 4);
+
                /* This is only important for formats without alpha. */
                if (srcRGB == PIPE_BLENDFACTOR_SRC_ALPHA ||
                    dstRGB == PIPE_BLENDFACTOR_SRC_ALPHA ||
@@ -631,6 +634,9 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
                        blend->need_src_alpha_4bit |= 0xfu << (i * 4);
        }
 
+       if (sctx->family <= CHIP_NAVI14 && logicop_enable)
+               blend->dcc_msaa_corruption_4bit |= blend->cb_target_enabled_4bit;
+
        if (blend->cb_target_mask) {
                color_control |= S_028808_MODE(mode);
        } else {
index acdbefbf64f9b51bb8f9e1ec32178b6a879fb8c6..c66eccc89d9456372cc7cf4aed7b54155ba94731 100644 (file)
@@ -56,6 +56,7 @@ struct si_state_blend {
        unsigned                blend_enable_4bit;
        unsigned                need_src_alpha_4bit;
        unsigned                commutative_4bit;
+       unsigned                dcc_msaa_corruption_4bit;
        bool                    alpha_to_coverage:1;
        bool                    alpha_to_one:1;
        bool                    dual_src_blend:1;