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

#include <hgi.h>

+ Inheritance diagram for HgiGL:

Public Member Functions

HGIGL_API HgiGL ()
 
HGIGL_API ~HgiGL () override
 
HGIGL_API HgiGraphicsCmdsUniquePtr CreateGraphicsCmds (HgiGraphicsCmdsDesc const &desc) override
 
HGIGL_API HgiBlitCmdsUniquePtr CreateBlitCmds () override
 
HGIGL_API HgiComputeCmdsUniquePtr CreateComputeCmds () override
 
HGIGL_API HgiTextureHandle CreateTexture (HgiTextureDesc const &desc) override
 
HGIGL_API void DestroyTexture (HgiTextureHandle *texHandle) override
 
HGIGL_API HgiSamplerHandle CreateSampler (HgiSamplerDesc const &desc) override
 
HGIGL_API void DestroySampler (HgiSamplerHandle *smpHandle) override
 
HGIGL_API HgiBufferHandle CreateBuffer (HgiBufferDesc const &desc) override
 
HGIGL_API void DestroyBuffer (HgiBufferHandle *bufHandle) override
 
HGIGL_API HgiShaderFunctionHandle CreateShaderFunction (HgiShaderFunctionDesc const &desc) override
 
HGIGL_API void DestroyShaderFunction (HgiShaderFunctionHandle *shaderFunctionHandle) override
 
HGIGL_API HgiShaderProgramHandle CreateShaderProgram (HgiShaderProgramDesc const &desc) override
 
HGIGL_API void DestroyShaderProgram (HgiShaderProgramHandle *shaderProgramHandle) override
 
HGIGL_API HgiResourceBindingsHandle CreateResourceBindings (HgiResourceBindingsDesc const &desc) override
 
HGIGL_API void DestroyResourceBindings (HgiResourceBindingsHandle *resHandle) override
 
HGIGL_API HgiGraphicsPipelineHandle CreateGraphicsPipeline (HgiGraphicsPipelineDesc const &pipeDesc) override
 
HGIGL_API void DestroyGraphicsPipeline (HgiGraphicsPipelineHandle *pipeHandle) override
 
HGIGL_API HgiComputePipelineHandle CreateComputePipeline (HgiComputePipelineDesc const &pipeDesc) override
 
HGIGL_API void DestroyComputePipeline (HgiComputePipelineHandle *pipeHandle) override
 
HGIGL_API TfToken constGetAPIName () const override
 
HGIGL_API void StartFrame () override
 
HGIGL_API void EndFrame () override
 
HGIGL_API HgiGLDeviceGetPrimaryDevice () const
 Returns the opengl device. More...
 
- Public Member Functions inherited from Hgi
HGI_API Hgi ()
 
virtual HGI_API ~Hgi ()
 
HGI_API void SubmitCmds (HgiCmds *cmds)
 

Protected Member Functions

HGIGL_API bool _SubmitCmds (HgiCmds *cmds) 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 ()
 

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.

Constructor & Destructor Documentation

HGIGL_API HgiGL::HgiGL ( )
HGIGL_API HgiGL::~HgiGL ( )
override

Member Function Documentation

HGIGL_API bool HgiGL::_SubmitCmds ( HgiCmds cmds)
overrideprotectedvirtual

Reimplemented from Hgi.

HGIGL_API HgiBlitCmdsUniquePtr HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 void HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::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 HgiGL::DestroyShaderFunction ( HgiShaderFunctionHandle shaderFunctionHandle)
overridevirtual

Destroy a shader function. Thread safety: Destruction must happen on main thread. See notes above.

Implements Hgi.

HGIGL_API void HgiGL::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 HgiGL::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 HgiGL::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& HgiGL::GetAPIName ( ) const
overridevirtual

Return the name of the api (e.g. "OpenGL"). Thread safety: This call is thread safe.

Implements Hgi.

HGIGL_API HgiGLDevice* HgiGL::GetPrimaryDevice ( ) const

Returns the opengl device.

HGIGL_API void HgiGL::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: