Loading...
Searching...
No Matches
rendererPluginRegistry.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_IMAGING_HD_RENDERER_PLUGIN_REGISTRY_H
25#define PXR_IMAGING_HD_RENDERER_PLUGIN_REGISTRY_H
26
27#include "pxr/pxr.h"
28#include "pxr/imaging/hd/api.h"
29#include "pxr/imaging/hd/renderDelegate.h"
31#include "pxr/imaging/hf/pluginRegistry.h"
32
33PXR_NAMESPACE_OPEN_SCOPE
34
35
39
40class HdRendererPluginRegistry final : public HfPluginRegistry
41{
42public:
46 HD_API
47 static HdRendererPluginRegistry &GetInstance();
48
52 template<typename T, typename... Bases>
53 static void Define();
54
60 HD_API
61 TfToken GetDefaultPluginId(bool gpuEnabled = true);
62
70 HD_API
71 HdRendererPlugin *GetRendererPlugin(const TfToken &pluginId);
72
79 HD_API
80 HdRendererPluginHandle GetOrCreateRendererPlugin(const TfToken &pluginId);
81
89 HD_API
90 HdPluginRenderDelegateUniqueHandle CreateRenderDelegate(
91 const TfToken &pluginId,
92 const HdRenderSettingsMap &settingsMap = {});
93
94private:
95 // Friend required by TfSingleton to access constructor (as it is private).
96 friend class TfSingleton<HdRendererPluginRegistry>;
97
98 // Singleton gets private constructed
99 HdRendererPluginRegistry();
100 ~HdRendererPluginRegistry() override;
101
102 //
105 HdRendererPluginRegistry(const HdRendererPluginRegistry &) = delete;
106 HdRendererPluginRegistry &operator=(const HdRendererPluginRegistry &) = delete;
107};
108
109
110template<typename T, typename... Bases>
111void HdRendererPluginRegistry::Define()
112{
114}
115
116
117PXR_NAMESPACE_CLOSE_SCOPE
118
119#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.
Manage a single instance of an object (see.
Definition: singleton.h:122
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Manage a single instance of an object.