-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StandardDescriptorSetAllocator handles layouts with high VariableDescriptorCount badly #2453
Comments
Apart from the overflow, this is intended behavior. The number of preallocated sets is configurable for this reason: you're supposed to set it to 1 for bindless. But just asking for my understanding, what were you expecting setting the max count so high? |
I guess we could add another option that limits the number of descriptors allocated, which would allow you to avoid recreating the layout? |
For the record, |
Even if you were to do that, it'll still allocate
I think that's a quite reasonable solution to only allow it to pool a configurable amount of descriptors (like <=1024) and anything above that receiving a dedicated pool, akin to memory allocation.
I pretty much expected having to write my own allocator down the line anyways, so I could see just leaving it as is as a viable solution for the moment, and I write my own allocator rather sooner than later :D |
Template
Issue
I was messing about with VariableDescriptorCount, and noticed that the maximum amount of descriptors one can have in a set has to be declared when the PipelineLayout is created. As I want as many as possible, I've just passed in
device.physical_device().properties().max_descriptor_set_sampled_images
, which on RADV is8388606 = 0x7ffffe
and on AMDVLK is4294967295 = 0xffffffff
. If you then allocate a dynamically-sized descriptor set of any amount of elements, the StandardDescriptorSetAllocator will always pre-allocatelayout.variable_descriptor_count() (just count below) * StandardDescriptorSetAllocatorCreateInfo::set_count (default 32)
descriptors, even if you only asked for like 2 sampled_image descriptors.vulkano/vulkano/src/descriptor_set/allocator.rs
Line 429 in 9b6e307
0x7ffffe * 32 = 268435392
descriptors, to which the driver returns an out of device memory error.You can test it by modifying this line in the
runtime-array
example from wanting at most 2 descriptors todevice.physical_device().properties().max_descriptor_set_sampled_images
:vulkano/examples/runtime-array/main.rs
Line 420 in 9b6e307
The text was updated successfully, but these errors were encountered: