class TGpuBufferSuballocation

template<bool IsRenderProxy>

Represents a single sub-allocation within a specific GpuBuffer.

Templated to support both main thread and render thread variants.

Public

Constructors

TGpuBufferSuballocation<IsRenderProxy>

TGpuBufferSuballocation<IsRenderProxy>() = default

TGpuBufferSuballocation<IsRenderProxy>

explicit TGpuBufferSuballocation<IsRenderProxy>(const SPtr<GpuBufferType> &buffer, u32 suballocationOffset = 0)

Methods

GetBuffer

const SPtr<GpuBufferType> &GetBuffer() const

Gets the underlying GPU buffer.

GetSuballocationIndex

u32 GetSuballocationIndex() const

Gets the zero-based suballocation index within the buffer.

Computed lazily from offset.

GetSuballocationOffset

u32 GetSuballocationOffset() const

Gets the byte offset from the start of the buffer for this suballocation.

GetSize

u32 GetSize() const

Gets the size of this suballocation in bytes (aligned).

May be larger than requested size during buffer creation due to alignment requirements.

IsValid

bool IsValid() const

Checks if this is a valid suballocation.

Reset

void Reset()

Clears the suballocation, making it invalid.

Map

TGpuBufferMappedScope<IsRenderProxy> Map(GpuMapOptions options = GpuMapOption::Write) const

Maps this suballocation for CPU access.

options
Map options (typically GpuMapOption::Write).

Returns: RAII mapped region that auto-flushes on destruction.

Private

Fields

mBuffer

SPtr<GpuBufferType> mBuffer

mSuballocationOffset

u32 mSuballocationOffset