tu: Handle D32S8 -> R32 and R32 -> D32S8 copies

When we copy the depth aspect of a D32S8 image to or from a R32
image, we don't need to split the copy or modify the aspect mask. Limit
this path to "true" D32S8->D32S8 copies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33780>
This commit is contained in:
Connor Abbott 2025-02-18 14:05:07 -05:00 committed by Marge Bot
parent 12961c2c80
commit 767818d8d9

View file

@ -3028,7 +3028,8 @@ tu_CmdCopyImage2(VkCommandBuffer commandBuffer,
VK_FROM_HANDLE(tu_image, dst_image, pCopyImageInfo->dstImage);
for (uint32_t i = 0; i < pCopyImageInfo->regionCount; ++i) {
if (src_image->vk.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
if (src_image->vk.format == VK_FORMAT_D32_SFLOAT_S8_UINT &&
dst_image->vk.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
VkImageCopy2 info = pCopyImageInfo->pRegions[i];
u_foreach_bit(b, info.dstSubresource.aspectMask) {
info.srcSubresource.aspectMask = BIT(b);