HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HgiGLGraphicsCmds Class Referencefinal

#include <graphicsCmds.h>

+ Inheritance diagram for HgiGLGraphicsCmds:

Public Member Functions

HGIGL_API ~HgiGLGraphicsCmds () override
 
HGIGL_API void InsertFunctionOp (std::function< void(void)> const &fn)
 
HGIGL_API void PushDebugGroup (const char *label) override
 Push a debug marker. More...
 
HGIGL_API void PopDebugGroup () override
 Pop the last debug marker. More...
 
HGIGL_API void SetViewport (GfVec4i const &vp) override
 Set viewport [left, BOTTOM, width, height] - OpenGL coords. More...
 
HGIGL_API void SetScissor (GfVec4i const &sc) override
 
HGIGL_API void BindPipeline (HgiGraphicsPipelineHandle pipeline) override
 
HGIGL_API void BindResources (HgiResourceBindingsHandle resources) override
 
HGIGL_API void SetConstantValues (HgiGraphicsPipelineHandle pipeline, HgiShaderStage stages, uint32_t bindIndex, uint32_t byteSize, const void *data) override
 
HGIGL_API void BindVertexBuffers (HgiVertexBufferBindingVector const &bindings) override
 Binds the vertex buffer(s) that describe the vertex attributes. More...
 
HGIGL_API void Draw (uint32_t vertexCount, uint32_t baseVertex, uint32_t instanceCount, uint32_t baseInstance) override
 
HGIGL_API void DrawIndirect (HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride) override
 
HGIGL_API void DrawIndexed (HgiBufferHandle const &indexBuffer, uint32_t indexCount, uint32_t indexBufferByteOffset, uint32_t baseVertex, uint32_t instanceCount, uint32_t baseInstance) override
 
HGIGL_API void DrawIndexedIndirect (HgiBufferHandle const &indexBuffer, HgiBufferHandle const &drawParameterBuffer, uint32_t drawBufferByteOffset, uint32_t drawCount, uint32_t stride, std::vector< uint32_t > const &drawParameterBufferUInt32, uint32_t patchBaseVertexByteOffset) override
 
HGIGL_API void InsertMemoryBarrier (HgiMemoryBarrier barrier) override
 
- Public Member Functions inherited from HgiGraphicsCmds
HGI_API ~HgiGraphicsCmds () override
 
- Public Member Functions inherited from HgiCmds
virtual HGI_API ~HgiCmds ()
 
HGI_API bool IsSubmitted () const
 Returns true if the HgiCmds object has been submitted to GPU. More...
 

Protected Member Functions

HGIGL_API HgiGLGraphicsCmds (HgiGLDevice *device, HgiGraphicsCmdsDesc const &desc)
 
HGIGL_API bool _Submit (Hgi *hgi, HgiSubmitWaitType wait) override
 
- Protected Member Functions inherited from HgiGraphicsCmds
HGI_API HgiGraphicsCmds ()
 
- Protected Member Functions inherited from HgiCmds
HGI_API HgiCmds ()
 
HGI_API void _SetSubmitted ()
 

Friends

class HgiGL
 

Detailed Description

OpenGL implementation of HgiGraphicsCmds.

Definition at line 43 of file graphicsCmds.h.

Constructor & Destructor Documentation

HGIGL_API HgiGLGraphicsCmds::~HgiGLGraphicsCmds ( )
override
HGIGL_API HgiGLGraphicsCmds::HgiGLGraphicsCmds ( HgiGLDevice device,
HgiGraphicsCmdsDesc const &  desc 
)
protected

Member Function Documentation

HGIGL_API bool HgiGLGraphicsCmds::_Submit ( Hgi hgi,
HgiSubmitWaitType  wait 
)
overrideprotectedvirtual

Reimplemented from HgiCmds.

HGIGL_API void HgiGLGraphicsCmds::BindPipeline ( HgiGraphicsPipelineHandle  pipeline)
overridevirtual

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

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::BindResources ( HgiResourceBindingsHandle  resources)
overridevirtual

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.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::BindVertexBuffers ( HgiVertexBufferBindingVector const &  bindings)
overridevirtual

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

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::Draw ( uint32_t  vertexCount,
uint32_t  baseVertex,
uint32_t  instanceCount,
uint32_t  baseInstance 
)
overridevirtual

Records a draw command that renders one or more instances of primitives using the number of vertices provided. The 'primitive type' (eg. Lines, Triangles, etc) can be acquired from the bound HgiPipeline. vertexCount: The number of vertices to draw. baseVertex: The index of the first vertex to draw. instanceCount: Number of instances to draw. baseInstance: The first instance to draw.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::DrawIndexed ( HgiBufferHandle const &  indexBuffer,
uint32_t  indexCount,
uint32_t  indexBufferByteOffset,
uint32_t  baseVertex,
uint32_t  instanceCount,
uint32_t  baseInstance 
)
overridevirtual

Records a draw command that renders one or more instances of primitives using an indexBuffer starting from the base vertex. The 'primitive type' (eg. Lines, Triangles, etc) can be acquired from the bound HgiPipeline. indexCount: The number of indices in the index buffer (num vertices). indexBufferByteOffset: Byte offset within index buffer to start reading the indices from. baseVertex: The value added to the vertex index before indexing into the vertex buffer (baseVertex). instanceCount: Number of instances to draw. baseInstance: The first instance to draw.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::DrawIndexedIndirect ( HgiBufferHandle const &  indexBuffer,
HgiBufferHandle const &  drawParameterBuffer,
uint32_t  drawBufferByteOffset,
uint32_t  drawCount,
uint32_t  stride,
std::vector< uint32_t > const &  drawParameterBufferUInt32,
uint32_t  patchBaseVertexByteOffset 
)
overridevirtual

Records a indexed multi-draw command that reads the draw parameters from a provided drawParameterBuffer, and indices from indexBuffer. The 'primitive type' (eg. Lines, Triangles, etc) can be acquired from the bound HgiPipeline. drawParameterBuffer: an array of structures (Metal has a different encoding of indirect commands for tessellated patches): drawBufferByteOffset: Byte offset where the draw parameters begin. drawCount: The number of draws to execute. stride: byte stride between successive sets of draw parameters. drawParameterBufferUInt32: CPU addressable drawParameterBuffer which contains the baseVertex offset needed for each patch draw for Metal. patchBaseVertexByteOffset: Byte offset to the uint32_t value in drawParameterBufferUint32 which is the baseVertex value which must be applied to each HgiVertexBufferPerPatchControlPoint vertex buffer for each patch draw for Metal.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::DrawIndirect ( HgiBufferHandle const &  drawParameterBuffer,
uint32_t  drawBufferByteOffset,
uint32_t  drawCount,
uint32_t  stride 
)
overridevirtual

Records a multi-draw command that reads the draw parameters from a provided drawParameterBuffer. The 'primitive type' (eg. Lines, Triangles, etc) can be acquired from the bound HgiPipeline. drawParameterBuffer: an array of structures: drawBufferByteOffset: Byte offset where the draw parameters begin. drawCount: The number of draws to execute. stride: byte stride between successive sets of draw parameters.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::InsertFunctionOp ( std::function< void(void)> const &  fn)

XXX This function is exposed temporarily for Hgi transition. It allows code that is not yet converted to Hgi (e.g. HdSt) to insert its opengl calls into the ops-stack of HgiGL to ensure that all commands execute in the correct order. Once HdSt has transition fully to Hgi we should remove this function.

HGIGL_API void HgiGLGraphicsCmds::InsertMemoryBarrier ( HgiMemoryBarrier  barrier)
overridevirtual

Inserts a barrier so that data written to memory by commands before the barrier is available to commands after the barrier.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::PopDebugGroup ( )
overridevirtual

Pop the last debug marker.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::PushDebugGroup ( const char *  label)
overridevirtual

Push a debug marker.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::SetConstantValues ( HgiGraphicsPipelineHandle  pipeline,
HgiShaderStage  stages,
uint32_t  bindIndex,
uint32_t  byteSize,
const void data 
)
overridevirtual

Set Push / Function constants. pipeline is the pipeline that you are binding before the draw call. It contains the program used for the uniform buffer stages describes for what shader stage you are setting the push constant values for. Each stage can have its own (or none) binding and they must match what is described in the shader functions. bindIndex is the binding point index in the pipeline's shader to bind the data to. byteSize is the size of the data you are updating. data is the data you are copying into the push constants block.

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::SetScissor ( GfVec4i const &  sc)
overridevirtual

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

Implements HgiGraphicsCmds.

HGIGL_API void HgiGLGraphicsCmds::SetViewport ( GfVec4i const &  vp)
overridevirtual

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

Implements HgiGraphicsCmds.

Friends And Related Function Documentation

friend class HgiGL
friend

Definition at line 124 of file graphicsCmds.h.


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