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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20485>
This commit is contained in:
Samuel Pitoiset
2022-12-16 10:01:00 +01:00
committed by Marge Bot
parent 476a1552c1
commit 4f6f53a18a
2 changed files with 1 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;