TextureSlots class

Public static variables

static uint32_t InvalidSlot constexpr

Constructors, destructors, conversion operators

TextureSlots(uint32_t capacity, uint32_t recycleFrames)
recycleFrames: how many AdvanceFrame calls a freed index waits before reuse.

Public functions

auto Allocate() -> uint32_t
The lowest index never used, or one whose wait is over. InvalidSlot if the table is full.
void Free(uint32_t index)
Give an index back. It cannot be allocated again until it has waited out the window.
void AdvanceFrame(std::vector<uint32_t>* released = nullptr)
auto LiveCount() const -> uint32_t
auto PendingCount() const -> uint32_t

Function documentation

void TextureSlots::AdvanceFrame(std::vector<uint32_t>* released = nullptr)

End of a frame. Indices whose wait is over are appended to released (if given) and become allocatable.