CommandBuffer

Inherited: None

Description

The CommandBuffer class represents a command buffer used in a graphics rendering pipeline. It provides methods for issuing rendering commands, setting global parameters, and managing textures.

Public Methods

void

beginDebugMarker (const TString & name)

void

disableScissor ()

void

dispatchCompute (ComputeInstance & shader, int32_t groupsX, int32_t groupsY, int32_t groupsZ)

void

drawMesh (Mesh * mesh, uint32_t sub, uint32_t layer, MaterialInstance & instance)

void

enableScissor (int32_t x, int32_t y, int32_t width, int32_t height)

void

endDebugMarker ()

void

setCameraProperties (Camera * camera)

void

setGlobalTexture (const TString & name, Texture * texture)

void

setRenderTarget (RenderTarget * target, uint32_t level = 0)

void

setViewProjection (const Matrix4 & view, const Matrix4 & projection)

void

setViewport (int32_t x, int32_t y, int32_t width, int32_t height)

Texture *

texture (const TString & name) const

Static Methods

Vector4

idToColor (uint32_t id)

bool

isInited ()

Methods Description

void CommandBuffer::beginDebugMarker (TString & name)

Begins a debug marker with the specified name.


void CommandBuffer::disableScissor ()

Disables scissor testing.


void CommandBuffer::dispatchCompute (ComputeInstance & shader, int32_t groupsX, int32_t groupsY, int32_t groupsZ)

Dispatches a compute shader with the specified workgroup dimensions. Parameters groupsX, groupsY and groupsZ alows to specify a size of workgroup in each demension.


void CommandBuffer::drawMesh (Mesh * mesh, uint32_t sub, uint32_t layer, MaterialInstance & instance)

Draws a mesh with the specified sub mesh index with assigned material instance, and rendering layer.


void CommandBuffer::enableScissor (int32_t x, int32_t y, int32_t width, int32_t height)

Enables scissor testing with the specified parameters. Parameters x and y represents scissor coordinates. width and height scissor dimensions.


void CommandBuffer::endDebugMarker ()

Ends the current debug marker.


Vector4 CommandBuffer::idToColor (uint32_t id)

Converts a 32-bit id to a Vector4 color.


bool CommandBuffer::isInited ()

Returns true if the CommandBuffer is initialized; otherwise, false.


void CommandBuffer::setCameraProperties (Camera * camera)

Sets the camera specific global variables. This function sets up view, projection and clipping planes global shader variables.


void CommandBuffer::setGlobalTexture (TString & name, Texture * texture)

Sets a global texture based on its name.


void CommandBuffer::setRenderTarget (RenderTarget * target, uint32_t level = 0)

Sets the render target for subsequent rendering commands. Parameter level specifies the Mipmap level.


void CommandBuffer::setViewProjection (Matrix4 & view, Matrix4 & projection)

Sets the view and projection matrices.


void CommandBuffer::setViewport (int32_t x, int32_t y, int32_t width, int32_t height)

Sets the viewport dimensions. Parameters x and y represents viewport coordinates. width and height viewport dimensions.


Texture * CommandBuffer::texture (TString & name) const

Retrieves a global texture based on its name.