Abstract class for UBO. A UBO is mostly used for shader variables, for instance projection or view matrices, which can be updated in GPU each frame.
More...
#include <Buffer.h>
|
| | UniformBufferObject (std::vector< ShaderDataType > dataTypes, uint32_t bindingPointIndex) |
| | An agnostic constructor provided for precomputation of offset and buffer size.
|
| virtual | ~UniformBufferObject ()=default |
| | Pure virtual destructor and sub class should have appropriate implementation.
|
| template<typename... T> |
| void | UpdateUniforms (T &&... uniforms) |
| | Set the m_UniformList with latest supplied uniforms.
|
| virtual void | UploadUniformBuffer (size_t frameIndex=0)=0 |
| | An overridable function to upload the uniform buffer.
|
|
uint32_t | GetBufferSize () const |
|
const std::vector< UBODataPointer > & | GetUniformList () const |
|
const std::vector< ShaderDataType > & | GetUniformDataType () const |
|
const std::vector< uint32_t > & | GetAlignedOffsets () const |
|
const std::vector< uint32_t > & | GetUniformSize () const |
|
uint32_t | GetBindingPointIndex () const |
|
| static UniformBufferObject * | Create (std::vector< ShaderDataType > dataTypes, uint32_t bindingPointIndex) |
| | A function for appropriate initialization of UBO based on programmer selected rendered (Vulkan or OpenGL).
|
Abstract class for UBO. A UBO is mostly used for shader variables, for instance projection or view matrices, which can be updated in GPU each frame.
- See also
- VulkanUniformBuffer object
- Since
- Karma 1.0.0
◆ UniformBufferObject()
| Karma::UniformBufferObject::UniformBufferObject |
( |
std::vector< ShaderDataType > | dataTypes, |
|
|
uint32_t | bindingPointIndex ) |
An agnostic constructor provided for precomputation of offset and buffer size.
- Parameters
-
| dataTypes | See Create for information |
| bindingPointIndex | See Create for information |
- Since
- Karma 1.0.0
◆ ~UniformBufferObject()
| virtual Karma::UniformBufferObject::~UniformBufferObject |
( |
| ) |
|
|
virtualdefault |
Pure virtual destructor and sub class should have appropriate implementation.
- Since
- Karma 1.0.0
◆ CalculateOffsetsAndBufferSize()
| void Karma::UniformBufferObject::CalculateOffsetsAndBufferSize |
( |
| ) |
|
|
protected |
Calculate offsets and buffer size of the uniform buffer object(s).
Basically individual uniform's offset (from the beginning) and size are computed and cached in m_UniformAlignedOffsets and m_UniformSizes list. The offsets are boundary aligned to the multiple of individual uniform size.
- Since
- Karma 1.0.0
◆ Create()
A function for appropriate initialization of UBO based on programmer selected rendered (Vulkan or OpenGL).
- Parameters
-
◆ UpdateUniforms()
template<typename... T>
| void Karma::UniformBufferObject::UpdateUniforms |
( |
T &&... | uniforms | ) |
|
|
inline |
Set the m_UniformList with latest supplied uniforms.
- See also
- Material::OnUpdate
- Since
- Karma 1.0.0
◆ UploadUniformBuffer()
| virtual void Karma::UniformBufferObject::UploadUniformBuffer |
( |
size_t | frameIndex = 0 | ) |
|
|
pure virtual |
◆ m_BindingPoint
| uint32_t Karma::UniformBufferObject::m_BindingPoint |
|
protected |
◆ m_BufferSize
| uint32_t Karma::UniformBufferObject::m_BufferSize |
|
protected |
Total size of the buffer in bytes.
- Since
- Karma 1.0.0
◆ m_UniformAlignedOffsets
| std::vector<uint32_t> Karma::UniformBufferObject::m_UniformAlignedOffsets |
|
protected |
List of individual uniform boundary aligned (with multiple of individual uniform size) offsets.
- Since
- Karma 1.0.0
◆ m_UniformDataType
| std::vector<ShaderDataType> Karma::UniformBufferObject::m_UniformDataType |
|
protected |
List of data types (ShaderDataType) for the m_UniformList.
- Since
- Karma 1.0.0
◆ m_UniformList
List of uniforms to be uploaded.
- Since
- Karma 1.0.0
◆ m_UniformSizes
| std::vector<uint32_t> Karma::UniformBufferObject::m_UniformSizes |
|
protected |
List of individual uniform sizes.
- Since
- Karam 1.0.0
The documentation for this struct was generated from the following files:
- Karma/src/Karma/Renderer/Buffer.h
- Karma/src/Karma/Renderer/Buffer.cpp