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

Public Types | |
| using | buffer_types = meta::TypeList<Buffers...> |
| Buffer type list of the buffer set. | |
Public Member Functions | |
| BufferSet (Device &device) | |
| Create a new set of empty buffers. | |
| BufferSet (Device &device, std::nullptr_t nullPointer) | |
| Create an empty set of buffers that is invalid until all of its buffers have been reassigned. | |
| BufferSet (Device &device, const Buffers &... buffers) | |
| Create a new buffer set from a set of existing buffers. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | setBuffer (std::nullptr_t nullPointer) |
| Remove a buffer from the set, making the set invalid until all of its buffers have been reassigned. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | setBuffer (const Buffer &buffer) |
| Assign an existing buffer to a slot in the buffer set. | |
| void | setBuffers (std::nullptr_t nullPointer) |
| Reset the buffer set to an empty set that is invalid until all of its buffers have been reassigned. | |
| void | setBuffers (const Buffers &... buffers) |
| Assign an existing set of buffers to the buffer set. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | upload (const typename Buffer::parameters_type &newParameterValues) |
| Upload new parameter values to a uniform buffer in the buffer set for the next shader invocation that reads from it. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | upload (StridedSpan< const typename Buffer::fields_type > newElements) |
| Upload a new array of data to a storage buffer in the buffer set, overriding any previous contents. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | write (uint32_t elementOffset, StridedSpan< const typename Buffer::fields_type > newElements) |
| Upload new elements to a storage buffer in the buffer set at a specific offset, overriding any data that previously occupied that location, and growing the buffer capacity if necessary. | |
| template<typename Buffer> requires (meta::type_list_contains_v<buffer_types, Buffer>) | |
| void | write (uint32_t elementIndex, const typename Buffer::fields_type &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 BufferSetLayout< Buffers... > | LAYOUT {} |
| Layout of the buffer set. | |
| static constexpr BufferLayoutReference | LAYOUT_REFERENCE = static_cast<BufferSetLayoutReference>(LAYOUT) |
| Type-erased reference to the layout of the buffer set. | |
| static constexpr CStringView | NAME = static_cast<BufferSetLayoutReference>(LAYOUT).name |
| Name of the buffer set. | |
Collection of GPU memory buffers to be read by a shader.
| Buffers | shader-readable buffer types to store in the buffer set. Each given type must be a unique specialization of UniformBuffer or StorageBuffer. |
| using grem::graphics::BufferSet< Buffers >::buffer_types = meta::TypeList<Buffers...> |
Buffer type list of the buffer set.
|
inlineexplicit |
Create a new set of empty buffers.
| device | device to create the buffer set for. Must outlive the buffer set. |
| 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 |
Create an empty set of buffers that is invalid until all of its buffers have been reassigned.
| device | device to create the buffer set for. Must outlive the buffer set. |
| nullPointer | nullptr. |
| 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. |
|
inlineexplicit |
Create a new buffer set from a set of existing buffers.
| device | device to create the buffer set for. Must outlive the buffer set. |
| buffers | buffers to create the buffer set from. |
| 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 |
Remove a buffer from the set, making the set invalid until all of its buffers have been reassigned.
| Buffer | buffer type to remove. Must be one of the types specified in the buffer set's buffer type list. |
| nullPointer | nullptr. |
| 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 |
Assign an existing buffer to a slot in the buffer set.
| Buffer | buffer type to assign. Must be one of the types specified in the buffer set's buffer type list. |
| buffer | new buffer to assign. |
| 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 |
Reset the buffer set to an empty set that is invalid until all of its buffers have been reassigned.
| nullPointer | nullptr. |
| 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 |
Assign an existing set of buffers to the buffer set.
| buffers | new buffers to assign. |
| 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 parameter values to a uniform buffer in the buffer set for the next shader invocation that reads from it.
| Buffer | uniform buffer type to upload new values to. Must be one of the types specified in the buffer set's buffer type list. |
| newParameterValues | new parameter values 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 array of data to a storage buffer in the buffer set, overriding any previous contents.
| Buffer | storage buffer type to upload new elements to. Must be one of the types specified in the buffer set's buffer type list. |
| 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 a storage buffer in the buffer set at a specific offset, overriding any data that previously occupied that location, and growing the buffer capacity if necessary.
| Buffer | storage buffer type to upload new elements to. Must be one of the types specified in the buffer set's buffer type list. |
| 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.
| Buffer | storage buffer type to upload new elements to. Must be one of the types specified in the buffer set's buffer type list. |
| 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 set.
|
staticconstexpr |
Type-erased reference to the layout of the buffer set.
|
staticconstexpr |
Name of the buffer set.