HDK
|
#include <extCompGpuComputationResource.h>
Public Member Functions | |
HdStExtCompGpuComputationResource (HdBufferSpecVector const &outputBufferSpecs, HdSt_ExtCompComputeShaderSharedPtr const &kernel, HdBufferArrayRangeSharedPtrVector const &inputs, HdStResourceRegistrySharedPtr const ®istry) | |
virtual | ~HdStExtCompGpuComputationResource ()=default |
HdBufferArrayRangeSharedPtrVector const & | GetInputs () const |
HdStGLSLProgramSharedPtr const & | GetProgram () |
HdSt_ResourceBinder const & | GetResourceBinder () |
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.
Definition at line 53 of file extCompGpuComputationResource.h.
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.
[in] | outputBufferSpecs | the buffer specs that the computation is expecting to output. |
[in] | kernel | the compute kernel source to run as the computation. |
[in] | registry | the registry that the internal computation will cache and de-duplicate its compute shader instance with. |
|
virtualdefault |
|
inline |
Gets the HdBufferArrayRange that inputs should be loaded into using the resource binder.
Definition at line 84 of file extCompGpuComputationResource.h.
|
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.
|
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.