Conversation
Owner
Author
|
Run: checks |
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
This PR adds support for virtual allocators, which can be used to efficiently manage sub-allocated ranges from custom resources, such as buffers or descriptor heaps. Fundamentally, they are exposed as a backend specific class called
VirtualAllocator, which internally wrap the D3D12MA and VMA virtual allocators.On top of this, descriptor heaps now use this functionality. The main change is that descriptor sets no longer store address/offset pairs, but
VirtualAllocator::Allocations.IGraphicsDevice::allocateGlobalDescriptorsimplementations return an allocation object now accordingly. This changes the internal allocation behavior, as re-using released descriptors in the global heaps is now far more common.This also revealed an issue with the D3D12 blitter implementation, that did release descriptor sets too early. With the previous implementation, descriptors were unlikely to get re-used, but with the new implementation, they will be almost certainly be re-used, causing them to be overwritten before the command buffer executed. For this reason, a new tracking interface for descriptor sets has been added to command buffers, similar to the one for shared resources. This can be used in such temporary cases to ensure, descriptor sets remain allocated until the commands executed.
Related issues