1#ifndef _RENDERCOMMANDS_H
2#define _RENDERCOMMANDS_H
11#define RENDER_COMMAND(Type) void Execute(RenderContext* context) override; \
12 CommandType GetType() const override { return CommandType::Type;}
17 namespace RenderEngine {
26 namespace RenderEngine {
68 uint32_t m_ownerObjectID = 0;
69 bool m_castsShadow =
true;
79 uint32_t startVertexLocation = 0
89 uint32_t m_vertexCount;
90 uint32_t m_startVertexLocation;
100 uint32_t startIndexLocation = 0,
101 int32_t baseVertexLocation = 0
112 uint32_t m_indexCount;
113 uint32_t m_startIndexLocation;
114 int32_t m_baseVertexLocation;
122 if (m_heapData) free(m_heapData);
130 return m_heapData ? m_heapData
131 :
const_cast<void*
>(
static_cast<const void*
>(m_inlineData));
138 static constexpr uint16_t INLINE_CAPACITY = 256;
139 alignas(16) uint8_t m_inlineData[INLINE_CAPACITY];
140 void* m_heapData =
nullptr;
#define RENDER_COMMAND(Type)
Implements a dynamic array-like list for storing and managing a collection of elements.
RefPtr< BufferBase > GetBuffer() const
BindConstantBufferCommand(RefPtr< BufferBase > buffer, int slot)
CommandType GetType() const override
void Execute(RenderContext *context) override
Binds the material either through the deferred PBR path or the plain forward path,...
::Sleak::Material * GetMaterial() const
BindMaterialCommand(::Sleak::Material *material)
BindShaderCommand(RefPtr< Shader > shader)
BindTextureCommand(RefPtr< Texture > texture)
Backend-agnostic GPU buffer: vertex, index, constant, or resource view target.
Wraps an arbitrary callback as a queueable render command.
CommandType GetType() const override
std::function< void(RenderContext *)> ExecuteFunction
CustomCommand(ExecuteFunction executeFunction)
void Execute(RenderContext *context) override
Replays this command into the main forward/deferred pass.
void ExecuteShadow(RenderContext *context) override
bool IsSkinned() const override
DrawCommand(RefPtr< BufferBase > vertexBuffer, List< RefPtr< BufferBase > > constantBuffers, uint32_t vertexCount, uint32_t startVertexLocation=0)
DrawIndexedCommand(RefPtr< BufferBase > vertexBuffer, RefPtr< BufferBase > indexBuffer, List< RefPtr< BufferBase > > constantBuffers, uint32_t indexCount, uint32_t startIndexLocation=0, int32_t baseVertexLocation=0)
bool IsSkinned() const override
void ExecuteShadow(RenderContext *context) override
One recorded draw plus the state it needs to replay into a command list.
virtual CommandType GetType() const =0
uint32_t GetOwnerObjectID() const
void SetOwnerObjectID(uint32_t id)
void SetCastsShadow(bool v)
virtual void Execute(RenderContext *context)=0
Replays this command into the main forward/deferred pass.
virtual bool IsSkinned() const
virtual ~RenderCommandBase()=default
virtual void ExecuteShadow(RenderContext *context)
Abstract interface for high-level graphics command execution and resource management.
SetRenderFaceCommand(RenderFace face)
SetRenderModeCommand(RenderMode mode)
void * GetData() const
Returns a pointer to the captured payload, inline or heap-backed.
UpdateConstantBufferCommand(RefPtr< BufferBase > buffer, void *Data, uint16_t Size)
Copies the payload into inline storage, falling back to a heap allocation past INLINE_CAPACITY.
~UpdateConstantBufferCommand() override
CommandType
Discriminator for RenderCommandBase subclasses, used for sorting and batching.
RenderMode
Rasterizer fill style for a draw.
RenderFace
Which triangle winding gets culled.
Root namespace for everything the engine exposes.