nCine::RHI::D3D11::D3D11ShaderUniformBlocks class

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

Owns a D3D11UniformBlockCache 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.

Public types

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

D3D11ShaderUniformBlocks()
D3D11ShaderUniformBlocks(D3D11ShaderProgram* shaderProgram) explicit
D3D11ShaderUniformBlocks(D3D11ShaderProgram* shaderProgram, const char* includeOnly, const char* exclude)

Public functions

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