Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the pull request
In the Vulkan backend, descriptor sets are allocated from fixed-size descriptor pools. If descriptor sets are allocated from descriptor pools, they eventually run out of memory. This causes new pools to be allocated. To prevent unnecessary allocations, the pool size could be configured by clients. The default pool size is pretty conservatively assumed at
1024descriptor sets per pool. Most descriptor sets are, however, only allocated sparingly, so a lot of space is wasted.With this PR, pool sizes are determined by the amount of descriptor sets to be allocated. If a descriptor set layout needs to allocate large quantities of descriptor sets, it is now up to the client to allocate them in larger chunks. The favoured way would be to allocate a large set of descriptor sets (using
allocateMultiple) and discard them immediately. This will cause the descriptor sets to be cached until they are requested later on, when they will be handed out again.However, most descriptor sets are only created infrequently (ideally once) in small quantities, as this is the preferred way of using them. In this case, the new approach will no longer cause excessive pool sizes.
The
poolSizeparameters have been removed from the descriptor set layout and its builder interface.Related issues