vulkan

What is the difference between the limits maxDescriptorSetTotalStorageBuffersDynamic and maxDescriptorSetStorageBuffersDynamic?


From the specification for VkPhysicalDeviceLimits,

maxDescriptorSetStorageBuffersDynamic is the maximum number of dynamic storage buffers that can be included in a pipeline layout. Descriptors with a type of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC count against this limit. Only descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set count against this limit.

And from the specification for VkPhysicalDeviceMaintenance7PropertiesKHR

maxDescriptorSetTotalStorageBuffersDynamic is the maximum total count of dynamic storage buffers that can be included in a pipeline layout. Descriptors with a type of VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC count against this limit. Only descriptors in descriptor set layouts created without the VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set count against this limit.

The only difference in the description here is that the first is the "maximum total count" and the second is the "maximum number".

If they meant the same thing maintenance7 wouldn't have needed to include it, so what am I missing? What's the difference between these?

The same applies for the similarly named limits for dynamic uniform buffers and the updateAfterBind variants.


Solution

  • It appears to allow for more using more of either uniform or storage buffers by better clarifying the limits.

    The proposal archive describes why:

    1.4. Relax Count of Dynamic Uniform/Storage Buffers

    The maximum count of dynamic uniform buffers and dynamic storage buffers that can be included in a pipeline layout are reported separately. While some implementations treat dynamic offsets of uniform buffers and storage buffers the same way, reporting the total count along with maximum count of dynamic uniform and storage buffers could relax the limitation and expose device capabilities more accurately.

    From what I can tell, in the past implementation reported a max number of uniform buffers and max number of storage buffers. Some implementation don't meaningfully distinguish between the two, and so may have reported values that are either over or under representative. Perhaps those implementations split it in half (or at any other proportion) and reported those values. Perhaps they instead both reported the max to both groups, leaving confusing errors for developers who use too many descriptor slots. I would guess such implementations would've chosen the former.

    This maintenance update now allows those implementations to report that the values are shared. Assuming implementations previously chose the former (underrepresenting hardware capabilities), this change allows applications to understand that they can use additional storage buffers by sacrificing uniform buffers, or vice versa.

    I'm not sure which hardware this was for, but it appears that NVIDIA hardware treats uniform buffers and storage buffers differently, so the values don't differ from VkPhysicalDeviceLimits.