anv: use the color_map if present for calculating color_mask
If the FS has writes to multiple color outputs, but there are not enough color attachments for them all, we may optimize out the exceeding ones. With VK_KHR_dynamic_rendering_local_read, we were not respecting the mapping from output to attachment set by the application, and the wrong writes were getting eliminated. Fixes future CTS tests: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.remap_single_attachment* Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37531>
This commit is contained in:
@@ -395,8 +395,14 @@ rp_color_mask(const struct vk_graphics_pipeline_state *state)
|
||||
|
||||
uint32_t color_mask = 0;
|
||||
for (uint32_t i = 0; i < state->rp->color_attachment_count; i++) {
|
||||
if (state->rp->color_attachment_formats[i] != VK_FORMAT_UNDEFINED)
|
||||
color_mask |= BITFIELD_BIT(i);
|
||||
if (state->rp->color_attachment_formats[i] != VK_FORMAT_UNDEFINED) {
|
||||
if (state->cal) {
|
||||
if (state->cal->color_map[i] != MESA_VK_ATTACHMENT_UNUSED)
|
||||
color_mask |= BITFIELD_BIT(state->cal->color_map[i]);
|
||||
} else {
|
||||
color_mask |= BITFIELD_BIT(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return color_mask;
|
||||
|
||||
Reference in New Issue
Block a user