anv: avoid setting up a null RT unless needed

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27270>
This commit is contained in:
Lionel Landwerlin 2024-09-24 11:23:35 +03:00 committed by Marge Bot
parent 6f5d032c6f
commit 15987f49bb

View file

@ -1560,13 +1560,18 @@ anv_pipeline_link_fs(const struct brw_compiler *compiler,
} }
} }
num_rt_bindings = stage->key.wm.nr_color_regions; num_rt_bindings = stage->key.wm.nr_color_regions;
} else { } else if (brw_nir_fs_needs_null_rt(
compiler->devinfo, stage->nir,
stage->key.wm.multisample_fbo != BRW_NEVER,
stage->key.wm.alpha_to_coverage != BRW_NEVER)) {
/* Setup a null render target */ /* Setup a null render target */
rt_bindings[0] = (struct anv_pipeline_binding) { rt_bindings[0] = (struct anv_pipeline_binding) {
.set = ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS, .set = ANV_DESCRIPTOR_SET_COLOR_ATTACHMENTS,
.index = UINT32_MAX, .index = UINT32_MAX,
}; };
num_rt_bindings = 1; num_rt_bindings = 1;
} else {
num_rt_bindings = 0;
} }
assert(num_rt_bindings <= MAX_RTS); assert(num_rt_bindings <= MAX_RTS);