zink: Avoid optimalDeviceAccess on MoltenVK when creating depth taregts.

MoltenVK fails to create a depth format target if `optimalDeviceAccess`, `info.have_EXT_host_image_copy` and `VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT` are in used.
The specification seems to claim it is not needed if `hic.identicalMemoryLayout` is set, so for a MoltenVK build unset optimalDeviceAccess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32651>
This commit is contained in:
duncan.hopkins
2024-11-27 15:25:25 +00:00
committed by Marge Bot
parent e630d4fb70
commit 17e5ea118e
+6
View File
@@ -367,6 +367,12 @@ check_ici(struct zink_screen *screen, VkImageCreateInfo *ici, uint64_t modifier)
image_props = props2.imageFormatProperties;
if (screen->info.have_EXT_host_image_copy && ici->usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT)
optimalDeviceAccess = hic.optimalDeviceAccess;
#if defined(MVK_VERSION)
// MoltenVK cannot allocate a depth buffer with VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT
// As hic.identicalMemoryLayout is set, it is not needed?
if (screen->info.have_EXT_host_image_copy && ici->usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT && hic.identicalMemoryLayout)
optimalDeviceAccess = false;
#endif
} else
ret = VKSCR(GetPhysicalDeviceImageFormatProperties)(screen->pdev, ici->format, ici->imageType,
ici->tiling, ici->usage, ici->flags, &image_props);