Loading...
Searching...
No Matches
rendererPlugin.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_H
8#define PXR_IMAGING_HD_RENDERER_PLUGIN_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hf/pluginBase.h"
13#include "pxr/imaging/hd/renderDelegate.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17class HdRenderer;
22
35{
36public:
37
40
53 HD_API
54 virtual bool IsSupported(
55 HdContainerDataSourceHandle const &rendererCreateArgs,
56 std::string *reasonWhyNot = nullptr) const;
57
59
78 HD_API
79 virtual
80 HdContainerDataSourceHandle GetSceneIndexInputArgs() const;
81
95 HD_API
97 HdSceneIndexBaseRefPtr const &sceneIndex,
98 HdContainerDataSourceHandle const &rendererCreateArgs);
99
101
105 HD_API
107
111 HD_API
112 std::string GetDisplayName() const;
113
116
128 virtual bool IsSupported(
129 HdRendererCreateArgs const &rendererCreateArgs,
130 std::string *reasonWhyNot = nullptr) const = 0;
131
137 HD_API
139 HdRenderSettingsMap const &settingsMap = {});
148 virtual HdRenderDelegate *CreateRenderDelegate() = 0;
149
158 HD_API
159 virtual HdRenderDelegate *CreateRenderDelegate(
160 HdRenderSettingsMap const& settingsMap);
161
168 virtual void DeleteRenderDelegate(HdRenderDelegate *renderDelegate) = 0;
169
171
183 HD_API
184 virtual bool IsSupported(bool gpuEnabled = true) const;
185
186protected:
187 HdRendererPlugin() = default;
188 HD_API
189 ~HdRendererPlugin() override;
190
191 HD_API
192 virtual std::unique_ptr<HdRenderer> _CreateRenderer(
193 HdSceneIndexBaseRefPtr const &sceneIndex,
194 HdContainerDataSourceHandle const &rendererCreateArgs);
195
196 // Instantiates render delegate and uses "back-end" emulation.
197 HD_API
198 std::unique_ptr<HdRenderer> _CreateRendererFromRenderDelegate(
199 HdSceneIndexBaseRefPtr const &sceneIndex,
200 HdContainerDataSourceHandle const &rendererCreateArgs);
201
202private:
203 // This class doesn't require copy support.
204 HdRendererPlugin(const HdRendererPlugin &) = delete;
205 HdRendererPlugin &operator =(const HdRendererPlugin &) = delete;
206
207};
208
209
210PXR_NAMESPACE_CLOSE_SCOPE
211
212#endif // PXR_IMAGING_HD_RENDERER_PLUGIN_H
A (movable) handle for a render delegate that was created using a a plugin.
A handle for a renderer that was created by a renderer plugin.
A Hydra renderer.
Definition: renderer.h:28
This class defines a renderer plugin interface for Hydra.
HD_API TfToken GetPluginId() const
Look-up plugin id in plugin registry.
virtual void DeleteRenderDelegate(HdRenderDelegate *renderDelegate)=0
Clients should use CreateDelegate since this method will eventually become protected.
HD_API std::string GetDisplayName() const
Look-up display name in plugin registry.
HD_API HdPluginRendererUniqueHandle CreateRenderer(HdSceneIndexBaseRefPtr const &sceneIndex, HdContainerDataSourceHandle const &rendererCreateArgs)
Create renderer through the plugin and wrap it in a handle that keeps this plugin alive until the ren...
virtual HD_API HdContainerDataSourceHandle GetSceneIndexInputArgs() const
Arguments that an application should pass as input arguments to scene indices so that they can be con...
HD_API HdPluginRenderDelegateUniqueHandle CreateDelegate(HdRenderSettingsMap const &settingsMap={})
Create a render delegate through the plugin and wrap it in a handle that keeps this plugin alive unti...
virtual bool IsSupported(HdRendererCreateArgs const &rendererCreateArgs, std::string *reasonWhyNot=nullptr) const =0
Returns true if this renderer plugin is supported in the running process and false if not.
virtual HD_API bool IsSupported(bool gpuEnabled=true) const
virtual HD_API bool IsSupported(HdContainerDataSourceHandle const &rendererCreateArgs, std::string *reasonWhyNot=nullptr) const
Returns true if this renderer plugin is supported in the running process and false if not.
virtual HD_API HdRenderDelegate * CreateRenderDelegate(HdRenderSettingsMap const &settingsMap)
Clients should use CreateDelegate since this method will eventually become protected.
virtual HdRenderDelegate * CreateRenderDelegate()=0
Clients should use CreateDelegate since this method will eventually become protected,...
Abstract interface to scene data.
Definition: sceneIndex.h:54
Base class for all hydra plugin classes.
Definition: pluginBase.h:23
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
HdRendererCreateArgs contains members indicating the resources available when creating a renderer plu...