Limited number of Uniform Buffers?

Started by
2 comments, last by turanszkij 5 years, 11 months ago

Hi, running Vulkan with the latest SDK, validation layers enabled I just got the following warning:

Quote

vkCreatePipelineLayout(): max per-stage uniform buffer bindings count (15) exceeds device maxPerStageDescriptorUniformBuffers limit (12). The spec valid usage text states 'The total number of descriptors of the type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any shader stage across all elements of pSetLayouts must be less than or equal to VkPhysicalDeviceLimits::maxPerStageDescriptorUniformBuffers' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00288)

That is really strange, because in DX11 we can have 15 constant buffers per shader stage. And my device (Nvidia GTX 1050 is DX11 compatible of course) Did anyone else run into the same issue? How is it usually handled? I would prefer not enforcing less amount of CBs for the Vulkan device and be as closely compliant to DX11 as possible. Any idea what could be the reason behind this limitation?

Advertisement

I also saw this after updating my validation layers recently. In my program, I was using 13 instead of the max 12, so I just combined two of my buffers -- not really a general-purpose solution. The limit feels frustratingly-low compared to the other graphics API's I support, so I'd also be interested in hearing why this limitation exists.

By the way, I use a GTX 770 and have the same limit (12). That seems unusual considering how much newer your card is. Seems like it's a global driver limit and not necessarily linked with the chip?

Apparently there can also be a limit on the number of descriptor sets bound at the same time. The minimally supported amount is 4 as opposed to there are 5 shader stages (graphics) and unfortunately this means that we can't rely on mapping shader stage to descriptor set id with lower end GPUs. For example the Intel 620 GPU is still quite common and has this limitation. 

There could be an other solution of merging multiple descriptor sets into one and multiple shader stages will have visibility on it. But that way you always have to keep versioning a very huge descriptor set which I don't wanna do...

This topic is closed to new replies.

Advertisement