OGRE-Next  3.0.0
Object-Oriented Graphics Rendering Engine
Ogre::CommandBuffer Class Reference

Command Buffer implementation. More...

#include <OgreCommandBuffer.h>

Public Types

typedef void() CommandBufferExecuteFunc(CommandBuffer *_this, const CbBase *RESTRICT_ALIAS cmd)
 

Public Member Functions

 CommandBuffer ()
 
template<typename T >
T * addCommand ()
 Creates/Records a command already casted to the typename. More...
 
void execute ()
 Executes all the commands in the command buffer. Clears the cmd buffer afterwards. More...
 
CbBasegetCommandFromOffset (size_t offset)
 Retrieves the command from the given offset. More...
 
size_t getCommandOffset (CbBase *cmd) const
 Returns the offset of the given command, in case you want to retrieve the command later (addCommand may invalidate the pointer. More...
 
CbBasegetLastCommand ()
 Returns a pointer to the last created command. More...
 
void setCurrentRenderSystem (RenderSystem *renderSystem)
 

Static Public Attributes

static CommandBufferExecuteFunc execute_drawCallIndexed
 
static CommandBufferExecuteFunc execute_drawCallIndexedEmulated
 
static CommandBufferExecuteFunc execute_drawCallIndexedEmulatedNoBaseInstance
 
static CommandBufferExecuteFunc execute_drawCallStrip
 
static CommandBufferExecuteFunc execute_drawCallStripEmulated
 
static CommandBufferExecuteFunc execute_drawCallStripEmulatedNoBaseInstance
 
static CommandBufferExecuteFunc execute_drawV1Indexed
 
static CommandBufferExecuteFunc execute_drawV1IndexedNoBaseInstance
 
static CommandBufferExecuteFunc execute_drawV1Strip
 
static CommandBufferExecuteFunc execute_drawV1StripNoBaseInstance
 
static CommandBufferExecuteFunc execute_invalidCommand
 
static CommandBufferExecuteFunc execute_lowLevelMaterial
 
static CommandBufferExecuteFunc execute_setConstantBufferCS
 
static CommandBufferExecuteFunc execute_setConstantBufferDS
 
static CommandBufferExecuteFunc execute_setConstantBufferGS
 
static CommandBufferExecuteFunc execute_setConstantBufferHS
 
static CommandBufferExecuteFunc execute_setConstantBufferInvalid
 
static CommandBufferExecuteFunc execute_setConstantBufferPS
 
static CommandBufferExecuteFunc execute_setConstantBufferVS
 
static CommandBufferExecuteFunc execute_setIndirectBuffer
 
static CommandBufferExecuteFunc execute_setPso
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferCS
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferDS
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferGS
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferHS
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferInvalid
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferPS
 
static CommandBufferExecuteFunc execute_setReadOnlyBufferVS
 
static CommandBufferExecuteFunc execute_setSamplers
 
static CommandBufferExecuteFunc execute_setTexture
 
static CommandBufferExecuteFunc execute_setTextureBufferCS
 
static CommandBufferExecuteFunc execute_setTextureBufferDS
 
static CommandBufferExecuteFunc execute_setTextureBufferGS
 
static CommandBufferExecuteFunc execute_setTextureBufferHS
 
static CommandBufferExecuteFunc execute_setTextureBufferInvalid
 
static CommandBufferExecuteFunc execute_setTextureBufferPS
 
static CommandBufferExecuteFunc execute_setTextureBufferVS
 
static CommandBufferExecuteFunc execute_setTextures
 
static CommandBufferExecuteFunc execute_setV1RenderOp
 
static CommandBufferExecuteFunc execute_setVao
 
static CommandBufferExecuteFunc execute_startV1LegacyRendering
 

Detailed Description

Command Buffer implementation.

This interface is very sensitive to performance. For this reason:

  1. Each command has a fixed size (
See also
COMMAND_FIXED_SIZE) Whether a command uses all of the bytes is up to them.
  1. The command is stored as a flat contiguous array.
  1. Instead of implementing each command as a virtual function to the base class 'CbBase', we use C-style function pointers and manually maintain the table. This allows nifty optimizations (i.e. a vtable in a 64-bit arch needs 8 bytes!) and storing the commands as POD in the flat array (instead of having an array of pointers, and having to call virtual destructors).

Member Typedef Documentation

◆ CommandBufferExecuteFunc

typedef void() Ogre::CommandBuffer::CommandBufferExecuteFunc(CommandBuffer *_this, const CbBase *RESTRICT_ALIAS cmd)

Constructor & Destructor Documentation

◆ CommandBuffer()

Ogre::CommandBuffer::CommandBuffer ( )

Member Function Documentation

◆ addCommand()

template<typename T >
T* Ogre::CommandBuffer::addCommand ( )
inline

Creates/Records a command already casted to the typename.

May invalidate returned pointers from previous calls.

References Ogre::FastArray< T >::end(), Ogre::MAX_COMMAND_BUFFER, Ogre::FastArray< T >::resize(), and Ogre::FastArray< T >::size().

◆ execute()

void Ogre::CommandBuffer::execute ( )

Executes all the commands in the command buffer. Clears the cmd buffer afterwards.

◆ getCommandFromOffset()

CbBase* Ogre::CommandBuffer::getCommandFromOffset ( size_t  offset)

Retrieves the command from the given offset.

Returns null if no such command at that offset (out of bounds).

See also
getCommandOffset.

◆ getCommandOffset()

size_t Ogre::CommandBuffer::getCommandOffset ( CbBase cmd) const

Returns the offset of the given command, in case you want to retrieve the command later (addCommand may invalidate the pointer.

See also
getCommandFromOffset.

◆ getLastCommand()

CbBase* Ogre::CommandBuffer::getLastCommand ( )

Returns a pointer to the last created command.

◆ setCurrentRenderSystem()

void Ogre::CommandBuffer::setCurrentRenderSystem ( RenderSystem renderSystem)

Member Data Documentation

◆ execute_drawCallIndexed

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallIndexed
static

◆ execute_drawCallIndexedEmulated

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallIndexedEmulated
static

◆ execute_drawCallIndexedEmulatedNoBaseInstance

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallIndexedEmulatedNoBaseInstance
static

◆ execute_drawCallStrip

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallStrip
static

◆ execute_drawCallStripEmulated

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallStripEmulated
static

◆ execute_drawCallStripEmulatedNoBaseInstance

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawCallStripEmulatedNoBaseInstance
static

◆ execute_drawV1Indexed

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawV1Indexed
static

◆ execute_drawV1IndexedNoBaseInstance

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawV1IndexedNoBaseInstance
static

◆ execute_drawV1Strip

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawV1Strip
static

◆ execute_drawV1StripNoBaseInstance

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_drawV1StripNoBaseInstance
static

◆ execute_invalidCommand

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_invalidCommand
static

◆ execute_lowLevelMaterial

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_lowLevelMaterial
static

◆ execute_setConstantBufferCS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferCS
static

◆ execute_setConstantBufferDS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferDS
static

◆ execute_setConstantBufferGS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferGS
static

◆ execute_setConstantBufferHS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferHS
static

◆ execute_setConstantBufferInvalid

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferInvalid
static

◆ execute_setConstantBufferPS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferPS
static

◆ execute_setConstantBufferVS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setConstantBufferVS
static

◆ execute_setIndirectBuffer

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setIndirectBuffer
static

◆ execute_setPso

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setPso
static

◆ execute_setReadOnlyBufferCS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferCS
static

◆ execute_setReadOnlyBufferDS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferDS
static

◆ execute_setReadOnlyBufferGS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferGS
static

◆ execute_setReadOnlyBufferHS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferHS
static

◆ execute_setReadOnlyBufferInvalid

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferInvalid
static

◆ execute_setReadOnlyBufferPS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferPS
static

◆ execute_setReadOnlyBufferVS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setReadOnlyBufferVS
static

◆ execute_setSamplers

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setSamplers
static

◆ execute_setTexture

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTexture
static

◆ execute_setTextureBufferCS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferCS
static

◆ execute_setTextureBufferDS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferDS
static

◆ execute_setTextureBufferGS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferGS
static

◆ execute_setTextureBufferHS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferHS
static

◆ execute_setTextureBufferInvalid

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferInvalid
static

◆ execute_setTextureBufferPS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferPS
static

◆ execute_setTextureBufferVS

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextureBufferVS
static

◆ execute_setTextures

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setTextures
static

◆ execute_setV1RenderOp

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setV1RenderOp
static

◆ execute_setVao

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_setVao
static

◆ execute_startV1LegacyRendering

CommandBufferExecuteFunc Ogre::CommandBuffer::execute_startV1LegacyRendering
static

The documentation for this class was generated from the following file: