24#ifndef PXR_IMAGING_HGI_GL_HGI_H
25#define PXR_IMAGING_HGI_GL_HGI_H
28#include "pxr/imaging/hgiGL/api.h"
29#include "pxr/imaging/hgiGL/capabilities.h"
30#include "pxr/imaging/hgiGL/garbageCollector.h"
31#include "pxr/imaging/hgi/hgi.h"
32#include "pxr/imaging/hgi/tokens.h"
38PXR_NAMESPACE_OPEN_SCOPE
42using HgiGLOpsFn = std::function<void(
void)>;
43using HgiGLOpsVector = std::vector<HgiGLOpsFn>;
206 bool _SubmitCmds(
HgiCmds* cmds, HgiSubmitWaitType wait)
override;
223 std::unique_ptr<HgiGLCapabilities> _capabilities;
233#define HGIGL_API_VERSION 2
235PXR_NAMESPACE_CLOSE_SCOPE
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
Reports the capabilities of the HgiGL device.
OpenGL implementation of GPU device.
Handles garbage collection of opengl objects by delaying their destruction until those objects are no...
OpenGL implementation of the Hydra Graphics Interface.
HGIGL_API HgiGraphicsCmdsUniquePtr CreateGraphicsCmds(HgiGraphicsCmdsDesc const &desc) override
Returns a GraphicsCmds object (for temporary use) that is ready to record draw commands.
HGIGL_API void DestroyContextArena(HgiGLContextArenaHandle *arenaHandle)
Destroy a context arena.
HGIGL_API void StartFrame() override
Optionally called by client app at the start of a new rendering frame.
HGIGL_API bool IsBackendSupported() const override
HGIGL_API void SetContextArena(HgiGLContextArenaHandle const &arenaHandle)
Set the context arena to manage container resources (currently limited to framebuffer objects) for gr...
HGIGL_API HgiBufferHandle CreateBuffer(HgiBufferDesc const &desc) override
Create a buffer in rendering backend.
HGIGL_API void DestroyTexture(HgiTextureHandle *texHandle) override
Destroy a texture in rendering backend.
HGIGL_API void DestroyTextureView(HgiTextureViewHandle *viewHandle) override
Destroy a texture view in rendering backend.
HGIGL_API HgiGLDevice * GetPrimaryDevice() const
HGIGL_API HgiTextureViewHandle CreateTextureView(HgiTextureViewDesc const &desc) override
Create a texture view in rendering backend.
HGIGL_API void DestroyShaderFunction(HgiShaderFunctionHandle *shaderFunctionHandle) override
Destroy a shader function.
HGIGL_API HgiBlitCmdsUniquePtr CreateBlitCmds() override
Returns a BlitCmds object (for temporary use) that is ready to execute resource copy commands.
HGIGL_API HgiShaderProgramHandle CreateShaderProgram(HgiShaderProgramDesc const &desc) override
Create a new shader program.
HGIGL_API HgiShaderFunctionHandle CreateShaderFunction(HgiShaderFunctionDesc const &desc) override
Create a new shader function.
HGIGL_API HgiSamplerHandle CreateSampler(HgiSamplerDesc const &desc) override
Create a sampler in rendering backend.
HGIGL_API void DestroyResourceBindings(HgiResourceBindingsHandle *resHandle) override
Destroy a resource binding object.
HGIGL_API HgiComputeCmdsUniquePtr CreateComputeCmds(HgiComputeCmdsDesc const &desc) override
Returns a ComputeCmds object (for temporary use) that is ready to record dispatch commands.
HGIGL_API void DestroyShaderProgram(HgiShaderProgramHandle *shaderProgramHandle) override
Destroy a shader program.
HGIGL_API HgiGLCapabilities const * GetCapabilities() const override
Returns the device-specific capabilities structure.
HGIGL_API HgiResourceBindingsHandle CreateResourceBindings(HgiResourceBindingsDesc const &desc) override
Create a new resource binding object.
HGIGL_API HgiGLContextArenaHandle CreateContextArena()
HGIGL_API void DestroyGraphicsPipeline(HgiGraphicsPipelineHandle *pipeHandle) override
Destroy a graphics pipeline state object.
HGIGL_API void DestroyBuffer(HgiBufferHandle *bufHandle) override
Destroy a buffer in rendering backend.
HGIGL_API void EndFrame() override
Optionally called at the end of a rendering frame.
HGIGL_API HgiComputePipelineHandle CreateComputePipeline(HgiComputePipelineDesc const &pipeDesc) override
Create a new compute pipeline state object.
HGIGL_API HgiGraphicsPipelineHandle CreateGraphicsPipeline(HgiGraphicsPipelineDesc const &pipeDesc) override
Create a new graphics pipeline state object.
HGIGL_API HgiIndirectCommandEncoder * GetIndirectCommandEncoder() const override
Returns the device-specific indirect command buffer encoder or nullptr if not supported.
HGIGL_API void DestroySampler(HgiSamplerHandle *smpHandle) override
Destroy a sampler in rendering backend.
HGIGL_API void DestroyComputePipeline(HgiComputePipelineHandle *pipeHandle) override
Destroy a compute pipeline state object.
HGIGL_API TfToken const & GetAPIName() const override
Return the name of the api (e.g.
HGIGL_API HgiTextureHandle CreateTexture(HgiTextureDesc const &desc) override
Create a texture in rendering backend.
Handle that contains a hgi object and unique id.
Hydra Graphics Interface.
The indirect command encoder is used to record the drawing primitives for a batch and capture the res...
Token for efficient comparison, assignment, and hashing of known strings.
Describes the properties needed to create a GPU buffer.
Describes the properties to construct a HgiComputeCmds.
Describes the properties needed to create a GPU compute pipeline.
Describes the properties to begin a HgiGraphicsCmds.
Describes the properties needed to create a GPU pipeline.
Describes a set of resources that are bound to the GPU during encoding.
Describes the properties needed to create a GPU sampler.
Describes the properties needed to create a GPU shader function.
Describes the properties needed to create a GPU shader program.
Describes the properties needed to create a GPU texture.
Describes the properties needed to create a GPU texture view from an existing GPU texture object.