SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::RenderCommandQueue Class Reference

Frame-scoped queue of recorded draw/state commands, replayed into a RenderContext at flush time. More...

#include <RenderCommandQueue.hpp>

Classes

struct  ShadowDrawEntry
 A draw command paired with the transform/bone buffers it needs to replay in the shadow pass. More...

Public Member Functions

void Clear ()
 Drops queued commands for the current frame, keeping the cached shadow draw list.
void ClearAll ()
 Drops queued commands and the cached shadow draw list.
void ExecuteCommands (RenderContext *context)
void ExecuteShadowPass (RenderContext *context)
bool HasCachedShadowDraws () const
void OptimizeBatching ()
void SortCommands ()
void SubmitBindConstantBuffer (RefPtr< BufferBase > buffer, uint8_t slot)
 Queues a constant buffer bind at the given slot.
void SubmitBindMaterial (::Sleak::Material *material)
 Queues a material bind, switching shader/texture state for subsequent draws.
void SubmitCustomCommand (CustomCommand::ExecuteFunction function)
 Queues an arbitrary callback to run inline with other render commands.
void SubmitDraw (RefPtr< BufferBase > vertexBuffer, List< RefPtr< BufferBase > > constantBuffers, uint32_t vertexCount, uint32_t startVertexLocation=0)
 Queues a non-indexed draw with its vertex buffer and constant buffers.
void SubmitDrawIndexed (RefPtr< BufferBase > vertexBuffer, RefPtr< BufferBase > indexBuffer, List< RefPtr< BufferBase > > constantBuffers, uint32_t indexCount, uint32_t startIndexLocation=0, int32_t baseVertexLocation=0, bool castsShadow=true)
 Queues an indexed draw with its vertex/index buffers and constant buffers.
void SubmitSetRenderFace (RenderFace face)
void SubmitSetRenderMode (RenderMode mode)
void SubmitUpdateConstantBuffer (RefPtr< BufferBase > buffer, void *Data, uint16_t Size)
 Queues a constant buffer write with data captured at submit time.

Static Public Member Functions

static RenderCommandQueueGetInstance ()
 Lazily creates and returns the process-wide singleton instance.
static void Shutdown ()

Detailed Description

Frame-scoped queue of recorded draw/state commands, replayed into a RenderContext at flush time.

Definition at line 12 of file RenderCommandQueue.hpp.

Member Function Documentation

◆ Clear()

void Sleak::RenderEngine::RenderCommandQueue::Clear ( )

Drops queued commands for the current frame, keeping the cached shadow draw list.

Definition at line 226 of file RenderCommandQueue.cpp.

◆ ClearAll()

void Sleak::RenderEngine::RenderCommandQueue::ClearAll ( )

Drops queued commands and the cached shadow draw list.

Definition at line 231 of file RenderCommandQueue.cpp.

◆ ExecuteCommands()

void Sleak::RenderEngine::RenderCommandQueue::ExecuteCommands ( RenderContext * context)

Definition at line 66 of file RenderCommandQueue.cpp.

◆ ExecuteShadowPass()

void Sleak::RenderEngine::RenderCommandQueue::ExecuteShadowPass ( RenderContext * context)

Definition at line 196 of file RenderCommandQueue.cpp.

◆ GetInstance()

RenderCommandQueue * Sleak::RenderEngine::RenderCommandQueue::GetInstance ( )
inlinestatic

Lazily creates and returns the process-wide singleton instance.

Definition at line 77 of file RenderCommandQueue.hpp.

◆ HasCachedShadowDraws()

bool Sleak::RenderEngine::RenderCommandQueue::HasCachedShadowDraws ( ) const
inline

Definition at line 64 of file RenderCommandQueue.hpp.

◆ OptimizeBatching()

void Sleak::RenderEngine::RenderCommandQueue::OptimizeBatching ( )

Definition at line 221 of file RenderCommandQueue.cpp.

◆ Shutdown()

void Sleak::RenderEngine::RenderCommandQueue::Shutdown ( )
static

Definition at line 240 of file RenderCommandQueue.cpp.

◆ SortCommands()

void Sleak::RenderEngine::RenderCommandQueue::SortCommands ( )

Definition at line 213 of file RenderCommandQueue.cpp.

◆ SubmitBindConstantBuffer()

void Sleak::RenderEngine::RenderCommandQueue::SubmitBindConstantBuffer ( RefPtr< BufferBase > buffer,
uint8_t slot )

Queues a constant buffer bind at the given slot.

Definition at line 34 of file RenderCommandQueue.cpp.

◆ SubmitBindMaterial()

void Sleak::RenderEngine::RenderCommandQueue::SubmitBindMaterial ( ::Sleak::Material * material)

Queues a material bind, switching shader/texture state for subsequent draws.

Definition at line 44 of file RenderCommandQueue.cpp.

◆ SubmitCustomCommand()

void Sleak::RenderEngine::RenderCommandQueue::SubmitCustomCommand ( CustomCommand::ExecuteFunction function)

Queues an arbitrary callback to run inline with other render commands.

Definition at line 59 of file RenderCommandQueue.cpp.

◆ SubmitDraw()

void Sleak::RenderEngine::RenderCommandQueue::SubmitDraw ( RefPtr< BufferBase > vertexBuffer,
List< RefPtr< BufferBase > > constantBuffers,
uint32_t vertexCount,
uint32_t startVertexLocation = 0 )

Queues a non-indexed draw with its vertex buffer and constant buffers.

Definition at line 14 of file RenderCommandQueue.cpp.

◆ SubmitDrawIndexed()

void Sleak::RenderEngine::RenderCommandQueue::SubmitDrawIndexed ( RefPtr< BufferBase > vertexBuffer,
RefPtr< BufferBase > indexBuffer,
List< RefPtr< BufferBase > > constantBuffers,
uint32_t indexCount,
uint32_t startIndexLocation = 0,
int32_t baseVertexLocation = 0,
bool castsShadow = true )

Queues an indexed draw with its vertex/index buffers and constant buffers.

Definition at line 22 of file RenderCommandQueue.cpp.

◆ SubmitSetRenderFace()

void Sleak::RenderEngine::RenderCommandQueue::SubmitSetRenderFace ( RenderFace face)

Definition at line 54 of file RenderCommandQueue.cpp.

◆ SubmitSetRenderMode()

void Sleak::RenderEngine::RenderCommandQueue::SubmitSetRenderMode ( RenderMode mode)

Definition at line 49 of file RenderCommandQueue.cpp.

◆ SubmitUpdateConstantBuffer()

void Sleak::RenderEngine::RenderCommandQueue::SubmitUpdateConstantBuffer ( RefPtr< BufferBase > buffer,
void * Data,
uint16_t Size )

Queues a constant buffer write with data captured at submit time.

Definition at line 39 of file RenderCommandQueue.cpp.