#include <gpu_buffer.h>
|
virtual | ~GpuBuffer () |
|
virtual void | Destroy () |
|
virtual void | Create (const WString &name, UINT num_elements, UINT element_size, void *initial_data=nullptr, bool create_views=true) |
|
const UINT & | GetUAV () const |
|
const UINT & | GetSRV () const |
|
const D3D12_GPU_VIRTUAL_ADDRESS & | GetRootCBV () const |
|
D3D12_GPU_VIRTUAL_ADDRESS | GetRootCBV () |
|
D3D12_VERTEX_BUFFER_VIEW | GetVertexBufferView (UINT offset, UINT size, UINT stride) const |
|
D3D12_VERTEX_BUFFER_VIEW | GetVertexBufferView (UINT base_vertex_index=0) const |
|
D3D12_INDEX_BUFFER_VIEW | GetIndexBufferView (UINT offset, UINT size, bool is_32_bit=false) const |
|
D3D12_INDEX_BUFFER_VIEW | GetIndexBufferView (UINT start_index=0) const |
|
| GpuResource () |
|
| GpuResource (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) |
|
virtual | ~GpuResource () |
|
void | Associate (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) |
|
void | Destroy () |
|
ID3D12Resource * | operator-> () |
|
const ID3D12Resource * | operator-> () const |
|
| operator ID3D12Resource * () |
|
ID3D12Resource * | Get () |
|
const D3D12_RESOURCE_STATES & | GetState () const |
|
const D3D12_RESOURCE_STATES & | GetTransitionState () const |
|
Wraps buffer-type GpuResource's.
Any type of buffer resource in Blowbox is based on the GpuBuffer. The GpuBuffer automatically creates the necessary resource descriptors for you when you call GpuBuffer::Create(). You can retrieve those by calling GpuBuffer::GetUAV() or GpuBuffer::GetSRV().
virtual blowbox::GpuBuffer::~GpuBuffer |
( |
| ) |
|
|
inlinevirtual |
blowbox::GpuBuffer::GpuBuffer |
( |
| ) |
|
|
protected |
void blowbox::GpuBuffer::Create |
( |
const WString & |
name, |
|
|
UINT |
num_elements, |
|
|
UINT |
element_size, |
|
|
void * |
initial_data = nullptr , |
|
|
bool |
create_views = true |
|
) |
| |
|
virtual |
Creates actual buffer resource.
- Parameters
-
[in] | name | The name of the buffer resource. |
[in] | num_elements | The number of elements that exist in the buffer. |
[in] | element_size | The size of each element in the buffer. |
[in] | initial_data | If the buffer should be initialized immediately with data, enter a pointer to it here. Pointer should be of size num_elements * element_size. |
[in] | create_views | Whether the resource descriptors (views) should automatically be created. |
virtual void blowbox::GpuBuffer::CreateDerivedViews |
( |
| ) |
|
|
protectedpure virtual |
D3D12_RESOURCE_DESC blowbox::GpuBuffer::DescribeBuffer |
( |
| ) |
|
|
protected |
Generates a D3D12_RESOURCE_DESC based on the buffer size and resource flags.
- Returns
- A D3D12_RESOURCE_DESC for buffer-type resources based on this GpuBuffer's settings.
void blowbox::GpuBuffer::Destroy |
( |
| ) |
|
|
virtual |
D3D12_INDEX_BUFFER_VIEW blowbox::GpuBuffer::GetIndexBufferView |
( |
UINT |
offset, |
|
|
UINT |
size, |
|
|
bool |
is_32_bit = false |
|
) |
| const |
- Returns
- An IndexBufferView for this buffer.
- Parameters
-
[in] | offset | An offset into the buffer from which the IBV should start. |
[in] | size | The size of the VBV - i.e. how many bytes the IBV should cover. (most likely equal to num_elements * element_size) |
[in] | is_32_bit | Whether every index in the buffer is 32 bit or 16 bit. 16 bit usually suffices. |
D3D12_INDEX_BUFFER_VIEW blowbox::GpuBuffer::GetIndexBufferView |
( |
UINT |
start_index = 0 | ) |
const |
- Returns
- An IndexBufferView for this buffer, created automatically based on which index should be first.
- Parameters
-
[in] | start_index | The index of the first index that the IBV should base itself around. |
const D3D12_GPU_VIRTUAL_ADDRESS& blowbox::GpuBuffer::GetRootCBV |
( |
| ) |
const |
|
inline |
D3D12_GPU_VIRTUAL_ADDRESS blowbox::GpuBuffer::GetRootCBV |
( |
| ) |
|
|
inline |
const UINT& blowbox::GpuBuffer::GetSRV |
( |
| ) |
const |
|
inline |
- Returns
- The SRV for this resource.
const UINT& blowbox::GpuBuffer::GetUAV |
( |
| ) |
const |
|
inline |
- Returns
- The UAV for this resource.
D3D12_VERTEX_BUFFER_VIEW blowbox::GpuBuffer::GetVertexBufferView |
( |
UINT |
offset, |
|
|
UINT |
size, |
|
|
UINT |
stride |
|
) |
| const |
- Returns
- A VertexBufferView for this buffer.
- Parameters
-
[in] | offset | An offset into the buffer from which the VBV should start. |
[in] | size | The size of the VBV - i.e. how many bytes the VBV should cover. (most likely equal to num_elements * element_size) |
[in] | stride | The stride size of each vertex in the buffer (most likely equal to element_size) |
D3D12_VERTEX_BUFFER_VIEW blowbox::GpuBuffer::GetVertexBufferView |
( |
UINT |
base_vertex_index = 0 | ) |
const |
- Returns
- A VertexBufferView for this buffer, created automatically based on which element should be first.
- Parameters
-
[in] | base_vertex_index | The index of the first vertex that the VBV should base itself around. |
UINT blowbox::GpuBuffer::buffer_size_ |
|
protected |
UINT blowbox::GpuBuffer::element_count_ |
|
protected |
UINT blowbox::GpuBuffer::element_size_ |
|
protected |
D3D12_RESOURCE_FLAGS blowbox::GpuBuffer::resource_flags_ |
|
protected |
UINT blowbox::GpuBuffer::srv_id_ |
|
protected |
UINT blowbox::GpuBuffer::uav_id_ |
|
protected |
The documentation for this class was generated from the following files:
- C:/Projects/blowbox-2017/src/renderer/buffers/gpu_buffer.h
- C:/Projects/blowbox-2017/src/renderer/buffers/gpu_buffer.cc