Axmol Engine 2.4.0-258ceca
|
Store encoded commands for the GPU to execute. More...
#include <CommandBuffer.h>
Inherits Object.
Inherited by CommandBufferGL, and CommandBufferMTL.
Public Member Functions | |
virtual void | setDepthStencilState (DepthStencilState *depthStencilState)=0 |
Set depthStencil status once. | |
virtual void | setRenderPipeline (RenderPipeline *renderPipeline)=0 |
Sets the current render pipeline state object once. | |
![]() | |
void | retain () |
Retains the ownership. | |
void | release () |
Releases the ownership immediately. | |
Object * | autorelease () |
Releases the ownership sometime soon automatically. | |
unsigned int | getReferenceCount () const |
Returns the Object's current reference count. | |
virtual | ~Object () |
Destructor. | |
Setters & Getters | |
virtual bool | beginFrame ()=0 |
Indicate the begining of a frame. | |
virtual void | beginRenderPass (const RenderTarget *renderTarget, const RenderPassDescriptor &descriptor)=0 |
Begin a render pass, initial color, depth and stencil attachment. | |
virtual void | updateDepthStencilState (const DepthStencilDescriptor &descriptor)=0 |
Update depthStencil status, improvment: for metal backend cache it. | |
virtual void | updatePipelineState (const RenderTarget *rt, const PipelineDescriptor &descriptor)=0 |
Update render pipeline status Building a programmable pipeline involves an expensive evaluation of GPU state. | |
virtual void | setViewport (int x, int y, unsigned int w, unsigned int h)=0 |
Fixed-function state. | |
virtual void | setCullMode (CullMode mode)=0 |
Fixed-function state. | |
virtual void | setWinding (Winding winding)=0 |
Fixed-function state. | |
virtual void | setVertexBuffer (Buffer *buffer)=0 |
Set a global buffer for all vertex shaders at the given bind point index 0. | |
virtual void | setProgramState (ProgramState *programState)=0 |
Set unifroms and textures. | |
virtual void | setIndexBuffer (Buffer *buffer)=0 |
Set indexes when drawing primitives with index list @ buffer A buffer object that the device will read indexes from. | |
virtual void | setInstanceBuffer (Buffer *buffer)=0 |
Set matrix tranform when drawing instances of the same model @ buffer A buffer object that the device will read matrices from. | |
virtual void | drawArrays (PrimitiveType primitiveType, std::size_t start, std::size_t count, bool wireframe=false)=0 |
Draw primitives without an index list. | |
virtual void | drawElements (PrimitiveType primitiveType, IndexFormat indexType, std::size_t count, std::size_t offset, bool wireframe=false)=0 |
Draw primitives with an index list. | |
virtual void | drawElementsInstanced (PrimitiveType primitiveType, IndexFormat indexType, std::size_t count, std::size_t offset, int instanceCount, bool wireframe=false)=0 |
Draw primitives with an index list instanced. | |
virtual void | endRenderPass ()=0 |
Do some resources release. | |
virtual void | endFrame ()=0 |
Present a drawable and commit a command buffer so it can be executed as soon as possible. | |
virtual void | setScissorRect (bool isEnabled, float x, float y, float width, float height)=0 |
Fixed-function state. | |
virtual void | readPixels (RenderTarget *rt, std::function< void(const PixelBufferDescriptor &)> callback)=0 |
Get a screen snapshot. | |
void | setStencilReferenceValue (unsigned int value) |
Update both front and back stencil reference value. | |
void | setStencilReferenceValue (unsigned int frontRef, unsigned int backRef) |
Update stencil reference value. | |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
Store encoded commands for the GPU to execute.
A command buffer stores encoded commands until the buffer is committed for execution by the GPU
|
pure virtual |
Set depthStencil status once.
depthStencilState | Specifies the depth and stencil status |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Sets the current render pipeline state object once.
renderPipeline | An object that contains the graphics functions and configuration state used in a render pass. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Begin a render pass, initial color, depth and stencil attachment.
descriptor | Specifies a group of render targets that hold the results of a render pass. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Update depthStencil status, improvment: for metal backend cache it.
depthStencilState | Specifies the depth and stencil status |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Update render pipeline status Building a programmable pipeline involves an expensive evaluation of GPU state.
So a new render pipeline object will be created only if it hasn't been created before.
rt | Specifies the render target. |
pipelineDescriptor | Specifies the pipeline descriptor. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Fixed-function state.
x | The x coordinate of the upper-left corner of the viewport. |
y | The y coordinate of the upper-left corner of the viewport. |
w | The width of the viewport, in pixels. |
h | The height of the viewport, in pixels. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Fixed-function state.
mode | Controls if primitives are culled when front facing, back facing, or not culled at all. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Fixed-function state.
winding | The winding order of front-facing primitives. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Set a global buffer for all vertex shaders at the given bind point index 0.
buffer | The vertex buffer to be setted in the buffer argument table. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Set unifroms and textures.
programState | A programState object that hold the uniform and texture data. |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Set indexes when drawing primitives with index list @ buffer A buffer object that the device will read indexes from.
@ see drawElements(PrimitiveType primitiveType, IndexFormat indexType, unsigned int count, unsigned int offset)
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Draw primitives without an index list.
primitiveType | The type of primitives that elements are assembled into. |
start | For each instance, the first index to draw |
count | For each instance, the number of indexes to draw |
drawElements(PrimitiveType primitiveType, IndexFormat indexType, unsigned int count, unsigned int offset)
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Draw primitives with an index list.
primitiveType | The type of primitives that elements are assembled into. |
indexType | The type if indexes, either 16 bit integer or 32 bit integer. |
count | The number of indexes to read from the index buffer for each instance. |
offset | Byte offset within indexBuffer to start reading indexes from. |
setIndexBuffer(Buffer* buffer)
drawArrays(PrimitiveType primitiveType, unsigned int start, unsigned int count)
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Draw primitives with an index list instanced.
primitiveType | The type of primitives that elements are assembled into. |
indexType | The type if indexes, either 16 bit integer or 32 bit integer. |
count | The number of indexes to read from the index buffer for each instance. |
offset | Byte offset within indexBuffer to start reading indexes from. |
instance | Count of instances to draw at once. |
setIndexBuffer(Buffer* buffer)
drawArrays(PrimitiveType primitiveType, unsigned int start, unsigned int count)
Implemented in CommandBufferGL, CommandBufferGLES2, and CommandBufferMTL.
|
pure virtual |
Fixed-function state.
x,y | Specifies the lower left corner of the scissor box |
wdith | Specifies the width of the scissor box |
height | Specifies the height of the scissor box |
Implemented in CommandBufferGL, and CommandBufferMTL.
|
pure virtual |
Get a screen snapshot.
callback | A callback to deal with screen snapshot image. |
Implemented in CommandBufferGL, and CommandBufferMTL.
void setStencilReferenceValue | ( | unsigned int | value | ) |
Update both front and back stencil reference value.
value | Specifies stencil reference value. |
void setStencilReferenceValue | ( | unsigned int | frontRef, |
unsigned int | backRef ) |
Update stencil reference value.
frontRef | Specifies front stencil reference value. |
backRef | Specifies back stencil reference value. |