Loading...
Searching...
No Matches
HgiGLComputeCmds Class Referencefinal

OpenGL implementation of HgiComputeCmds. More...

#include <computeCmds.h>

+ Inheritance diagram for HgiGLComputeCmds:

Public Member Functions

HGIGL_API void PushDebugGroup (const char *label, const GfVec4f &color=s_computeDebugColor) override
 Push a debug scope.
 
HGIGL_API void PopDebugGroup () override
 Pop the last debug scope.
 
HGIGL_API void InsertDebugMarker (const char *label, const GfVec4f &color=s_markerDebugColor) override
 Insert a debug marker.
 
HGIGL_API void BindPipeline (HgiComputePipelineHandle pipeline) override
 Bind a pipeline state object.
 
HGIGL_API void BindResources (HgiResourceBindingsHandle resources) override
 Bind resources such as textures and uniform buffers.
 
HGIGL_API void SetConstantValues (HgiComputePipelineHandle pipeline, uint32_t bindIndex, uint32_t byteSize, const void *data) override
 Set Push / Function constants.
 
HGIGL_API void Dispatch (int dimX, int dimY) override
 Execute a compute shader with provided thread group count in each dimension.
 
HGIGL_API void InsertMemoryBarrier (HgiMemoryBarrier barrier) override
 Inserts a barrier so that data written to memory by commands before the barrier is available to commands after the barrier.
 
HGIGL_API HgiComputeDispatch GetDispatchMethod () const override
 Returns the dispatch method for this encoder.
 
virtual HGI_API void PushDebugGroup (const char *label, const GfVec4f &color=s_computeDebugColor)=0
 Push a debug scope.
 
virtual HGI_API void PopDebugGroup ()=0
 Pop the last debug scope.
 
virtual HGI_API void InsertDebugMarker (const char *label, const GfVec4f &color=s_markerDebugColor)=0
 Insert a debug marker.
 
virtual HGI_API void BindPipeline (HgiComputePipelineHandle pipeline)=0
 Bind a pipeline state object.
 
virtual HGI_API void BindResources (HgiResourceBindingsHandle resources)=0
 Bind resources such as textures and uniform buffers.
 
virtual HGI_API void SetConstantValues (HgiComputePipelineHandle pipeline, uint32_t bindIndex, uint32_t byteSize, const void *data)=0
 Set Push / Function constants.
 
virtual HGI_API void Dispatch (int dimX, int dimY)=0
 Execute a compute shader with provided thread group count in each dimension.
 
virtual HGI_API void InsertMemoryBarrier (HgiMemoryBarrier barrier)=0
 Inserts a barrier so that data written to memory by commands before the barrier is available to commands after the barrier.
 
virtual HGI_API HgiComputeDispatch GetDispatchMethod () const =0
 Returns the dispatch method for this encoder.
 
- Public Member Functions inherited from HgiCmds
HGI_API bool IsSubmitted () const
 Returns true if the HgiCmds object has been submitted to GPU.
 

Protected Member Functions

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

Friends

class HgiGL
 

Additional Inherited Members

- Static Protected Attributes inherited from HgiCmds
static constexpr GfVec4f s_computeDebugColor = { 0.855, 0.161, 0.11, 1.0 }
 
static constexpr GfVec4f s_graphicsDebugColor = { 0, 0.639, 0.878, 1.0 }
 
static constexpr GfVec4f s_blitDebugColor = { 0.99607843137, 0.87450980392, 0.0, 1.0 }
 
static constexpr GfVec4f s_markerDebugColor = { 0.0, 0.0, 0.0, 0.0 }
 

Detailed Description

OpenGL implementation of HgiComputeCmds.

Definition at line 25 of file computeCmds.h.

Member Function Documentation

◆ _Submit()

HGIGL_API bool _Submit ( Hgi hgi,
HgiSubmitWaitType  wait 
)
overrideprotectedvirtual

Reimplemented from HgiCmds.

◆ BindPipeline()

HGIGL_API void BindPipeline ( HgiComputePipelineHandle  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 HgiComputeCmds.

◆ BindResources()

HGIGL_API void 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 HgiComputeCmds.

◆ Dispatch()

HGIGL_API void Dispatch ( int  dimX,
int  dimY 
)
overridevirtual

Execute a compute shader with provided thread group count in each dimension.

Implements HgiComputeCmds.

◆ GetDispatchMethod()

HGIGL_API HgiComputeDispatch GetDispatchMethod ( ) const
overridevirtual

Returns the dispatch method for this encoder.

Implements HgiComputeCmds.

◆ InsertDebugMarker()

HGIGL_API void InsertDebugMarker ( const char *  label,
const GfVec4f color = s_markerDebugColor 
)
overridevirtual

Insert a debug marker.

Implements HgiComputeCmds.

◆ InsertMemoryBarrier()

HGIGL_API void 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 HgiComputeCmds.

◆ PopDebugGroup()

HGIGL_API void PopDebugGroup ( )
overridevirtual

Pop the last debug scope.

Implements HgiComputeCmds.

◆ PushDebugGroup()

HGIGL_API void PushDebugGroup ( const char *  label,
const GfVec4f color = s_computeDebugColor 
)
overridevirtual

Push a debug scope.

Implements HgiComputeCmds.

◆ SetConstantValues()

HGIGL_API void SetConstantValues ( HgiComputePipelineHandle  pipeline,
uint32_t  bindIndex,
uint32_t  byteSize,
const void *  data 
)
overridevirtual

Set Push / Function constants.

pipeline is the compute pipeline that you are binding before the draw call. It contains the program used for the uniform buffer constant values for. 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 HgiComputeCmds.

Friends And Related Function Documentation

◆ HgiGL

friend class HgiGL
friend

Definition at line 66 of file computeCmds.h.


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