From 4f6f53a18ae66768e8091d7cd7ea0437e40bb502 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 16 Dec 2022 10:01:00 +0100 Subject: [PATCH] radv: simplify removing unused color exports If CB_TARGET_MASK (color write mask) is 0 for a given MRT, this implies that the color format is 0 because the driver compacts MRTs. No fossils-db changes. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 6 +----- src/amd/vulkan/radv_shader.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 8b4c7cb8c35..c152e4c2fca 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2226,11 +2226,8 @@ radv_remove_color_exports(const struct radv_pipeline_key *pipeline_key, nir_shad continue; unsigned col_format = (pipeline_key->ps.epilog.spi_shader_col_format >> (4 * idx)) & 0xf; - unsigned cb_target_mask = (pipeline_key->ps.cb_target_mask >> (4 * idx)) & 0xf; - if (col_format == V_028714_SPI_SHADER_ZERO || - (col_format == V_028714_SPI_SHADER_32_R && !cb_target_mask && - !pipeline_key->ps.epilog.mrt0_is_dual_src)) { + if (col_format == V_028714_SPI_SHADER_ZERO) { /* Remove the color export if it's unused or in presence of holes. */ nir->info.outputs_written &= ~BITFIELD64_BIT(var->data.location); var->data.location = 0; @@ -2761,7 +2758,6 @@ radv_generate_graphics_pipeline_key(const struct radv_graphics_pipeline *pipelin } key.ps.epilog.spi_shader_col_format = blend->spi_shader_col_format; - key.ps.cb_target_mask = blend->cb_target_mask; key.ps.epilog.mrt0_is_dual_src = blend->mrt0_is_dual_src; if (device->physical_device->rad_info.gfx_level < GFX8) { key.ps.epilog.color_is_int8 = blend->col_format_is_int8; diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index dc5d698325b..ef9a9ec1ea6 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -100,7 +100,6 @@ struct radv_pipeline_key { struct { struct radv_ps_epilog_key epilog; - uint32_t cb_target_mask; uint8_t num_samples; bool sample_shading_enable;