nCine::RenderBatcher class

Merges compatible render commands into fewer draw calls.

Scans a sorted queue of RenderCommand objects and groups runs that share the same material sort key and primitive type into single batched commands, copying their per-instance uniform blocks, vertices and indices into shared memory. Reduces the number of draw calls issued each frame.

Constructors, destructors, conversion operators

RenderBatcher()

Public functions

void CreateBatches(const SmallVectorImpl<RenderCommand*>& srcQueue, SmallVectorImpl<RenderCommand*>& destQueue)
Collects consecutive compatible commands into batched commands.
void Reset()
Marks all managed buffers as free for reuse in the next frame.

Function documentation

void nCine::RenderBatcher::CreateBatches(const SmallVectorImpl<RenderCommand*>& srcQueue, SmallVectorImpl<RenderCommand*>& destQueue)

Collects consecutive compatible commands into batched commands.

Parameters
srcQueue Sorted source command queue
destQueue Destination queue that receives batched and pass-through commands

Commands that cannot be batched, or runs shorter than the minimum batch size, are passed through to the destination queue unchanged.