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, HdStComputeShaderSharedPtr const &kernel, HdBufferArrayRangeSharedPtrVector const &inputs, HdStResourceRegistrySharedPtr const &registry)
virtual ~HdStExtCompGpuComputationResource ()=default
GetInputs () const
HdStGLSLProgramSharedPtr constGetProgram () const
HdSt_ResourceBinder constGetResourceBinder () const
HDST_API bool Resolve ()

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

Definition at line 60 of file extCompGpuComputationResource.h.

Constructor & Destructor Documentation

HdStExtCompGpuComputationResource::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.

[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 91 of file extCompGpuComputationResource.h.

HdStGLSLProgramSharedPtr const& HdStExtCompGpuComputationResource::GetProgram ( ) const

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 99 of file extCompGpuComputationResource.h.

HdSt_ResourceBinder const& HdStExtCompGpuComputationResource::GetResourceBinder ( ) const

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 106 of file extCompGpuComputationResource.h.

HDST_API bool HdStExtCompGpuComputationResource::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: