Skip to content

Commit 6d0164f

Browse files
Update descriptor_buffer.adoc (#351)
Small extra gotcha around using `vkGetDescriptorSetLayoutSize`
1 parent 5117792 commit 6d0164f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chapters/descriptor_buffer.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ vkGetDescriptorSetLayoutBindingOffsetEXT(device, ds_layout_0, 2, &binding_2_offs
101101
// ...
102102
----
103103

104+
[NOTE]
105+
====
106+
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`.
107+
====
108+
104109
== Creating Descriptor Buffers
105110

106111
We will create a "special" `VkBuffer` with `VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT` that now makes it a "descriptor buffer" `VkBuffer`.

0 commit comments

Comments
 (0)