![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <structured_buffer.hpp>
Public Member Functions | |
StructuredBuffer (ID3D11Device &device, std::size_t capacity) | |
StructuredBuffer (const StructuredBuffer &buffer)=delete | |
StructuredBuffer (StructuredBuffer &&buffer) noexcept=default | |
~StructuredBuffer ()=default | |
StructuredBuffer & | operator= (const StructuredBuffer &buffer)=delete |
StructuredBuffer & | operator= (StructuredBuffer &&buffer) noexcept=default |
std::size_t | size () const noexcept |
std::size_t | capacity () const noexcept |
void | UpdateData (ID3D11DeviceContext &device_context, const AlignedVector< T > &data) |
ID3D11ShaderResourceView & | Get () const noexcept |
template<typename PipelineStageT > | |
void | Bind (ID3D11DeviceContext &device_context, U32 slot) const noexcept |
Private Member Functions | |
void | SetupStructuredBuffer (ID3D11Device &device, std::size_t capacity) |
Private Attributes | |
ComPtr< ID3D11Buffer > | m_buffer |
ComPtr< ID3D11ShaderResourceView > | m_buffer_srv |
std::size_t | m_capacity |
std::size_t | m_size |
A class of structured buffers.
T | The data type. |
|
explicit |
Constructs a structured buffer.
[in,out] | device | A reference to the device. |
[in] | capacity | The initial capacity. |
Exception | Failed to setup this structured buffer. |
|
delete |
Constructs a structured buffer from the given structured buffer.
[in] | buffer | A reference to the structured buffer to copy. |
|
defaultnoexcept |
Constructs a structured buffer by moving the given structured buffer.
[in] | buffer | A reference to the structured buffer to move. |
|
default |
Destructs this structured buffer.
|
noexcept |
Binds this structured buffer.
D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
. PipelineStageT | The pipeline stage type. |
[in,out] | device_context | A reference to the device context. |
[in] | slot | The index into the device's zero-based array to set the shader resource view to (ranges from 0 to D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT - 1). |
|
noexcept |
Returns the capacity of this structured buffer.
|
noexcept |
Returns the shader resource view of this structured buffer.
|
delete |
Copies the given structured buffer to this structured buffer.
[in] | buffer | A reference to the structured buffer to copy. |
|
defaultnoexcept |
Moves the given structured buffer to this structured buffer.
[in] | buffer | A reference to the structured buffer to move. |
|
private |
Sets up the resource buffer and shader resource view of this structured buffer.
[in,out] | device | A reference to the device. |
[in] | capacity | The capacity. |
Exception | Failed to setup this structured buffer. |
|
noexcept |
Returns the size of this structured buffer.
void mage::rendering::StructuredBuffer< T >::UpdateData | ( | ID3D11DeviceContext & | device_context, |
const AlignedVector< T > & | data | ||
) |
Updates the data of this structured buffer with the given data.
[in,out] | device_context | A reference to the device context. |
[in] | data | A reference to a vector containing the data elements. |
Exception | Failed to update the data. |
|
private |
A pointer to the buffer resource of this structured buffer.
|
private |
A pointer to the shader resource view of this structured buffer.
|
private |
The number of available slots for storing data elements in the current buffer resource of this structured buffer (i.e. the capacity).
|
private |
The number of used slots for storing data elements in the current buffer resource of this structured buffer (i.e. the size).