HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sceneIndexInputArgsSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_SCENE_INDEX_INPUT_ARGS_SCHEMA_H
19 #define PXR_IMAGING_HD_SCENE_INDEX_INPUT_ARGS_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // #include "pxr/imaging/hd/renderDelegateInfo.h"
29 // --(END CUSTOM CODE: Includes)--
30 
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
37 // --(END CUSTOM CODE: Declares)--
38 
39 #define HD_SCENE_INDEX_INPUT_ARGS_SCHEMA_TOKENS \
40  (motionBlurSupport) \
41  (cameraMotionBlurSupport) \
42  (legacyRenderDelegateInfo) \
43 
44 TF_DECLARE_PUBLIC_TOKENS(HdSceneIndexInputArgsSchemaTokens, HD_API,
46 
47 //-----------------------------------------------------------------------------
48 
49 
50 /// \class HdSceneIndexInputArgsSchema
51 ///
52 /// Schema for the container data source returned by
53 /// HdRendererPlugin::GetSceneIndexInputArgs. The application forwards it
54 /// (possibly overlayed with its own container data source) to the scene index
55 /// constructors or scene index plugins. In other words,
56 /// HdRendererPlugin::GetSceneIndexInputArgs gives a renderer the opportunity
57 /// to configure scene indices.
58 ///
59 /// Examples are: A scene index might use execution which is non-lazy and needs
60 /// to cache values or even samples for motion blur in advance. The renderer
61 /// can advertise whether it actually supports motion blur and we need to cache
62 /// these samples. This similarly applies to the material networks for
63 /// different render contexts such as glslflx which is understood by Storm but
64 /// not Prman, for example.
65 ///
67 {
68 public:
69  /// \name Schema retrieval
70  /// @{
71 
72  HdSceneIndexInputArgsSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75  /// @}
76 
77 // --(BEGIN CUSTOM CODE: Schema Methods)--
78 // --(END CUSTOM CODE: Schema Methods)--
79 
80  /// \name Member accessor
81  /// @{
82 
83  /// Does consumer (most likely HdRenderer) of scene indices need samples
84  /// for motion blur? This is relevant, for example, for scene indices
85  /// using execution which is non-lazy and needs to know for what times to
86  /// cache samples.
87  HD_API
89 
90  /// Does consumer (most likely HdRenderer) of scene indices need samples
91  /// for motion blur for cameras? This is a variation of motionBlurSupport.
92  /// It is here, for example, for renderers that use an image shader for
93  /// camera motion blur.
94  HD_API
96 
97  /// Used for HdRenderIndexAdapterSceneIndex. In particular, this is used
98  /// when USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX is false: the
99  /// UsdImagingDelegate is querying an emulation render delegate for
100  /// information to resolve, for example, the material render contexts
101  /// correctly.
102  HD_API
104 
105  /// @}
106 
107  /// \name Schema construction
108  /// @{
109 
110  /// \deprecated Use Builder instead.
111  ///
112  /// Builds a container data source which includes the provided child data
113  /// sources. Parameters with nullptr values are excluded. This is a
114  /// low-level interface. For cases in which it's desired to define
115  /// the container with a sparse set of child fields, the Builder class
116  /// is often more convenient and readable.
117  HD_API
118  static HdContainerDataSourceHandle
120  const HdBoolDataSourceHandle &motionBlurSupport,
121  const HdBoolDataSourceHandle &cameraMotionBlurSupport,
122  const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo
123  );
124 
125  /// \class HdSceneIndexInputArgsSchema::Builder
126  ///
127  /// Utility class for setting sparse sets of child data source fields to be
128  /// filled as arguments into BuildRetained. Because all setter methods
129  /// return a reference to the instance, this can be used in the "builder
130  /// pattern" form.
131  class Builder
132  {
133  public:
134  HD_API
136  const HdBoolDataSourceHandle &motionBlurSupport);
137  HD_API
139  const HdBoolDataSourceHandle &cameraMotionBlurSupport);
140  HD_API
142  const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo);
143 
144  /// Returns a container data source containing the members set thus far.
145  HD_API
146  HdContainerDataSourceHandle Build();
147 
148  private:
149  HdBoolDataSourceHandle _motionBlurSupport;
150  HdBoolDataSourceHandle _cameraMotionBlurSupport;
151  HdRenderDelegateInfoDataSourceHandle _legacyRenderDelegateInfo;
152 
153  };
154 
155  /// @}
156 };
157 
159 
160 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
HD_API HdBoolDataSourceHandle GetMotionBlurSupport() const
HD_API Builder & SetLegacyRenderDelegateInfo(const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo)
HD_API HdBoolDataSourceHandle GetCameraMotionBlurSupport() const
HD_API Builder & SetMotionBlurSupport(const HdBoolDataSourceHandle &motionBlurSupport)
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API Builder & SetCameraMotionBlurSupport(const HdBoolDataSourceHandle &cameraMotionBlurSupport)
HdSceneIndexInputArgsSchema(HdContainerDataSourceHandle container)
TF_DECLARE_PUBLIC_TOKENS(HdSceneIndexInputArgsSchemaTokens, HD_API, HD_SCENE_INDEX_INPUT_ARGS_SCHEMA_TOKENS)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdRenderDelegateInfoDataSourceHandle GetLegacyRenderDelegateInfo() const
#define HD_SCENE_INDEX_INPUT_ARGS_SCHEMA_TOKENS
HdRenderDelegateInfoDataSource::Handle HdRenderDelegateInfoDataSourceHandle
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdContainerDataSourceHandle BuildRetained(const HdBoolDataSourceHandle &motionBlurSupport, const HdBoolDataSourceHandle &cameraMotionBlurSupport, const HdRenderDelegateInfoDataSourceHandle &legacyRenderDelegateInfo)
void * Handle
Definition: plugin.h:27