nCine::RHI::GS::GsShaderUniformBlocks class

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

Owns a GsUniformBlockCache per active block, distributes a shared host data buffer across them, copies the block contents into a suballocated range of the streaming uniform buffer on CommitUniformBlocks(), and on Bind() forwards each range to the device so the effect running the following draw can decode it.

Public types

using UniformHashMapType = std::vector<GsUniformBlockCache>
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

GsShaderUniformBlocks()
GsShaderUniformBlocks(GsShaderProgram* shaderProgram) explicit
GsShaderUniformBlocks(GsShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)

Public functions

void SetProgram(GsShaderProgram* shaderProgram)
void SetProgram(GsShaderProgram* 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) -> GsUniformBlockCache*
auto GetAllUniformBlocks() const -> const UniformHashMapType&
Returns the container of all managed block caches (range-iterates as GsUniformBlockCache&).
void CommitUniformBlocks()
void Bind()