Module: Mesa Branch: main Commit: 60e6e3f8e681262280ee81e8d49dbb9aede48f57 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=60e6e3f8e681262280ee81e8d49dbb9aede48f57
Author: Samuel Pitoiset <samuel.pitoi...@gmail.com> Date: Wed Dec 13 11:37:46 2023 +0100 radv: cleanup gathering PS info with/without PS epilogs To make it clear that some fields aren't used with PS epilogs. Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26663> --- src/amd/vulkan/radv_shader_info.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 3db30920dcd..42ea2f2d6ad 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -808,17 +808,20 @@ gather_shader_info_fs(const struct radv_device *device, const nir_shader *nir, info->has_epilog = pipeline_key->ps.has_epilog && info->ps.colors_written; + if (!info->has_epilog) { + info->ps.mrt0_is_dual_src = pipeline_key->ps.epilog.mrt0_is_dual_src; + info->ps.spi_shader_col_format = pipeline_key->ps.epilog.spi_shader_col_format; + } + const bool export_alpha_and_mrtz = (info->ps.color0_written & 0x8) && (info->ps.writes_z || info->ps.writes_stencil || info->ps.writes_sample_mask); info->ps.exports_mrtz_via_epilog = info->has_epilog && pipeline_key->ps.exports_mrtz_via_epilog && export_alpha_and_mrtz; - info->ps.writes_mrt0_alpha = pipeline_key->ps.alpha_to_coverage_via_mrtz && export_alpha_and_mrtz; - - info->ps.mrt0_is_dual_src = pipeline_key->ps.epilog.mrt0_is_dual_src; - - info->ps.spi_shader_col_format = pipeline_key->ps.epilog.spi_shader_col_format; + if (!info->ps.exports_mrtz_via_epilog) { + info->ps.writes_mrt0_alpha = pipeline_key->ps.alpha_to_coverage_via_mrtz && export_alpha_and_mrtz; + } nir_foreach_shader_in_variable (var, nir) { const struct glsl_type *type = var->data.per_vertex ? glsl_get_array_element(var->type) : var->type;