VkImageCreateInfo should ignore queeu family indices in some situation

The spec says indices pointer should be ignored when sharingMode is not
VK_SHARING_MODE_CONCURRENT.

We need to explicitly set index count to 0 and index pointer to null,
otherwise encoder will still try to encode it.

Spec:

https://registry.khronos.org/vulkan/specs/1.3/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-00913

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Yahan Zhou 2023-10-24 10:46:30 -07:00 committed by Marge Bot
parent 00d26a31fa
commit 822c88f173

View file

@ -4045,6 +4045,11 @@ VkResult ResourceTracker::on_vkCreateImage(void* context, VkResult, VkDevice dev
VkEncoder* enc = (VkEncoder*)context;
VkImageCreateInfo localCreateInfo = vk_make_orphan_copy(*pCreateInfo);
if (localCreateInfo.sharingMode != VK_SHARING_MODE_CONCURRENT) {
localCreateInfo.queueFamilyIndexCount = 0;
localCreateInfo.pQueueFamilyIndices = nullptr;
}
vk_struct_chain_iterator structChainIter = vk_make_chain_iterator(&localCreateInfo);
VkExternalMemoryImageCreateInfo localExtImgCi;