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

A resource that represents the persistent GPU resources of an ExtComputation. More...

Public Member Functions

 HdStExtCompGpuComputationResource (HdBufferSpecVector const &outputBufferSpecs, HdStComputeShaderSharedPtr const &kernel, HdBufferArrayRangeSharedPtrVector const &inputs, HdStResourceRegistrySharedPtr const &registry)
 Creates a GPU computation resource that can bind resources matching the layout of the compute kernel. More...
 
HdBufferArrayRangeSharedPtrVector
const & 
GetInputs () const
 Gets the HdBufferArrayRange that inputs should be loaded into using the resource binder. More...
 
HdStGLSLProgramSharedPtr const & GetProgram () const
 Gets the GPU HdStGLSLProgram to run to execute the computation. More...
 
HdSt_ResourceBinder const & GetResourceBinder () const
 Gets the resource binder that matches the layout of the compute program. More...
 
HDST_API bool Resolve ()
 Resolve the resource bindings and program for use by a computation. More...
 

Detailed Description

A resource that represents the persistent GPU resources of an ExtComputation.

The persistent resources are shared between the ephemeral HdStExtCompGpuComputationBufferSource and the actual HdStExtCompGpuComputation. Once the buffer source is resolved the resource is configured for the computation and it will then persist until the computation is released.

All program and binding data required for compiling and loading HdRprim and internal primvar data is held by this object. The companion source and computation appeal to this object to access the GPU resources.

See Also
HdStExtCompGpuComputation
HdStExtCompGpuComputationBufferSource

Definition at line 59 of file extCompGpuComputationResource.h.

Constructor & Destructor Documentation

HdStExtCompGpuComputationResource ( HdBufferSpecVector const &  outputBufferSpecs,
HdStComputeShaderSharedPtr const &  kernel,
HdBufferArrayRangeSharedPtrVector const &  inputs,
HdStResourceRegistrySharedPtr const &  registry 
)

Creates a GPU computation resource that can bind resources matching the layout of the compute kernel.

The registry passed is the registry that the kernel program will be shared amongst. De-duplication of the compiled and linked program for runtime execution happens on a per-registry basis.

Memory for the input computation buffers must be provided This must be done prior to a HdResourceRegistry::Commit in which the computation has been added. Note that the Resource allocates no memory on its own and can be speculatively created and later de-duplicated, or discarded, without wasting resources.

Parameters
[in]outputBufferSpecsthe buffer specs that the computation is expecting to output.
[in]kernelthe compute kernel source to run as the computation.
[in]registrythe registry that the internal computation will cache and de-duplicate its compute shader instance with.

Member Function Documentation

HdBufferArrayRangeSharedPtrVector const& GetInputs ( ) const
inline

Gets the HdBufferArrayRange that inputs should be loaded into using the resource binder.

Definition at line 90 of file extCompGpuComputationResource.h.

HdStGLSLProgramSharedPtr const& GetProgram ( ) const
inline

Gets the GPU HdStGLSLProgram to run to execute the computation.

This may have been shared with many other instances in the same registry. The program is only valid for execution after Resolve has been called.

Definition at line 98 of file extCompGpuComputationResource.h.

HdSt_ResourceBinder const& GetResourceBinder ( ) const
inline

Gets the resource binder that matches the layout of the compute program.

The binder is only valid for resolving layouts after Resolve has been called.

Definition at line 105 of file extCompGpuComputationResource.h.

HDST_API bool Resolve ( )

Resolve the resource bindings and program for use by a computation.

The compute program is resolved and linked against the input and output resource bindings and the kernel source in this step.


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