radv: fix alpha-to-coverage when there is unused color attachments
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Jun 2019 14:31:01 +0000 (16:31 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 10 Jun 2019 07:23:41 +0000 (09:23 +0200)
When alphaToCoverage is enabled, we should always write the alpha
channel of MRT0 if it's unused. This now matches RadeonSI.

This fixes the new CTS:
dEQP-VK.pipeline.multisample.alpha_to_coverage_unused_attachment.samples_*.alpha_invisible

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 895c4fbbb834382774913f862fa85e6a8f8bf77b..6c0d0994cdbf946e010f54f5c2104d1d52d73ed6 100644 (file)
@@ -523,7 +523,7 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline,
                col_format |= cf << (4 * i);
        }
 
-       if (!col_format && blend->need_src_alpha & (1 << 0)) {
+       if (!(col_format & 0xf) && blend->need_src_alpha & (1 << 0)) {
                /* When a subpass doesn't have any color attachments, write the
                 * alpha channel of MRT0 when alpha coverage is enabled because
                 * the depth attachment needs it.