|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
GPU memory buffer containing an array of structs to be read by a shader program. More...
#include <GREM/graphics/buffers.hpp>

Public Types | |
| using | fields_type = FieldStruct |
| Field struct type of the buffer. | |
Public Member Functions | |
| StorageBuffer (Device &device) | |
| Create a new empty buffer set up to contain the specified element type. | |
| void | upload (StridedSpan< const FieldStruct > newElements) |
| Upload a new array of data to the buffer, overriding any previous contents. | |
| void | write (uint32_t elementOffset, StridedSpan< const FieldStruct > newElements) |
| Upload new elements to the buffer at a specific offset, overriding any data that previously occupied that location, and growing the buffer capacity if necessary. | |
| void | write (uint32_t elementIndex, const FieldStruct &newElement) |
| Upload a new element to the buffer at a specific index, overriding any element that previously occupied that location, and growing the buffer capacity if necessary. | |
Static Public Attributes | |
| static constexpr StorageBufferLayout< FieldStruct, Name > | LAYOUT {} |
| Layout of the buffer. | |
| static constexpr BufferLayoutReference | LAYOUT_REFERENCE = static_cast<StorageBufferLayoutReference>(LAYOUT) |
| Type-erased reference to the layout of the buffer. | |
| static constexpr CStringView | NAME = Name |
| Name of the buffer. | |
GPU memory buffer containing an array of structs to be read by a shader program.
| FieldStruct | user-defined aggregate type with the fields that each element of the buffer should contain. |
| Name | name of the storage buffer. Must be globally unique among all buffer type instantiations. |
| using grem::graphics::StorageBuffer< FieldStruct, Name >::fields_type = FieldStruct |
Field struct type of the buffer.
|
inlineexplicit |
Create a new empty buffer set up to contain the specified element type.
| device | device to create the buffer for. Must outlive the buffer. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Upload a new array of data to the buffer, overriding any previous contents.
| newElements | new array of elements to upload. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Upload new elements to the buffer at a specific offset, overriding any data that previously occupied that location, and growing the buffer capacity if necessary.
| elementOffset | offset at which to write the new elements. |
| newElements | new elements to upload. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Upload a new element to the buffer at a specific index, overriding any element that previously occupied that location, and growing the buffer capacity if necessary.
| elementIndex | index at which to write the new element. |
| newElement | new element to upload. |
| graphics::Error | if resource creation failed. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
staticconstexpr |
Layout of the buffer.
|
staticconstexpr |
Type-erased reference to the layout of the buffer.
|
staticconstexpr |
Name of the buffer.