Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
|
#include <descriptor_heap.h>
Public Member Functions | |
DescriptorHeap () | |
~DescriptorHeap () | |
void | Create (const WString &name, D3D12_DESCRIPTOR_HEAP_TYPE heap_type, D3D12_DESCRIPTOR_HEAP_FLAGS flags=D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, UINT descriptor_count=4096U) |
UINT | CreateDepthStencilView (ID3D12Resource *dsv_buffer, D3D12_DEPTH_STENCIL_VIEW_DESC *desc) |
UINT | CreateRenderTargetView (ID3D12Resource *rtv_buffer, D3D12_RENDER_TARGET_VIEW_DESC *desc) |
UINT | CreateConstantBufferView (D3D12_CONSTANT_BUFFER_VIEW_DESC *desc) |
UINT | CreateShaderResourceView (ID3D12Resource *srv_buffer, D3D12_SHADER_RESOURCE_VIEW_DESC *desc) |
UINT | CreateUnorderedAccessView (ID3D12Resource *buffer, ID3D12Resource *counter_buffer, D3D12_UNORDERED_ACCESS_VIEW_DESC *desc) |
UINT | CreateSampler (D3D12_SAMPLER_DESC *desc) |
D3D12_CPU_DESCRIPTOR_HANDLE | GetCPUDescriptorById (UINT id) |
D3D12_GPU_DESCRIPTOR_HANDLE | GetGPUDescriptorById (UINT id) |
ID3D12DescriptorHeap * | Get () |
const D3D12_DESCRIPTOR_HEAP_DESC & | GetDesc () |
void | Clear () |
UINT | GetDescriptorSize () const |
UINT | GetDescriptorsAllocated () const |
UINT | GetDescriptorHeapMaxAllocations () const |
Private Attributes | |
ID3D12DescriptorHeap * | heap_ |
D3D12_DESCRIPTOR_HEAP_DESC | heap_desc_ |
UINT | current_allocations_ |
UINT | descriptor_size_ |
Manages a ID3D12DescriptorHeap of a certain type.
Helps managing ID3D12DescriptorHeaps. It makes it easy to create and access descriptors for resources.
blowbox::DescriptorHeap::DescriptorHeap | ( | ) |
Constructs a DescriptorHeap.
blowbox::DescriptorHeap::~DescriptorHeap | ( | ) |
Destructs the DescriptorHeap.
void blowbox::DescriptorHeap::Clear | ( | ) |
Essentially resets the DescriptorHeap.
void blowbox::DescriptorHeap::Create | ( | const WString & | name, |
D3D12_DESCRIPTOR_HEAP_TYPE | heap_type, | ||
D3D12_DESCRIPTOR_HEAP_FLAGS | flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE , |
||
UINT | descriptor_count = 4096U |
||
) |
Creates the DescriptorHeap.
[in] | name | The name of the DescriptorHeap. |
[in] | heap_type | The type of DescriptorHeap. |
[in] | flags | Any flags that should be set on the DescriptorHeap. |
[in] | descriptor_count | The number of descriptors this DescriptorHeap should be able to hold. |
UINT blowbox::DescriptorHeap::CreateConstantBufferView | ( | D3D12_CONSTANT_BUFFER_VIEW_DESC * | desc | ) |
Creates a ConstantBufferView (descriptor)
[in] | desc | The description of this descriptor used to describe the resource with |
UINT blowbox::DescriptorHeap::CreateDepthStencilView | ( | ID3D12Resource * | dsv_buffer, |
D3D12_DEPTH_STENCIL_VIEW_DESC * | desc | ||
) |
Creates a DepthStencilView (descriptor)
[in] | dsv_buffer | The buffer this descriptor should describe |
[in] | desc | The description of this descriptor used to describe the resource with |
UINT blowbox::DescriptorHeap::CreateRenderTargetView | ( | ID3D12Resource * | rtv_buffer, |
D3D12_RENDER_TARGET_VIEW_DESC * | desc | ||
) |
Creates a RenderTargetView (descriptor)
[in] | rtv_buffer | The buffer this descriptor should describe |
[in] | desc | The description of this descriptor used to describe the resource with |
UINT blowbox::DescriptorHeap::CreateSampler | ( | D3D12_SAMPLER_DESC * | desc | ) |
Creates a sampler state (descriptor)
[in] | desc | The description of this descriptor used to describe the resource with |
UINT blowbox::DescriptorHeap::CreateShaderResourceView | ( | ID3D12Resource * | srv_buffer, |
D3D12_SHADER_RESOURCE_VIEW_DESC * | desc | ||
) |
Creates a ShaderResourceView (descriptor)
[in] | srv_buffer | The buffer the descriptor is describing |
[in] | desc | The description of this descriptor used to describe the resource with |
UINT blowbox::DescriptorHeap::CreateUnorderedAccessView | ( | ID3D12Resource * | buffer, |
ID3D12Resource * | counter_buffer, | ||
D3D12_UNORDERED_ACCESS_VIEW_DESC * | desc | ||
) |
Creates a UnorderedAccessView (descriptor)
[in] | buffer | The buffer this descriptor should describe |
[in] | counter_buffer | The counter buffer this descriptor should describe |
[in] | desc | The description of this descriptor used to describe the resource with |
|
inline |
D3D12_CPU_DESCRIPTOR_HANDLE blowbox::DescriptorHeap::GetCPUDescriptorById | ( | UINT | id | ) |
Get a cpu handle to a descriptor by its id.
[in] | id | The id of the desired descriptor |
|
inline |
|
inline |
|
inline |
|
inline |
D3D12_GPU_DESCRIPTOR_HANDLE blowbox::DescriptorHeap::GetGPUDescriptorById | ( | UINT | id | ) |
Get a gpu handle to a descriptor by its id.
[in] | id | The id of the desired descriptor |
|
private |
The number of descriptors in the descriptor heap in active use.
|
private |
The size of a single descriptor.
|
private |
The underlying descriptor heap.
|
private |
The description for the descriptor heap.