radv: fix setting CB_SHADER_MASK for dual source blending
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Jun 2019 12:46:47 +0000 (14:46 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 10 Jun 2019 15:21:56 +0000 (17:21 +0200)
CB_SHADER_MASK was computed without the second color buffer
format which looks totally wrong to me.

While we are at it, copy a comment from RadeonSI.

Cc: 19.0 19.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index 6c0d099..8bc0d9b 100644 (file)
@@ -541,10 +541,13 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline,
                }
        }
 
-       blend->cb_shader_mask = ac_get_cb_shader_mask(col_format);
-
+       /* The output for dual source blending should have the same format as
+        * the first output.
+        */
        if (blend->mrt0_is_dual_src)
                col_format |= (col_format & 0xf) << 4;
+
+       blend->cb_shader_mask = ac_get_cb_shader_mask(col_format);
        blend->spi_shader_col_format = col_format;
 }