tu: Zero MSRTSS temporary image before creating it

In the dynamic rendering case, the images are allocated statically out
of the command buffer and may be reused, so we have to make they are
zeroed to match the normal tu_CreateImage() path. Otherwise we may get
garbage from previous usages of the image.

Fixes: f6c7f16322 ("tu: Implement VK_EXT_multisampled_render_to_single_sampled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38032>
This commit is contained in:
Connor Abbott 2025-10-23 12:27:44 -04:00 committed by Marge Bot
parent c0b5c04b84
commit f58b24467a

View file

@ -3767,7 +3767,17 @@ tu_init_msrtss_attachments(struct tu_device *device,
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT),
};
/* In case we're using dynamic rendering, reset the image struct from
* the last use.
*/
memset(&images[i], 0, sizeof(images[i]));
/* Note: we don't need a corresponding vk_image_finish() when destroying
* the framebuffer or finishing the render pass because the object is
* internal and we never attach private data or a name to it.
*/
vk_image_init(&device->vk, &images[i].vk, &image_info);
tu_image_init(device, &images[i], &image_info);
TU_CALLX(device, tu_image_update_layout)(device, &images[i], DRM_FORMAT_MOD_INVALID, NULL);