SleakEngine 0.1.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 RenderCommandQueue * GetInstance ()
 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 17 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 230 of file RenderCommandQueue.cpp.

◆ ClearAll()

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

Drops queued commands and the cached shadow draw list.

Definition at line 232 of file RenderCommandQueue.cpp.

◆ ExecuteCommands()

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

Definition at line 64 of file RenderCommandQueue.cpp.

◆ ExecuteShadowPass()

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

Definition at line 201 of file RenderCommandQueue.cpp.

◆ GetInstance()

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

Lazily creates and returns the process-wide singleton instance.

Definition at line 82 of file RenderCommandQueue.hpp.

◆ HasCachedShadowDraws()

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

Definition at line 69 of file RenderCommandQueue.hpp.

◆ OptimizeBatching()

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

Definition at line 225 of file RenderCommandQueue.cpp.

◆ Shutdown()

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

Definition at line 276 of file RenderCommandQueue.cpp.

◆ SortCommands()

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

Definition at line 217 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 38 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 48 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 60 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 17 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 26 of file RenderCommandQueue.cpp.

◆ SubmitSetRenderFace()

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

Definition at line 56 of file RenderCommandQueue.cpp.

◆ SubmitSetRenderMode()

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

Definition at line 52 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 43 of file RenderCommandQueue.cpp.