RavEngine
Loading...
Searching...
No Matches
D3D12DynamicDescriptorHeap.hpp
1#pragma once
2#include <memory>
3#include <queue>
4#include <directx/d3d12.h>
5#include <DescriptorHeap.h>
6#include "FreeList.hpp"
7
8
9namespace RGL {
10 template<uint32_t totalCount = 2048u>
11 struct D3D12DynamicDescriptorHeap : public DirectX::DescriptorHeap {
12 using index_t = std::remove_const_t<std::make_unsigned_t<decltype(totalCount)>>;
13 private:
14 ID3D12Device* owningDevice;
16 public:
17
18 D3D12DynamicDescriptorHeap(decltype(owningDevice) device, D3D12_DESCRIPTOR_HEAP_TYPE type, D3D12_DESCRIPTOR_HEAP_FLAGS flags) : owningDevice(device), DescriptorHeap(device, type, flags, totalCount) {}
19
25 index_t AllocateSingle() {
26 return freeList.Allocate();
27 }
28
33 void DeallocateSingle(index_t index) {
34 freeList.Deallocate(index);
35 }
36
37 };
38}
Definition D3D12DynamicDescriptorHeap.hpp:11
void DeallocateSingle(index_t index)
Definition D3D12DynamicDescriptorHeap.hpp:33
index_t AllocateSingle()
Definition D3D12DynamicDescriptorHeap.hpp:25
Definition FreeList.hpp:7