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

#include <extCompGpuComputationResource.h>

Public Member Functions

 HdStExtCompGpuComputationResource (HdBufferSpecVector const &outputBufferSpecs, HdSt_ExtCompComputeShaderSharedPtr const &kernel, HdBufferArrayRangeSharedPtrVector const &inputs, HdStResourceRegistrySharedPtr const &registry)
virtual ~HdStExtCompGpuComputationResource ()=default
GetInputs () const
HdStGLSLProgramSharedPtr constGetProgram ()
HdSt_ResourceBinder constGetResourceBinder ()

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

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.

[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.
virtual HdStExtCompGpuComputationResource::~HdStExtCompGpuComputationResource ( )

Member Function Documentation

HdBufferArrayRangeSharedPtrVector const& HdStExtCompGpuComputationResource::GetInputs ( ) const

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

Definition at line 84 of file extCompGpuComputationResource.h.

HdStGLSLProgramSharedPtr const& HdStExtCompGpuComputationResource::GetProgram ( )

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.

HdSt_ResourceBinder const& HdStExtCompGpuComputationResource::GetResourceBinder ( )

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: