diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2019-02-15 18:02:52 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-02-19 07:07:13 -0800 |
commit | 0b9f6ebfbbb792e6b592044a1577a3e3fae6e50c (patch) | |
tree | 2679d3f13b9d5890a5342c11ce34adcc55dedcf8 | |
parent | 69ebf4569ae0d2c7d9b1dc04de145329a1684727 (diff) | |
download | mesa-0b9f6ebfbbb792e6b592044a1577a3e3fae6e50c.tar.gz |
radv: write the alpha channel of MRT0 when alpha coverage is enabled
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109597
Cc: 18.3 19.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 0d8f09629377da9cf48ab4315574d69fdef5369d)
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 64090f6e3f2..efd675c4dc4 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -511,6 +511,13 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline, if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) { cf = V_028714_SPI_SHADER_ZERO; + + if (blend->need_src_alpha & (1 << i)) { + /* Write the alpha channel of MRT0 when alpha coverage is + * enabled because the depth attachment needs it. + */ + col_format |= V_028714_SPI_SHADER_32_ABGR; + } } else { struct radv_render_pass_attachment *attachment = pass->attachments + subpass->color_attachments[i].attachment; bool blend_enable = @@ -689,6 +696,7 @@ radv_pipeline_init_blend_state(struct radv_pipeline *pipeline, if (vkms && vkms->alphaToCoverageEnable) { blend.db_alpha_to_mask |= S_028B70_ALPHA_TO_MASK_ENABLE(1); + blend.need_src_alpha |= 0x1; } blend.cb_target_mask = 0; |