All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiGraphicsEncoder Class Referenceabstract

A graphics API independent abstraction of graphics commands. More...

+ Inheritance diagram for HgiGraphicsEncoder:

Public Member Functions

virtual HGI_API void Commit ()=0
 Finish recording of commands. No further commands can be recorded. More...
 
virtual HGI_API void SetViewport (GfVec4i const &vp)=0
 Set viewport [left, BOTTOM, width, height] - OpenGL coords. More...
 
virtual HGI_API void SetScissor (GfVec4i const &sc)=0
 Only pixels that lie within the scissor box are modified by drawing commands. More...
 
virtual HGI_API void BindPipeline (HgiPipelineHandle pipeline)=0
 Bind a pipeline state object. More...
 
virtual HGI_API void BindResources (HgiResourceBindingsHandle resources)=0
 Bind resources such as textures and uniform buffers. More...
 
virtual HGI_API void BindVertexBuffers (uint32_t firstBinding, HgiBufferHandleVector const &buffers, std::vector< uint32_t > const &byteOffsets)=0
 Binds the vertex buffer(s) that describe the vertex attributes. More...
 
virtual HGI_API void DrawIndexed (HgiBufferHandle const &indexBuffer, uint32_t indexCount, uint32_t indexBufferByteOffset, uint32_t firstIndex, uint32_t vertexOffset, uint32_t instanceCount)=0
 Records a draw command that renders one or more instances of primitives using an indexBuffer starting from the base vertex of the base instance. More...
 
virtual HGI_API void PushDebugGroup (const char *label)=0
 Push a debug marker onto the encoder. More...
 
virtual HGI_API void PopDebugGroup ()=0
 Pop the lastest debug marker off encoder. More...
 

Detailed Description

A graphics API independent abstraction of graphics commands.

HgiGraphicsEncoder is a lightweight object that cannot be re-used after Commit. A new encoder should be acquired from CommandBuffer each frame.

The API provided by this encoder should be agnostic to whether the encoder operates via immediate or deferred command buffers.

Definition at line 48 of file graphicsEncoder.h.

Member Function Documentation

virtual HGI_API void BindPipeline ( HgiPipelineHandle  pipeline)
pure virtual

Bind a pipeline state object.

Usually you call this right after calling CreateGraphicsEncoder to set the graphics pipeline state. The resource bindings used when creating the pipeline must be compatible with the resources bound via BindResources().

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void BindResources ( HgiResourceBindingsHandle  resources)
pure virtual

Bind resources such as textures and uniform buffers.

Usually you call this right after BindPipeline() and the resources bound must be compatible with the bound pipeline.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void BindVertexBuffers ( uint32_t  firstBinding,
HgiBufferHandleVector const &  buffers,
std::vector< uint32_t > const &  byteOffsets 
)
pure virtual

Binds the vertex buffer(s) that describe the vertex attributes.

firstBinding the first index to which buffers are bound (usually 0). byteOffsets offset to where the data of each buffer starts, in bytes. strides the size of a vertex in each of the buffers.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void Commit ( )
pure virtual

Finish recording of commands. No further commands can be recorded.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void DrawIndexed ( HgiBufferHandle const &  indexBuffer,
uint32_t  indexCount,
uint32_t  indexBufferByteOffset,
uint32_t  firstIndex,
uint32_t  vertexOffset,
uint32_t  instanceCount 
)
pure virtual

Records a draw command that renders one or more instances of primitives using an indexBuffer starting from the base vertex of the base instance.

indexCount is the number of vertices. indexBufferByteOffset: Byte offset within indexBuffer to start reading indices from. vertexOffset: the value added to the vertex index before indexing into the vertex buffer (baseVertex). instanceCount: number of instances (min 1) of the primitves to render.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void PopDebugGroup ( )
pure virtual

Pop the lastest debug marker off encoder.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void PushDebugGroup ( const char *  label)
pure virtual

Push a debug marker onto the encoder.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void SetScissor ( GfVec4i const &  sc)
pure virtual

Only pixels that lie within the scissor box are modified by drawing commands.

Implemented in HgiGLGraphicsEncoder.

virtual HGI_API void SetViewport ( GfVec4i const &  vp)
pure virtual

Set viewport [left, BOTTOM, width, height] - OpenGL coords.

Implemented in HgiGLGraphicsEncoder.


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