Loading...
Searching...
No Matches
rendererPluginRegistry.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_RENDERER_PLUGIN_REGISTRY_H
8#define PXR_IMAGING_HD_RENDERER_PLUGIN_REGISTRY_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/renderDelegate.h"
14#include "pxr/imaging/hf/pluginRegistry.h"
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18
22
23class HdRendererPluginRegistry final : public HfPluginRegistry
24{
25public:
29 HD_API
30 static HdRendererPluginRegistry &GetInstance();
31
35 template<typename T, typename... Bases>
36 static void Define();
37
43 HD_API
44 TfToken GetDefaultPluginId(bool gpuEnabled = true);
45
53 HD_API
54 HdRendererPlugin *GetRendererPlugin(const TfToken &pluginId);
55
62 HD_API
63 HdRendererPluginHandle GetOrCreateRendererPlugin(const TfToken &pluginId);
64
72 HD_API
73 HdPluginRenderDelegateUniqueHandle CreateRenderDelegate(
74 const TfToken &pluginId,
75 const HdRenderSettingsMap &settingsMap = {});
76
77private:
78 // Friend required by TfSingleton to access constructor (as it is private).
79 friend class TfSingleton<HdRendererPluginRegistry>;
80
82 const PlugRegistry &plugRegistry, const TfType &pluginType) override;
83
84 // Singleton gets private constructed
85 HdRendererPluginRegistry();
86 ~HdRendererPluginRegistry() override;
87
88 //
91 HdRendererPluginRegistry(const HdRendererPluginRegistry &) = delete;
92 HdRendererPluginRegistry &operator=(const HdRendererPluginRegistry &) = delete;
93};
94
95
96template<typename T, typename... Bases>
97void HdRendererPluginRegistry::Define()
98{
100}
101
102
103PXR_NAMESPACE_CLOSE_SCOPE
104
105#endif // PXR_IMAGING_HD_RENDERER_PLUGIN_REGISTRY_H
A (movable) handle for a render delegate that was created using a a plugin.
A handle for HdRendererPlugin also storing the plugin id.
This class defines a renderer plugin interface for Hydra.
Base class for registering Hydra plugins using the plug mechanism.
static void Define()
Entry point for registering a types implementation.
virtual HF_API void _CollectAdditionalMetadata(const PlugRegistry &plugRegistry, const TfType &pluginType)
Gives subclasses an opportunity to inspect plugInfo-based metadata at the time of discovery.
Defines an interface for registering plugins.
Definition: registry.h:319
Manage a single instance of an object (see.
Definition: singleton.h:105
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
Manage a single instance of an object.