Wraps a SSBO with fixed and optional dynamic array sections using BufferLayout.
More...
#include <spk_shader_storage_buffer_object.hpp>
Wraps a SSBO with fixed and optional dynamic array sections using BufferLayout.
- See also
- BufferLayout, UniformBufferObject
◆ ShaderStorageBufferObject() [1/2]
| spk::OpenGL::ShaderStorageBufferObject::ShaderStorageBufferObject |
( |
GLuint | p_bindingPoint, |
|
|
BufferObject::Usage | p_usage, |
|
|
const size_t & | p_size ) |
Creates an SSBO bound to a binding point.
- Parameters
-
| p_bindingPoint | Binding index. |
| p_usage | Usage hint. |
| p_size | Initial buffer size. |
◆ ShaderStorageBufferObject() [2/2]
Copies buffer binding and layout configuration from another SSBO.
- Parameters
-
◆ data() [1/2]
| BufferObject::Buffer::value_type * spk::OpenGL::BufferObject::data |
( |
| ) |
|
Mutable pointer to underlying bytes.
- Returns
- Pointer or nullptr if empty.
◆ data() [2/2]
| const BufferObject::Buffer::value_type * spk::OpenGL::BufferObject::data |
( |
| ) |
const |
Const pointer to underlying bytes.
- Returns
- Pointer or nullptr if empty.
◆ layout() [1/2]
| BufferLayout & spk::OpenGL::ShaderStorageBufferObject::layout |
( |
| ) |
|
Accesses the layout describing the buffer.
- Returns
- Mutable layout.
◆ layout() [2/2]
| const BufferLayout & spk::OpenGL::ShaderStorageBufferObject::layout |
( |
| ) |
const |
Accesses the layout describing the buffer.
- Returns
- Const layout.
◆ operator=()
Copies buffer binding and layout configuration from another SSBO.
- Parameters
-
- Returns
- Reference to this.
◆ pullDynamic()
template<typename TElement>
| std::vector< TElement > spk::OpenGL::ShaderStorageBufferObject::pullDynamic |
( |
| ) |
const |
|
inline |
Reads the dynamic array section into a vector of elements.
- Template Parameters
-
| TElement | Trivially copyable element type. |
- Returns
- Vector containing the dynamic portion.
◆ pullFixed()
template<typename TType>
| TType spk::OpenGL::ShaderStorageBufferObject::pullFixed |
( |
| ) |
const |
|
inline |
Reads the fixed section of the SSBO into a trivially copyable type.
- Template Parameters
-
| TType | Destination POD type. |
- Returns
- Value copied from the beginning of the buffer.
◆ resizeDynamicArray()
| void spk::OpenGL::ShaderStorageBufferObject::resizeDynamicArray |
( |
std::size_t | p_newCount | ) |
|
Resizes the dynamic array section.
- Parameters
-
◆ setDynamicElement()
| void spk::OpenGL::ShaderStorageBufferObject::setDynamicElement |
( |
const std::wstring & | p_name, |
|
|
const BufferLayout::Element & | p_elementPrototype ) |
Defines the prototype for the dynamic array section.
- Parameters
-
| p_name | Name of the dynamic array field. |
| p_elementPrototype | Element layout to repeat. |
◆ setDynamicPadding()
| void spk::OpenGL::ShaderStorageBufferObject::setDynamicPadding |
( |
std::size_t | p_padding | ) |
|
Sets padding between fixed and dynamic sections.
- Parameters
-
◆ size()
| size_t spk::OpenGL::BufferObject::size |
( |
| ) |
const |
Returns the current CPU buffer size.
- Returns
- Byte size.
The documentation for this class was generated from the following files: