For staging descriptors CPU-side, I wanted to make it really easy to create and destroy descriptors.
I have a class that internally has a list of descriptor heaps, which in turn have a list of free indices.
- When a descriptor is created, the class claims a free slot in any of its internal heaps. If all heaps are full, a new one is automatically created.
- When a descriptor is destroyed, the class determines the heap and index of the descriptor and marks the corresponding slot as free again.