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
9
namespace
RGL {
10
template
<u
int
32_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;
15
FreeList<index_t, totalCount>
freeList;
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
}
RGL::D3D12DynamicDescriptorHeap
Definition
D3D12DynamicDescriptorHeap.hpp:11
RGL::D3D12DynamicDescriptorHeap::DeallocateSingle
void DeallocateSingle(index_t index)
Definition
D3D12DynamicDescriptorHeap.hpp:33
RGL::D3D12DynamicDescriptorHeap::AllocateSingle
index_t AllocateSingle()
Definition
D3D12DynamicDescriptorHeap.hpp:25
RGL::FreeList
Definition
FreeList.hpp:7
RavEngine
deps
RGL
src
D3D12DynamicDescriptorHeap.hpp
Generated by
1.9.8