Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
DescriptorIndexAllocator.h
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
3#include <stack>
4#include <vector>
5
6namespace Engine::Core
7{
13{
14public:
16 explicit DescriptorIndexAllocator(int descriptorCount);
17
24 [[nodiscard]] uint32_t allocate();
25
31 void free(uint32_t index);
32
38 [[nodiscard]] const std::vector<uint32_t> &getUsedIndices() const;
39
45 void reset(int newSize);
46
47 size_t getCapacity() const;
48
49private:
50 std::stack<uint32_t> freeIndices;
51 std::vector<uint32_t> usedIndices;
52 uint32_t capacity;
53};
54}
uint32_t allocate()
Get an index where there is no data in the array.
DescriptorIndexAllocator(int descriptorCount)
const std::vector< uint32_t > & getUsedIndices() const
Gets the indices of all allocated fields in the array.
void reset(int newSize)
Resets all values in the buffers and allocates with new size.
void free(uint32_t index)
Frees a cell in the array where the memory is not used anymore.
Core audio subsystem owning the miniaudio engine and managing playback.
Definition AudioConfig.h:9