radeonsi: disable RB+ blend optimizations for dual source blending
authorMarek Olšák <marek.olsak@amd.com>
Sat, 26 Nov 2016 14:52:05 +0000 (15:52 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 29 Nov 2016 22:52:31 +0000 (23:52 +0100)
This fixes dual source blending on Stoney. The fix was copied from Vulkan.
The problem was discovered during internal testing.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 911e979a4fb77ee10bb089b8aa628d7d6b82a631..1ccf5b6b214c25346fc4fb2c39013990bc24132d 100644 (file)
@@ -557,6 +557,17 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
        }
 
        if (sctx->b.family == CHIP_STONEY) {
+               /* Disable RB+ blend optimizations for dual source blending.
+                * Vulkan does this.
+                */
+               if (blend->dual_src_blend) {
+                       for (int i = 0; i < 8; i++) {
+                               sx_mrt_blend_opt[i] =
+                                       S_028760_COLOR_COMB_FCN(V_028760_OPT_COMB_NONE) |
+                                       S_028760_ALPHA_COMB_FCN(V_028760_OPT_COMB_NONE);
+                       }
+               }
+
                for (int i = 0; i < 8; i++)
                        si_pm4_set_reg(pm4, R_028760_SX_MRT0_BLEND_OPT + i * 4,
                                       sx_mrt_blend_opt[i]);