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

OpenGL implementation of the Hydra Graphics Interface. More...

+ Inheritance diagram for HgiGL:

Public Member Functions

HGIGL_API HgiGraphicsCmdsUniquePtr CreateGraphicsCmds (HgiGraphicsCmdsDesc const &desc) override
 Returns a GraphicsCmds object (for temporary use) that is ready to record draw commands. More...
 
HGIGL_API HgiBlitCmdsUniquePtr CreateBlitCmds () override
 Returns a BlitCmds object (for temporary use) that is ready to execute resource copy commands. More...
 
HGIGL_API HgiComputeCmdsUniquePtr CreateComputeCmds () override
 Returns a ComputeCmds object (for temporary use) that is ready to record dispatch commands. More...
 
HGIGL_API HgiTextureHandle CreateTexture (HgiTextureDesc const &desc) override
 Create a texture in rendering backend. More...
 
HGIGL_API void DestroyTexture (HgiTextureHandle *texHandle) override
 Destroy a texture in rendering backend. More...
 
HGIGL_API HgiTextureViewHandle CreateTextureView (HgiTextureViewDesc const &desc) override
 Create a texture view in rendering backend. More...
 
HGIGL_API void DestroyTextureView (HgiTextureViewHandle *viewHandle) override
 Destroy a texture view in rendering backend. More...
 
HGIGL_API HgiSamplerHandle CreateSampler (HgiSamplerDesc const &desc) override
 Create a sampler in rendering backend. More...
 
HGIGL_API void DestroySampler (HgiSamplerHandle *smpHandle) override
 Destroy a sampler in rendering backend. More...
 
HGIGL_API HgiBufferHandle CreateBuffer (HgiBufferDesc const &desc) override
 Create a buffer in rendering backend. More...
 
HGIGL_API void DestroyBuffer (HgiBufferHandle *bufHandle) override
 Destroy a buffer in rendering backend. More...
 
HGIGL_API HgiShaderFunctionHandle CreateShaderFunction (HgiShaderFunctionDesc const &desc) override
 Create a new shader function. More...
 
HGIGL_API void DestroyShaderFunction (HgiShaderFunctionHandle *shaderFunctionHandle) override
 Destroy a shader function. More...
 
HGIGL_API HgiShaderProgramHandle CreateShaderProgram (HgiShaderProgramDesc const &desc) override
 Create a new shader program. More...
 
HGIGL_API void DestroyShaderProgram (HgiShaderProgramHandle *shaderProgramHandle) override
 Destroy a shader program. More...
 
HGIGL_API HgiResourceBindingsHandle CreateResourceBindings (HgiResourceBindingsDesc const &desc) override
 Create a new resource binding object. More...
 
HGIGL_API void DestroyResourceBindings (HgiResourceBindingsHandle *resHandle) override
 Destroy a resource binding object. More...
 
HGIGL_API HgiGraphicsPipelineHandle CreateGraphicsPipeline (HgiGraphicsPipelineDesc const &pipeDesc) override
 Create a new graphics pipeline state object. More...
 
HGIGL_API void DestroyGraphicsPipeline (HgiGraphicsPipelineHandle *pipeHandle) override
 Destroy a graphics pipeline state object. More...
 
HGIGL_API HgiComputePipelineHandle CreateComputePipeline (HgiComputePipelineDesc const &pipeDesc) override
 Create a new compute pipeline state object. More...
 
HGIGL_API void DestroyComputePipeline (HgiComputePipelineHandle *pipeHandle) override
 Destroy a compute pipeline state object. More...
 
