HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdRenderDelegate Class Referenceabstract

#include <renderDelegate.h>

+ Inheritance diagram for HdRenderDelegate:

Public Member Functions

virtual HD_API ~HdRenderDelegate ()
 
virtual HD_API void SetDrivers (HdDriverVector const &drivers)
 
virtual const TfTokenVectorGetSupportedRprimTypes () const =0
 
virtual const TfTokenVectorGetSupportedSprimTypes () const =0
 
virtual const TfTokenVectorGetSupportedBprimTypes () const =0
 
virtual HD_API HdRenderParamGetRenderParam () const
 
virtual HdResourceRegistrySharedPtr GetResourceRegistry () const =0
 
virtual HD_API void SetRenderSetting (TfToken const &key, VtValue const &value)
 
virtual HD_API VtValue GetRenderSetting (TfToken const &key) const
 
template<typename T >
T GetRenderSetting (TfToken const &key, T const &defValue) const
 
virtual HD_API
HdRenderSettingDescriptorList 
GetRenderSettingDescriptors () const
 
virtual HD_API unsigned int GetRenderSettingsVersion () const
 
virtual HD_API VtDictionary GetRenderStats () const
 
virtual HD_API bool IsPauseSupported () const
 
virtual HD_API bool Pause ()
 
virtual HD_API bool Resume ()
 
virtual HD_API bool IsStopSupported () const
 
virtual HD_API bool Stop ()
 
virtual HD_API bool Restart ()
 
virtual HdRenderPassSharedPtr CreateRenderPass (HdRenderIndex *index, HdRprimCollection const &collection)=0
 
virtual HD_API
HdRenderPassStateSharedPtr 
CreateRenderPassState () const
 
virtual HdInstancerCreateInstancer (HdSceneDelegate *delegate, SdfPath const &id, SdfPath const &instancerId)=0
 
virtual void DestroyInstancer (HdInstancer *instancer)=0
 
virtual HdRprimCreateRprim (TfToken const &typeId, SdfPath const &rprimId, SdfPath const &instancerId)=0
 
virtual void DestroyRprim (HdRprim *rPrim)=0
 
virtual HdSprimCreateSprim (TfToken const &typeId, SdfPath const &sprimId)=0
 
virtual HdSprimCreateFallbackSprim (TfToken const &typeId)=0
 
virtual void DestroySprim (HdSprim *sprim)=0
 
virtual HdBprimCreateBprim (TfToken const &typeId, SdfPath const &bprimId)=0
 
virtual HdBprimCreateFallbackBprim (TfToken const &typeId)=0
 
virtual void DestroyBprim (HdBprim *bprim)=0
 
virtual void CommitResources (HdChangeTracker *tracker)=0
 
virtual HD_API TfToken GetMaterialBindingPurpose () const
 
virtual HD_API TfToken GetMaterialNetworkSelector () const
 
virtual HD_API bool IsPrimvarFilteringNeeded () const
 
virtual HD_API TfTokenVector GetShaderSourceTypes () const
 
virtual HD_API HdAovDescriptor GetDefaultAovDescriptor (TfToken const &name) const
 

Protected Member Functions

HD_API HdRenderDelegate ()
 This class must be derived from. More...
 
HD_API HdRenderDelegate (HdRenderSettingsMap const &settingsMap)
 Allow derived classes to pass construction-time render settings. More...
 
 HdRenderDelegate (const HdRenderDelegate &)=delete
 
HdRenderDelegateoperator= (const HdRenderDelegate &)=delete
 
HD_API void _PopulateDefaultSettings (HdRenderSettingDescriptorList const &defaultSettings)
 

Protected Attributes

HdRenderSettingsMap _settingsMap
 Render settings state. More...
 
unsigned int _settingsVersion
 

Detailed Description

Definition at line 91 of file renderDelegate.h.

Constructor & Destructor Documentation

virtual HD_API HdRenderDelegate::~HdRenderDelegate ( )
virtual
HD_API HdRenderDelegate::HdRenderDelegate ( )
protected

This class must be derived from.

HD_API HdRenderDelegate::HdRenderDelegate ( HdRenderSettingsMap const settingsMap)
protected

Allow derived classes to pass construction-time render settings.

HdRenderDelegate::HdRenderDelegate ( const HdRenderDelegate )
protecteddelete

This class is not intended to be copied.

Member Function Documentation

HD_API void HdRenderDelegate::_PopulateDefaultSettings ( HdRenderSettingDescriptorList const defaultSettings)
protected
virtual void HdRenderDelegate::CommitResources ( HdChangeTracker tracker)
pure virtual

Sync, Execute & Dispatch Hooks Notification point from the Engine to the delegate. This notification occurs after all Sync's have completed and before task execution.

