From 4e0dcbb880855167d09010f948419a3857879a82 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 11 Jun 2020 21:51:42 +0200 Subject: [PATCH] radv: use SPI_SHADER_ZERO for non-written color attachments When colorWriteMask is 0 we can assume that this color attachment is unused. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_pipeline.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index ea9418e7a5f..e5c0723c707 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -517,7 +517,8 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline, for (unsigned i = 0; i < (blend->single_cb_enable ? 1 : subpass->color_count); ++i) { unsigned cf; - if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) { + if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED || + !(blend->cb_target_mask & (0xfu << (i * 4)))) { cf = V_028714_SPI_SHADER_ZERO; } else { struct radv_render_pass_attachment *attachment = pass->attachments + subpass->color_attachments[i].attachment; -- 2.30.2