From 047213fcbaffda7e769ed982bb1113c4383b5ee2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 15 Sep 2023 09:29:49 -0400 Subject: [PATCH] tu: handle unused color attachments without crashing if the format is not set then this attachment must be ignored Fixes: 97da0a77341 ("tu: Rewrite to use common Vulkan dynamic state") Part-of: --- src/freedreno/vulkan/tu_pipeline.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_pipeline.cc b/src/freedreno/vulkan/tu_pipeline.cc index 5932a60..ba56cfd 100644 --- a/src/freedreno/vulkan/tu_pipeline.cc +++ b/src/freedreno/vulkan/tu_pipeline.cc @@ -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); -- 2.7.4