24 #ifndef PXR_IMAGING_HGI_HGI_H 25 #define PXR_IMAGING_HGI_HGI_H 29 #include "pxr/base/tf/type.h" 31 #include "pxr/imaging/hgi/api.h" 32 #include "pxr/imaging/hgi/blitCmds.h" 33 #include "pxr/imaging/hgi/buffer.h" 34 #include "pxr/imaging/hgi/computeCmds.h" 35 #include "pxr/imaging/hgi/computeCmdsDesc.h" 36 #include "pxr/imaging/hgi/graphicsCmds.h" 37 #include "pxr/imaging/hgi/graphicsCmdsDesc.h" 38 #include "pxr/imaging/hgi/graphicsPipeline.h" 39 #include "pxr/imaging/hgi/resourceBindings.h" 40 #include "pxr/imaging/hgi/sampler.h" 41 #include "pxr/imaging/hgi/shaderFunction.h" 42 #include "pxr/imaging/hgi/shaderProgram.h" 43 #include "pxr/imaging/hgi/texture.h" 44 #include "pxr/imaging/hgi/types.h" 49 PXR_NAMESPACE_OPEN_SCOPE
54 using HgiUniquePtr = std::unique_ptr<class Hgi>;
130 HgiSubmitWaitType wait = HgiSubmitWaitTypeNoWait);
326 uint64_t GetUniqueId();
332 virtual bool _SubmitCmds(
333 HgiCmds* cmds, HgiSubmitWaitType wait);
336 Hgi & operator=(
const Hgi&) =
delete;
339 std::atomic<uint64_t> _uniqueIdCounter;
348 virtual Hgi* New()
const = 0;
360 PXR_NAMESPACE_CLOSE_SCOPE
virtual HGI_API void DestroyBuffer(HgiBufferHandle *bufHandle)=0
Destroy a buffer in rendering backend.
virtual HGI_API void EndFrame()=0
Optionally called at the end of a rendering frame.
virtual HGI_API HgiComputePipelineHandle CreateComputePipeline(HgiComputePipelineDesc const &pipeDesc)=0
Create a new compute pipeline state object.
virtual HGI_API void DestroyShaderFunction(HgiShaderFunctionHandle *shaderFunctionHandle)=0
Destroy a shader function.
virtual HGI_API HgiShaderFunctionHandle CreateShaderFunction(HgiShaderFunctionDesc const &desc)=0
Create a new shader function.
virtual HGI_API void DestroyComputePipeline(HgiComputePipelineHandle *pipeHandle)=0
Destroy a compute pipeline state object.
Describes the properties needed to create a GPU texture view from an existing GPU texture object.
virtual HGI_API HgiTextureViewHandle CreateTextureView(HgiTextureViewDesc const &desc)=0
Create a texture view in rendering backend.
The indirect command encoder is used to record the drawing primitives for a batch and capture the res...
virtual HGI_API HgiGraphicsCmdsUniquePtr CreateGraphicsCmds(HgiGraphicsCmdsDesc const &desc)=0
Returns a GraphicsCmds object (for temporary use) that is ready to record draw commands.
HGI_API void SubmitCmds(HgiCmds *cmds, HgiSubmitWaitType wait=HgiSubmitWaitTypeNoWait)
Submit one HgiCmds objects.
Describes the properties needed to create a GPU sampler.
Describes the properties needed to create a GPU texture.
Base class of all factory types.
Token for efficient comparison, assignment, and hashing of known strings.
virtual HGI_API void DestroyResourceBindings(HgiResourceBindingsHandle *resHandle)=0
Destroy a resource binding object.
virtual HGI_API HgiGraphicsPipelineHandle CreateGraphicsPipeline(HgiGraphicsPipelineDesc const &pipeDesc)=0
Create a new graphics pipeline state object.
Reports the capabilities of the Hgi device.
Describes the properties needed to create a GPU compute pipeline.
virtual HGI_API HgiTextureHandle CreateTexture(HgiTextureDesc const &desc)=0
Create a texture in rendering backend.
Describes the properties needed to create a GPU buffer.
Describes the properties to begin a HgiGraphicsCmds.
virtual HGI_API bool IsBackendSupported() const =0
Determine if Hgi instance can run on current hardware.
Hgi factory for plugin system.
virtual HGI_API void DestroyTextureView(HgiTextureViewHandle *viewHandle)=0
Destroy a texture view in rendering backend.
Describes the properties needed to create a GPU shader program.
static HGI_API bool IsSupported()
Constructs a temporary Hgi object for the current platform and calls the object's IsBackendSupported(...
Describes a set of resources that are bound to the GPU during encoding.
Hydra Graphics Interface.
virtual HGI_API void DestroyTexture(HgiTextureHandle *texHandle)=0
Destroy a texture in rendering backend.
static HGI_API HgiUniquePtr CreatePlatformDefaultHgi()
Helper function to return a Hgi object for the current platform.
virtual HGI_API HgiShaderProgramHandle CreateShaderProgram(HgiShaderProgramDesc const &desc)=0
Create a new shader program.
static HGI_API Hgi * GetPlatformDefaultHgi()
*** DEPRECATED *** Please use: CreatePlatformDefaultHgi
virtual HGI_API HgiIndirectCommandEncoder * GetIndirectCommandEncoder() const =0
Returns the device-specific indirect command buffer encoder or nullptr if not supported.
Describes the properties needed to create a GPU shader function.
virtual HGI_API HgiSamplerHandle CreateSampler(HgiSamplerDesc const &desc)=0
Create a sampler in rendering backend.
Describes the properties to construct a HgiComputeCmds.
virtual HGI_API HgiCapabilities const * GetCapabilities() const =0
Returns the device-specific capabilities structure.
virtual HGI_API void DestroySampler(HgiSamplerHandle *smpHandle)=0
Destroy a sampler in rendering backend.
virtual HGI_API void StartFrame()=0
Optionally called by client app at the start of a new rendering frame.
virtual HGI_API HgiComputeCmdsUniquePtr CreateComputeCmds(HgiComputeCmdsDesc const &desc)=0
Returns a ComputeCmds object (for temporary use) that is ready to record dispatch commands.
Describes the properties needed to create a GPU pipeline.
virtual HGI_API HgiBufferHandle CreateBuffer(HgiBufferDesc const &desc)=0
Create a buffer in rendering backend.
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
virtual HGI_API void DestroyShaderProgram(HgiShaderProgramHandle *shaderProgramHandle)=0
Destroy a shader program.
Handle that contains a hgi object and unique id.
virtual HGI_API HgiBlitCmdsUniquePtr CreateBlitCmds()=0
Returns a BlitCmds object (for temporary use) that is ready to execute resource copy commands.
virtual HGI_API HgiResourceBindingsHandle CreateResourceBindings(HgiResourceBindingsDesc const &desc)=0
Create a new resource binding object.
virtual HGI_API TfToken const & GetAPIName() const =0
Return the name of the api (e.g.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
virtual HGI_API void DestroyGraphicsPipeline(HgiGraphicsPipelineHandle *pipeHandle)=0
Destroy a graphics pipeline state object.