From: Samuel Pitoiset Date: Thu, 11 Jun 2020 19:51:42 +0000 (+0200) Subject: radv: use SPI_SHADER_ZERO for non-written color attachments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4e0dcbb880855167d09010f948419a3857879a82;p=mesa.git 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: --- 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;