nCine::RHI::GX2::Gx2ShaderUniforms class

Manages the loose-uniform caches of a program (aliased as RHI::ShaderUniforms).

Owns a Gx2UniformCache for every active uniform of a program that is not part of a block, distributes a shared host data buffer across them, and on CommitUniforms() publishes every dirty value to the program. The managed set can be restricted to an include-only or exclude list of null-separated names.

Public types

using UniformHashMapType = SmallVector<Gx2UniformCache, 0>

Constructors, destructors, conversion operators

Gx2ShaderUniforms()
Gx2ShaderUniforms(Gx2ShaderProgram* shaderProgram) explicit
Gx2ShaderUniforms(Gx2ShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)

Public functions

void SetProgram(Gx2ShaderProgram* shaderProgram)
void SetProgram(Gx2ShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)
void SetUniformsDataPointer(std::uint8_t* dataPointer)
void SetDirty(bool isDirty)
auto GetUniformCount() const -> std::uint32_t
auto HasUniform(const char* name) const -> bool
auto GetUniform(const char* name) -> Gx2UniformCache*
auto GetAllUniforms() const -> const UniformHashMapType&
Returns the container of all managed uniform caches (range-iterates as Gx2UniformCache&).
void MarkDirty()
void CommitUniforms()