Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Private Attributes | List of all members
blowbox::StructuredBuffer Class Reference

#include <structured_buffer.h>

Public Member Functions

virtual void Destroy () override
 
virtual void CreateDerivedViews () override
 
ByteAddressBufferGetCounterBuffer ()
 
const ByteAddressBufferGetCounterBuffer () const
 
const UINT & GetCounterSRV (CommandContext &context)
 
const UINT & GetCounterUAV (CommandContext &context)
 
- Public Member Functions inherited from blowbox::GpuBuffer
virtual ~GpuBuffer ()
 
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
 
- Public Member Functions inherited from blowbox::GpuResource
 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
 

Private Attributes

ByteAddressBuffer counter_buffer_
 

Additional Inherited Members

- Protected Member Functions inherited from blowbox::GpuBuffer
 GpuBuffer ()
 
D3D12_RESOURCE_DESC DescribeBuffer ()
 
- Protected Member Functions inherited from blowbox::GpuResource
void AddToMemoryProfiler ()
 
void RemoveFromMemoryProfiler ()
 
- Protected Attributes inherited from blowbox::GpuBuffer
UINT uav_id_
 
UINT srv_id_
 
UINT element_count_
 
UINT element_size_
 
UINT buffer_size_
 
D3D12_RESOURCE_FLAGS resource_flags_
 
- Protected Attributes inherited from blowbox::GpuResource
WString name_
 
ID3D12Resource * resource_
 
D3D12_RESOURCE_STATES usage_state_
 
D3D12_RESOURCE_STATES transition_state_
 
D3D12_GPU_VIRTUAL_ADDRESS gpu_virtual_address_
 

Detailed Description

Wrapper for StructuredBuffer types.

This buffer allows you to easily create structured buffers. These are types of buffers which are partitioned into a number of elements. All elements are the exact same types, and repeating through the buffer. You can essentially see this is as the array equivalent of buffers.

Inheritance diagram for blowbox::StructuredBuffer:
blowbox::GpuBuffer blowbox::GpuResource

Member Function Documentation

void blowbox::StructuredBuffer::CreateDerivedViews ( )
overridevirtual

Creates the necessary descriptors (views) for this StructuredBuffer.

Implements blowbox::GpuBuffer.

void blowbox::StructuredBuffer::Destroy ( )
overridevirtual

Destroys the StructuredBuffer.

Reimplemented from blowbox::GpuBuffer.

ByteAddressBuffer& blowbox::StructuredBuffer::GetCounterBuffer ( )
inline
Returns
The counter buffer attached to this StructuredBuffer, used for dynamically resizing the StructuredBuffer.
const ByteAddressBuffer& blowbox::StructuredBuffer::GetCounterBuffer ( ) const
inline
Returns
The counter buffer attached to this StructuredBuffer, used for dynamically resizing the StructuredBuffer.
const UINT & blowbox::StructuredBuffer::GetCounterSRV ( CommandContext context)
Returns
The Shader Resource View for the Counter buffer.
Remarks
This automatically transitions the underlying counter buffer to the D3D12_RESOURCE_STATE_GENERIC_READ state.
const UINT & blowbox::StructuredBuffer::GetCounterUAV ( CommandContext context)
Returns
The Unordered Access View for the Counter buffer.
Remarks
This automatically transitions the underlying counter buffer to the D3D12_RESOURCE_STATE_UNORDERED_ACCESS state.

Member Data Documentation

ByteAddressBuffer blowbox::StructuredBuffer::counter_buffer_
private

The counter buffer for this StructuredBuffer, used to keep track of how large the StructuredBuffer is.


The documentation for this class was generated from the following files: