class render::GpuUniformBufferMember

template<class T>

Wrapper for a single member in an uniform buffer.

Public

Constructors

GpuUniformBufferMember<T>

GpuUniformBufferMember<T>() = default

GpuUniformBufferMember<T>

Methods

Set

void Set(const GpuBufferMappedScope &mappedRegion, const T &value, u32 arrayIndex = 0, u32 suballocationIndex = 0) const

Sets parameter value directly to mapped memory via a GpuMappedRegion.

mappedRegion
Active mapping containing the mapped memory pointer of the buffer in which to set the value.
value
Value to set.
arrayIndex
Index in the array (if parameter is an array).
suballocationIndex
Index of the sub-allocation in the uniform buffer to set the value for, if the buffer contains multiple sub-allocated buffers. Mapped region is assumed to point to the start of the buffer (i.e. first suballocation).

Get

T Get(const GpuBufferMappedScope &mappedRegion, u32 arrayIndex = 0, u32 suballocationIndex = 0) const

Gets the parameter in the provided uniform buffer.

Caller is responsible for ensuring the uniform buffer contains this parameter.

mappedRegion
Active mapping containing the mapped memory pointer of the buffer from which to get the value.
arrayIndex
Index in the array to get the value for (if the parameter is an array).
suballocationIndex
Index of the sub-allocation in the uniform buffer to get the value for, if the buffer contains multiple sub-allocated buffers. Mapped region is assumed to point to the start of the buffer (i.e. first suballocation).

Protected

Methods

CalculateParameterOffset

u32 CalculateParameterOffset(const SPtr<GpuBuffer> &buffer, u32 suballocationIndex, u32 arrayIndex) const

Calculates the byte offset for a parameter accounting for sub-allocations and array indices.

staticWriteTypedToMemory

static void WriteTypedToMemory(void *destination, const GpuDataParameterTypeInformation &typeInformation, const void *source)

Writes typed data to memory with proper alignment/padding.

staticReadTypedFromMemory

static void ReadTypedFromMemory(const void *source, const GpuDataParameterTypeInformation &typeInformation, void *destination)

Reads typed data to memory with proper alignment/padding.

Fields

mMemberInformation