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
HdContainerDataSourceHandle 
GetCapabilities () const
 
virtual HD_API bool IsPauseSupported () const
 
virtual HD_API bool IsPaused () const
 
virtual HD_API bool Pause ()
 
virtual HD_API bool Resume ()
 
virtual HD_API bool IsStopSupported () const
 
virtual HD_API bool IsStopped () const
 
virtual HD_API bool Stop (bool blocking=true)
 
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)=0
 
virtual void DestroyInstancer (HdInstancer *instancer)=0
 
virtual HdRprimCreateRprim (TfToken const &typeId, SdfPath const &rprimId)=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 TfTokenVector GetMaterialRenderContexts () const
 
virtual HD_API TfTokenVector GetRenderSettingsNamespaces () const
 
virtual HD_API bool IsPrimvarFilteringNeeded () const
 
virtual HD_API TfTokenVector GetShaderSourceTypes () const
 
virtual HD_API HdAovDescriptor GetDefaultAovDescriptor (TfToken const &name) const
 
virtual HD_API HdCommandDescriptors GetCommandDescriptors () const
 
virtual HD_API bool InvokeCommand (const TfToken &command, const HdCommandArgs &args=HdCommandArgs())
 
HD_API const std::stringGetRendererDisplayName ()
 Populated when instantiated via the HdRendererPluginRegistry. More...
 
virtual HD_API void SetTerminalSceneIndex (const HdSceneIndexBaseRefPtr &terminalSceneIndex)
 
virtual HD_API void Update ()
 
bool IsParallelSyncEnabled (TfToken primType) const
 Whether or not multithreaded sync is enabled for the specified prim type. More...
 

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
 

Friends

class HdRendererPluginRegistry
 

Detailed Description

Definition at line 95 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 
)
pure virtual

Instancer Factory Request to create a new instancer.

Parameters
idThe unique identifier of this instancer.
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 
)
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
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 HdContainerDataSourceHandle HdRenderDelegate::GetCapabilities ( ) const
virtual

Gives capabilities of render delegate as data source (conforming to HdRenderCapabilitiesSchema).

virtual HD_API HdCommandDescriptors HdRenderDelegate::GetCommandDescriptors ( ) const
virtual

Commands API Get the descriptors for the commands supported by this render delegate.

Reimplemented in 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
virtual HD_API TfTokenVector HdRenderDelegate::GetMaterialRenderContexts ( ) const
virtual

Returns a list, in descending order of preference, that can be used to select among multiple material network implementations. The default list contains an empty token.

Reimplemented in HdStRenderDelegate.

HD_API const std::string& HdRenderDelegate::GetRendererDisplayName ( )
inline

Populated when instantiated via the HdRendererPluginRegistry.

Definition at line 493 of file renderDelegate.h.

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 166 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 TfTokenVector HdRenderDelegate::GetRenderSettingsNamespaces ( ) const
virtual

Returns a list of namespace prefixes for render settings attributes relevant to a render delegate. This list is used to gather just the relevant attributes from render settings scene description. The default is an empty list, which will gather all custom (non-schema) attributes.

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::InvokeCommand ( const TfToken command,
const HdCommandArgs args = HdCommandArgs() 
)
virtual

Invokes the command described by the token command with optional args.

If the command succeeds, returns true, otherwise returns false. A command will generally fail if it is not among those returned by GetCommandDescriptors().

Reimplemented in Hd_UnitTestNullRenderDelegate.

bool HdRenderDelegate::IsParallelSyncEnabled ( TfToken  primType) const

Whether or not multithreaded sync is enabled for the specified prim type.

virtual HD_API bool HdRenderDelegate::IsPaused ( ) const
virtual

Query the delegate's pause state. Returns true if the background rendering threads are currently paused.

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::IsStopped ( ) const
virtual

Query the delegate's stop state. Returns true if the background rendering threads are not currently active.

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 void HdRenderDelegate::SetTerminalSceneIndex ( const HdSceneIndexBaseRefPtr &  terminalSceneIndex)
virtual

Hydra 2.0 API

Note
The following methods aid in migrating existing 1.0 based render delegates to the Hydra 2.0 API.Called after the scene index graph is created during render index construction, providing a hook point for the render delegate to register an observer of the terminal scene index.
Render delegates should not assume that the scene index is fully populated at this point.
virtual HD_API bool HdRenderDelegate::Stop ( bool  blocking = true)
virtual

Stop all of this delegate's background rendering threads; if blocking is true, the function waits until they exit. Default implementation does nothing.

Returns true if successfully stopped.

virtual HD_API void HdRenderDelegate::Update ( )
virtual

Called at the beginning of HdRenderIndex::SyncAll, before render index prim sync, to provide the render delegate an opportunity to directly process change notices from observing the terminal scene index, rather than using the Hydra 1.0 Sync algorithm.

Friends And Related Function Documentation

Definition at line 552 of file renderDelegate.h.

Member Data Documentation

HdRenderSettingsMap HdRenderDelegate::_settingsMap
protected

Render settings state.

Definition at line 547 of file renderDelegate.h.

unsigned int HdRenderDelegate::_settingsVersion
protected

Definition at line 548 of file renderDelegate.h.


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