Loading...
Searching...
No Matches
HdStExtCompGpuComputationResource Class Referencefinal

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

#include <extCompGpuComputationResource.h>

Public Member Functions

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

Detailed Description

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

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

Definition at line 53 of file extCompGpuComputationResource.h.

Constructor & Destructor Documentation

◆ HdStExtCompGpuComputationResource()

HdStExtCompGpuComputationResource ( HdBufferSpecVector const &  outputBufferSpecs,
HdSt_ExtCompComputeShaderSharedPtr 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

◆ GetInputs()

HdBufferArrayRangeSharedPtrVector const & GetInputs ( ) const
inline

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

Definition at line 84 of file extCompGpuComputationResource.h.

◆ GetProgram()

HdStGLSLProgramSharedPtr const & GetProgram ( )
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 92 of file extCompGpuComputationResource.h.

◆ GetResourceBinder()

HdSt_ResourceBinder const & GetResourceBinder ( )
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 102 of file extCompGpuComputationResource.h.


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