radv: stop using a PS epilog when the FS doesn't write any color outputs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 15 Feb 2023 15:39:24 +0000 (16:39 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Feb 2023 13:19:54 +0000 (13:19 +0000)
This is a small optimization for fragment shaders that only write
depth/stencil/sample mask without any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>

src/amd/vulkan/radv_shader_info.c

index 3661046..d34eb9a 100644 (file)
@@ -583,7 +583,7 @@ gather_shader_info_fs(const nir_shader *nir, const struct radv_pipeline_key *pip
 
    info->ps.spi_ps_input = radv_compute_spi_ps_input(pipeline_key, info);
 
-   info->ps.has_epilog = pipeline_key->ps.has_epilog;
+   info->ps.has_epilog = pipeline_key->ps.has_epilog && info->ps.colors_written;
 
    info->ps.writes_mrt0_alpha =
       (pipeline_key->ps.alpha_to_coverage_via_mrtz && (info->ps.color0_written & 0x8)) &&