From 102ee4d2d6033aa67ec7ca756e6ebbf0e763602d Mon Sep 17 00:00:00 2001 From: Spencer Fricke <115671160+spencer-lunarg@users.noreply.github.com> Date: Mon, 29 Sep 2025 10:20:24 -0400 Subject: [PATCH] Update descriptor_buffer.adoc Small extra gotcha around using `vkGetDescriptorSetLayoutSize` --- chapters/descriptor_buffer.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chapters/descriptor_buffer.adoc b/chapters/descriptor_buffer.adoc index cee2712..54fdf16 100644 --- a/chapters/descriptor_buffer.adoc +++ b/chapters/descriptor_buffer.adoc @@ -101,6 +101,11 @@ vkGetDescriptorSetLayoutBindingOffsetEXT(device, ds_layout_0, 2, &binding_2_offs // ... ---- +[NOTE] +==== +While it seems we could just go `VkPhysicalDeviceDescriptorBufferPropertiesEXT::storageBufferDescriptorSize * 3` to get the size, this is wrong as the driver might have to reserve extra memory for the descriptors for the VkDescriptorSetLayout. The storageBufferDescriptorSize value is used for mapping (see below) with `vkGetDescriptorEXT`. +==== + == Creating Descriptor Buffers We will create a "special" `VkBuffer` with `VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT` that now makes it a "descriptor buffer" `VkBuffer`.