This notification gives the Render Delegate a chance to update and move memory that the render may need.

For example, the render delegate might fill primvar buffers or texture memory.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdBprim* HdRenderDelegate::CreateBprim ( TfToken const typeId,
SdfPath const bprimId 
)
pure virtual

Request to Allocate and Construct a new Bprim.

Parameters
typeIdthe type identifier of the prim to allocate
sprimIda unique identifier for the prim
Returns
A pointer to the new prim or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdBprim* HdRenderDelegate::CreateFallbackBprim ( TfToken const typeId)
pure virtual

Request to Allocate and Construct a Bprim to use as a standin, if there if an error with another another Bprim of the same type. For example, if another prim references a non-exisiting Bprim, the fallback could be used.

Parameters
typeIdthe type identifier of the prim to allocate
Returns
A pointer to the new prim or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdSprim* HdRenderDelegate::CreateFallbackSprim ( TfToken const typeId)
pure virtual

Request to Allocate and Construct an Sprim to use as a standin, if there if an error with another another Sprim of the same type. For example, if another prim references a non-exisiting Sprim, the fallback could be used.

Parameters
typeIdthe type identifier of the prim to allocate
Returns
A pointer to the new prim or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdInstancer* HdRenderDelegate::CreateInstancer ( HdSceneDelegate delegate,
SdfPath const id,
SdfPath const instancerId 
)
pure virtual

Instancer Factory Request to create a new instancer.

Parameters
idThe unique identifier of this instancer.
instancerIdThe unique identifier for the parent instancer that uses this instancer as a prototype (may be empty).
Returns
A pointer to the new instancer or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdRenderPassSharedPtr HdRenderDelegate::CreateRenderPass ( HdRenderIndex index,
HdRprimCollection const collection 
)
pure virtual

Renderpass Factory Request to create a new renderpass.

Parameters
indexthe render index to bind to the new renderpass.
collectionthe rprim collection to bind to the new renderpass.
Returns
A shared pointer to the new renderpass or empty on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HD_API HdRenderPassStateSharedPtr HdRenderDelegate::CreateRenderPassState ( ) const
virtual

Request to create a new renderpass state. The default implementation creates an HdRenderPassState instance, but derived render delegates may instantiate their own state type.

Parameters
shaderThe render pass shader to use. If null, a new HdRenderPassShared will be created.
Returns
A shared pointer to the new renderpass state.

Reimplemented in HdStRenderDelegate.

virtual HdRprim* HdRenderDelegate::CreateRprim ( TfToken const typeId,
SdfPath const rprimId,
SdfPath const instancerId 
)
pure virtual

Prim Factories Request to Allocate and Construct a new Rprim.

Parameters
typeIdthe type identifier of the prim to allocate
rprimIda unique identifier for the prim
instancerIdthe unique identifier for the instancer that uses the prim (optional: May be empty).
Returns
A pointer to the new prim or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HdSprim* HdRenderDelegate::CreateSprim ( TfToken const typeId,
SdfPath const sprimId 
)
pure virtual

Request to Allocate and Construct a new Sprim.

Parameters
typeIdthe type identifier of the prim to allocate
sprimIda unique identifier for the prim
Returns
A pointer to the new prim or nullptr on error.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual void HdRenderDelegate::DestroyBprim ( HdBprim bprim)
pure virtual

Request to Destruct and deallocate the prim.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual void HdRenderDelegate::DestroyInstancer ( HdInstancer instancer)
pure virtual
virtual void HdRenderDelegate::DestroyRprim ( HdRprim rPrim)
pure virtual

Request to Destruct and deallocate the prim.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual void HdRenderDelegate::DestroySprim ( HdSprim sprim)
pure virtual

Request to Destruct and deallocate the prim.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HD_API HdAovDescriptor HdRenderDelegate::GetDefaultAovDescriptor ( TfToken const name) const
virtual

AOVs Returns a default AOV descriptor for the given named AOV, specifying things like preferred format.

Reimplemented in HdStRenderDelegate.

virtual HD_API TfToken HdRenderDelegate::GetMaterialBindingPurpose ( ) const
virtual

Materials Returns a token that indicates material bindings should be used, based on the indicated purpose. The default purpose is HdTokens->preview.

virtual HD_API TfToken HdRenderDelegate::GetMaterialNetworkSelector ( ) const
virtual

Returns a token that can be used to select among multiple material network implementations. The default is empty.

Reimplemented in HdStRenderDelegate.

virtual HD_API HdRenderParam* HdRenderDelegate::GetRenderParam ( ) const
virtual

Returns an opaque handle to a render param, that in turn is passed to each prim created by the render delegate during sync processing. This avoids the need to store a global state pointer in each prim.

The typical lifetime of the renderParam would match that of the RenderDelegate, however the minimal lifetime is that of the Sync processing. The param maybe queried multiple times during sync.

A render delegate may return null for the param.

Reimplemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HD_API VtValue HdRenderDelegate::GetRenderSetting ( TfToken const key) const
virtual

Get the current value for a render setting.

template<typename T >
T HdRenderDelegate::GetRenderSetting ( TfToken const key,
T const defValue 
) const
inline

Get the current value for a render setting, taking a desired type and a fallback value in case of type mismatch.

Definition at line 162 of file renderDelegate.h.

virtual HD_API HdRenderSettingDescriptorList HdRenderDelegate::GetRenderSettingDescriptors ( ) const
virtual

Get the backend-exported render setting descriptors.

Reimplemented in HdStRenderDelegate.

virtual HD_API unsigned int HdRenderDelegate::GetRenderSettingsVersion ( ) const
virtual

Get the current version of the render settings dictionary.

virtual HD_API VtDictionary HdRenderDelegate::GetRenderStats ( ) const
virtual

Returns an open-format dictionary of render statistics

Reimplemented in HdStRenderDelegate.

virtual HdResourceRegistrySharedPtr HdRenderDelegate::GetResourceRegistry ( ) const
pure virtual

Returns a shared ptr to the resource registry of the current render delegate.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HD_API TfTokenVector HdRenderDelegate::GetShaderSourceTypes ( ) const
virtual

Returns the ordered list of shader source types that the render delegate supports.

Reimplemented in HdStRenderDelegate.

virtual const TfTokenVector& HdRenderDelegate::GetSupportedBprimTypes ( ) const
pure virtual

Returns a list of typeId's of all supported Bprims by this render delegate.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual const TfTokenVector& HdRenderDelegate::GetSupportedRprimTypes ( ) const
pure virtual

Returns a list of typeId's of all supported Rprims by this render delegate.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual const TfTokenVector& HdRenderDelegate::GetSupportedSprimTypes ( ) const
pure virtual

Returns a list of typeId's of all supported Sprims by this render delegate.

Implemented in HdStRenderDelegate, and Hd_UnitTestNullRenderDelegate.

virtual HD_API bool HdRenderDelegate::IsPauseSupported ( ) const
virtual

Control of background rendering threads. Advertise whether this delegate supports pausing and resuming of background render threads. Default implementation returns false.

virtual HD_API bool HdRenderDelegate::IsPrimvarFilteringNeeded ( ) const
virtual

Return true to indicate that the render delegate wants rprim primvars to be filtered by the scene delegate to reduce the amount of primvars that are send to the render delegate. For example the scene delegate may check the bound material primvar requirements and send only those to the render delegate. Return false to not apply primvar filtering in the scene delegate. Defaults to false.

Reimplemented in HdStRenderDelegate.

virtual HD_API bool HdRenderDelegate::IsStopSupported ( ) const
virtual

Advertise whether this delegate supports stopping and restarting of background render threads. Default implementation returns false.

HdRenderDelegate& HdRenderDelegate::operator= ( const HdRenderDelegate )
protecteddelete
virtual HD_API bool HdRenderDelegate::Pause ( )
virtual

Pause all of this delegate's background rendering threads. Default implementation does nothing.

Returns true if successful.

virtual HD_API bool HdRenderDelegate::Restart ( )
virtual

Restart all of this delegate's background rendering threads previously stopped by a call to Stop. Default implementation does nothing.

Returns true if successful.

virtual HD_API bool HdRenderDelegate::Resume ( )
virtual

Resume all of this delegate's background rendering threads previously paused by a call to Pause. Default implementation does nothing.

Returns true if successful.

virtual HD_API void HdRenderDelegate::SetDrivers ( HdDriverVector const drivers)
virtual

Set list of driver objects, such as a rendering context / devices. This is automatically called from HdRenderIndex when a HdDriver is provided during its construction. Default implementation does nothing.

Reimplemented in HdStRenderDelegate.

virtual HD_API void HdRenderDelegate::SetRenderSetting ( TfToken const key,
VtValue const value 
)
virtual

Set a custom render setting on this render delegate.

virtual HD_API bool HdRenderDelegate::Stop ( )
virtual

Stop all of this delegate's background rendering threads. Default implementation does nothing.

Returns true if successful.

Member Data Documentation

HdRenderSettingsMap HdRenderDelegate::_settingsMap
protected

Render settings state.

Definition at line 450 of file renderDelegate.h.

unsigned int HdRenderDelegate::_settingsVersion
protected

Definition at line 451 of file renderDelegate.h.


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