nvk: Reserve a null image descriptor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:11:49 -06:00 committed by Marge Bot
parent 86d367e75b
commit 7d6ea3fcf5

View file

@ -190,6 +190,13 @@ nvk_CreateDevice(VkPhysicalDevice physicalDevice,
if (result != VK_SUCCESS)
goto fail_ctx;
/* Reserve the descriptor at offset 0 to be the null descriptor */
ASSERTED uint32_t null_image_index;
void *null_desc = nvk_descriptor_table_alloc(device, &device->images,
&null_image_index);
assert(null_desc != NULL && null_image_index == 0);
memset(null_desc, 0, 8 * 4);
result = vk_queue_init(&device->queue.vk, &device->vk, &pCreateInfo->pQueueCreateInfos[0], 0);
if (result != VK_SUCCESS)
goto fail_images;