class render::RenderQueue

Render queue determines rendering order of draw commands contained within it.

Rendering order is determined by draw command material, and can influence rendering of transparent or opaque objects, or be used to improve performance by grouping similar commands together.

Public

Constructors

RenderQueue

Methods

~RenderQueue

virtual ~RenderQueue() = default

Add

void Add(const DrawCommand *drawCommand, float distFromCamera, u32 variationIndex)

Adds a new draw command to the render queue.

drawCommand
Draw command to add to the queue.
distFromCamera
Distance of this object from the camera. Used for distance sorting.
variationIndex
Index of the technique within material that's to be used to render the element with.

Clear

void Clear()

Clears all render operations from the queue.

Sort

virtual void Sort()

Sorts all the render operations using user-defined rules.

GetSortedEntries

const Vector<RenderQueueEntry> &GetSortedEntries() const

Returns a list of sorted render elements.

Caller must ensure Sort() is called before this method.

SetStateReduction

void SetStateReduction(StateReduction mode)

Controls if and how a render queue groups draw commands by material in order to reduce number of state changes.

Protected

Methods

staticCommandSortNoGroup

static bool CommandSortNoGroup(u32 aIdx, u32 bIdx, const Vector<SortableElement> &lookup)

Callback used for sorting commands with no material grouping.

staticCommandSortPreferGroup

static bool CommandSortPreferGroup(u32 aIdx, u32 bIdx, const Vector<SortableElement> &lookup)

Callback used for sorting commands with preferred material grouping.

staticCommandSortPreferDistance

static bool CommandSortPreferDistance(u32 aIdx, u32 bIdx, const Vector<SortableElement> &lookup)

Callback used for sorting commands with material grouping after sorting.

Fields

mSortableElements

Vector<SortableElement> mSortableElements

mSortableElementIndex

Vector<u32> mSortableElementIndex

mCommands

Vector<const DrawCommand *> mCommands

mSortedEntries

Vector<RenderQueueEntry> mSortedEntries

mStateReductionMode

StateReduction mStateReductionMode