tu: handle unused color attachments without crashing

if the format is not set then this attachment must be ignored

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25121>
This commit is contained in:
Mike Blumenkrantz 2023-09-15 09:29:49 -04:00 committed by Marge Bot
parent 4272234736
commit 047213fcba

View file

@ -2948,7 +2948,9 @@ tu_calc_bandwidth(struct tu_bandwidth *bandwidth,
const VkFormat format = rp->color_attachment_formats[i];
uint32_t write_bpp = 0;
if (att->write_mask == 0xf) {
if (format == VK_FORMAT_UNDEFINED) {
/* do nothing */
} else if (att->write_mask == 0xf) {
write_bpp = vk_format_get_blocksizebits(format);
} else {
const enum pipe_format pipe_format = vk_format_to_pipe_format(format);