nCine::RHI::GU::GuShaderUniformBlocks class

Manages the uniform-block caches of a program (aliased as RHI::ShaderUniformBlocks).

Owns a GuUniformBlockCache per active block, distributes a shared host data buffer across them, and on Bind() forwards each block's own storage to the device so the effect running the following draw can sample it. Nothing is staged through the streaming uniform buffer, see CommitUniformBlocks().

Public types

using UniformHashMapType = std::vector<GuUniformBlockCache>
using UniformRangeAllocator = RHI::BufferRange(*)(std::uint32_t bytes)
Function that suballocates a range of the given size from the streaming uniform buffer.

Public static functions

static void SetUniformRangeAllocator(UniformRangeAllocator allocator)
Sets the allocator used by CommitUniformBlocks() (registered by the pipeline at startup).

Constructors, destructors, conversion operators

GuShaderUniformBlocks()
GuShaderUniformBlocks(GuShaderProgram* shaderProgram) explicit
GuShaderUniformBlocks(GuShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)

Public functions

void SetProgram(GuShaderProgram* shaderProgram)
void SetProgram(GuShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)
void SetUniformsDataPointer(std::uint8_t* dataPointer)
auto GetUniformBlockCount() const -> std::uint32_t
auto HasUniformBlock(const char* name) const -> bool
auto GetUniformBlock(const char* name) -> GuUniformBlockCache*
auto GetAllUniformBlocks() const -> const UniformHashMapType&
Returns the container of all managed block caches (range-iterates as GuUniformBlockCache&).
void CommitUniformBlocks()
void Bind()