Closed trojanfoe closed 2 years ago
Heap "slots" are an important resource in a given heap, so it's important to reuse them as much as possible.
The DescriptorHeap
class was designed for a 'static assignment' model where you knew all the slots you'd need up-front. The DescriptorPile
class was added to provide a set of 'static assignment' slots and then you can allocate more 'dynamic' slots at runtime up to the provided maximum.
As such, you should really have a system on-top of that you use to manage texture lifetime and reuse those slots. You'd only go back to DescriptorPile
when you needed more of them.
That's cool thanks, I have a simple allocator I can use in place of the DescriptorPile
class. Thanks for the clarification.
The motivation for DescriptorPile
was supporting Model where you don't know the number of SRV slots you need until runtime.
For 'streaming' scenarios where assets come and go, you should do something fancier yourself. You can of course you DescriptorPile
in your implementation if you want :)
I am just starting out with DirectX 12, so this request might just be nonsense, but my current strategy is to create a large CBV/SRV/UAV
DescriptorPile
in theDeviceResources
class and have my resource-based classes (likeTexture
) request a descriptor heap slot viaAllocate()
. However I want to support destroying the resource so would have expected to see aDescriptorPile::Free()
method to make a slot available to later allocations. What are my options here?