HGIGL_API TfToken const & GetAPIName () const override
 Return the name of the api (e.g. More...
 
HGIGL_API void StartFrame () override
 Optionally called by client app at the start of a new rendering frame. More...
 
HGIGL_API void EndFrame () override
 Optionally called at the end of a rendering frame. More...
 
HGIGL_API HgiGLDevice * GetPrimaryDevice () const
 Returns the opengl device. More...
 
- Public Member Functions inherited from Hgi
HGI_API void SubmitCmds (HgiCmds *cmds, HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
 Submit one HgiCmds objects. More...
 

Protected Member Functions

HGIGL_API bool _SubmitCmds (HgiCmds *cmds, HgiSubmitWaitType wait) override
 
- Protected Member Functions inherited from Hgi
HGI_API uint64_t GetUniqueId ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Hgi
static HGI_API HgiGetPlatformDefaultHgi ()
 *** DEPRECATED *** Please use: CreatePlatformDefaultHgi More...
 
static HGI_API HgiUniquePtr CreatePlatformDefaultHgi ()
 Helper function to return a Hgi object for the current platform. More...
 

Detailed Description

OpenGL implementation of the Hydra Graphics Interface.

HgiGL expects the GL context to be externally managed. When HgiGL is constructed and during any of its resource create / destroy calls and during command recording operations it expects that the OpenGL context is valid and current.

Definition at line 53 of file hgi.h.

Member Function Documentation

HGIGL_API HgiBlitCmdsUniquePtr CreateBlitCmds ( )
overridevirtual

Returns a BlitCmds object (for temporary use) that is ready to execute resource copy commands.

BlitCmds is a lightweight object that should be re-acquired each frame (don't hold onto it after EndEncoding). Thread safety: Each Hgi backend must ensure that a Cmds object can be created on the main thread, recorded into (exclusively) by one secondary thread and be submitted on the main thread. See notes above.

Implements Hgi.

HGIGL_API HgiBufferHandle CreateBuffer ( HgiBufferDesc const &  desc)
overridevirtual

Create a buffer in rendering backend.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiComputeCmdsUniquePtr CreateComputeCmds ( )
overridevirtual

Returns a ComputeCmds object (for temporary use) that is ready to record dispatch commands.

ComputeCmds is a lightweight object that should be re-acquired each frame (don't hold onto it after EndEncoding). Thread safety: Each Hgi backend must ensure that a Cmds object can be created on the main thread, recorded into (exclusively) by one secondary thread and be submitted on the main thread. See notes above.

Implements Hgi.

HGIGL_API HgiComputePipelineHandle CreateComputePipeline ( HgiComputePipelineDesc const &  pipeDesc)
overridevirtual

Create a new compute pipeline state object.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiGraphicsCmdsUniquePtr CreateGraphicsCmds ( HgiGraphicsCmdsDesc const &  desc)
overridevirtual

Returns a GraphicsCmds object (for temporary use) that is ready to record draw commands.

GraphicsCmds is a lightweight object that should be re-acquired each frame (don't hold onto it after EndEncoding). Thread safety: Each Hgi backend must ensure that a Cmds object can be created on the main thread, recorded into (exclusively) by one secondary thread and be submitted on the main thread. See notes above.

Implements Hgi.

HGIGL_API HgiGraphicsPipelineHandle CreateGraphicsPipeline ( HgiGraphicsPipelineDesc const &  pipeDesc)
overridevirtual

Create a new graphics pipeline state object.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiResourceBindingsHandle CreateResourceBindings ( HgiResourceBindingsDesc const &  desc)
overridevirtual

Create a new resource binding object.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiSamplerHandle CreateSampler ( HgiSamplerDesc const &  desc)
overridevirtual

Create a sampler in rendering backend.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiShaderFunctionHandle CreateShaderFunction ( HgiShaderFunctionDesc const &  desc)
overridevirtual

Create a new shader function.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiShaderProgramHandle CreateShaderProgram ( HgiShaderProgramDesc const &  desc)
overridevirtual

Create a new shader program.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiTextureHandle CreateTexture ( HgiTextureDesc const &  desc)
overridevirtual

Create a texture in rendering backend.

Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API HgiTextureViewHandle CreateTextureView ( HgiTextureViewDesc const &  desc)
overridevirtual

Create a texture view in rendering backend.

A texture view aliases another texture's data. It is the responsibility of the client to ensure that the sourceTexture is not destroyed while the texture view is in use. Thread safety: Creation must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyBuffer ( HgiBufferHandle bufHandle)
overridevirtual

Destroy a buffer in rendering backend.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyComputePipeline ( HgiComputePipelineHandle pipeHandle)
overridevirtual

Destroy a compute pipeline state object.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyGraphicsPipeline ( HgiGraphicsPipelineHandle pipeHandle)
overridevirtual

Destroy a graphics pipeline state object.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyResourceBindings ( HgiResourceBindingsHandle resHandle)
overridevirtual

Destroy a resource binding object.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroySampler ( HgiSamplerHandle smpHandle)
overridevirtual

Destroy a sampler in rendering backend.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyShaderFunction ( HgiShaderFunctionHandle shaderFunctionHandle)
overridevirtual

Destroy a shader function.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyShaderProgram ( HgiShaderProgramHandle shaderProgramHandle)
overridevirtual

Destroy a shader program.

Note that this does NOT automatically destroy the shader functions in the program since shader functions may be used by more than one program. Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyTexture ( HgiTextureHandle *  texHandle)
overridevirtual

Destroy a texture in rendering backend.

Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void DestroyTextureView ( HgiTextureViewHandle viewHandle)
overridevirtual

Destroy a texture view in rendering backend.

This will destroy the view's texture, but not the sourceTexture that was aliased by the view. The sourceTexture data remains unchanged. Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void EndFrame ( )
overridevirtual

Optionally called at the end of a rendering frame.

Please read the comments in StartFrame. Thread safety: Not thread safe. Should be called on the main thread.

Implements Hgi.

HGIGL_API TfToken const& GetAPIName ( ) const
overridevirtual

Return the name of the api (e.g.

"OpenGL"). Thread safety: This call is thread safe.

Implements Hgi.

HGIGL_API HgiGLDevice* GetPrimaryDevice ( ) const

Returns the opengl device.

HGIGL_API void StartFrame ( )
overridevirtual

Optionally called by client app at the start of a new rendering frame.

We can't rely on StartFrame for anything important, because it is up to the external client to (optionally) call this and they may never do. Hydra doesn't have a clearly defined start or end frame. This can be helpful to insert GPU frame debug markers. Thread safety: Not thread safe. Should be called on the main thread.

Implements Hgi.


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