HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_RENDER_INDEX_H
25 #define PXR_IMAGING_HD_RENDER_INDEX_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
32 #include "pxr/imaging/hd/perfLog.h"
36 #include "pxr/imaging/hd/tokens.h"
37 
42 
43 #include "pxr/imaging/hf/perfLog.h"
44 
45 #include "pxr/usd/sdf/path.h"
46 
47 #include "pxr/base/gf/vec4i.h"
48 #include "pxr/base/tf/hashmap.h"
49 
50 #include <tbb/enumerable_thread_specific.h>
51 
52 #include <vector>
53 #include <unordered_map>
54 #include <memory>
55 
57 
58 class HdRprim;
59 class HdSprim;
60 class HdBprim;
61 class HdDrawItem;
62 class HdRprimCollection;
63 class HdSceneDelegate;
64 class HdRenderDelegate;
65 class HdExtComputation;
66 class VtValue;
67 class HdInstancer;
68 class HdDriver;
69 
70 using HdDriverVector = std::vector<HdDriver*>;
71 using HdRprimCollectionVector = std::vector<HdRprimCollection>;
72 using HdTaskSharedPtr = std::shared_ptr<class HdTask>;
73 using HdResourceRegistrySharedPtr = std::shared_ptr<class HdResourceRegistry>;
74 using HdTaskSharedPtrVector = std::vector<HdTaskSharedPtr>;
75 using HdTaskContext = std::unordered_map<TfToken,
76  VtValue,
78 
79 /// \class HdRenderIndex
80 ///
81 /// The Hydra render index is a flattened representation of the client scene
82 /// graph, which may be composed of several self-contained scene graphs, each of
83 /// which provides a HdSceneDelegate adapter for data access.
84 ///
85 /// Thus, multiple HdSceneDelegate's may be tied to the same HdRenderIndex.
86 ///
87 /// The render index, however, is tied to a single HdRenderDelegate, which
88 /// handles the actual creation and deletion of Hydra scene primitives. These
89 /// include geometry and non-drawable objects (such as the camera and texture
90 /// buffers). The render index simply holds a handle to these primitives, and
91 /// tracks any changes to them via the HdChangeTracker.
92 /// It also tracks computations and tasks that may update resources and render a
93 /// subset of the renderable primitives.
94 ///
95 /// The render index orchestrates the "syncing" of scene primitives, by
96 /// providing the relevant scene delegate for data access, and leaves resource
97 /// management to the rendering backend (via HdResourceRegistry).
98 ///
99 /// It also provides "execution" functionality for application facing Hydra
100 /// concepts (such as HdTask/HdRenderPass) in computing the set of HdDrawItems
101 /// for a given HdRprimCollection, for rendering.
102 ///
103 /// \sa
104 /// HdChangeTracker
105 /// HdDrawItem
106 /// HdRenderDelegate
107 /// HdRprimCollection
108 /// HdSceneDelegate
109 ///
110 /// \note
111 /// The current design ties a HdRenderIndex to a HdRenderDelegate.
112 /// However, the HdRenderIndex isn't tied to a viewer (viewport).
113 /// It is common to have multiple viewers image the composed scene (for example,
114 /// with different cameras), in which case the HdRenderIndex and
115 /// HdRenderDelegate are shared by the viewers.
116 ///
117 /// If two viewers use different HdRenderDelegate's, then it may unfortunately
118 /// require populating two HdRenderIndex's.
119 ///
120 class HdRenderIndex final
121 {
122 public:
123  typedef std::vector<HdDrawItem const*> HdDrawItemPtrVector;
124 
125  /// Create a render index with the given render delegate.
126  /// Returns null if renderDelegate is null.
127  /// The render delegate and render tasks may require access to a renderer's
128  /// device provided by the application. The objects can be
129  /// passed in as 'drivers'. Hgi is an example of a HdDriver.
130  // hgi = Hgi::CreatePlatformDefaultHgi()
131  // hgiDriver = new HdDriver<Hgi*>(HgiTokens→renderDriver, hgi)
132  // HdRenderIndex::New(_renderDelegate, {_hgiDriver})
133  HD_API
134  static HdRenderIndex* New(
135  HdRenderDelegate *renderDelegate,
136  HdDriverVector const& drivers);
137 
138  HD_API
139  ~HdRenderIndex();
140 
141  /// Clear all r (render), s (state) and b (buffer) prims.
142  HD_API
143  void Clear();
144 
145  /// Clear all entries in the render index under
146  /// the given root and belong to a specified delegate.
147  ///
148  /// Used for example to unload a delegate.
149  HD_API
150  void RemoveSubtree(const SdfPath &root, HdSceneDelegate* sceneDelegate);
151 
152  // ---------------------------------------------------------------------- //
153  /// Given a prim id, returns the path of the corresponding rprim
154  /// or an empty path if none is found.
155  HD_API
156  SdfPath GetRprimPathFromPrimId(int primId) const;
157 
158  // ---------------------------------------------------------------------- //
159  /// \name Synchronization
160  // ---------------------------------------------------------------------- //
161 
162  /// Hydra's core currently needs to know the collections used by tasks
163  /// to aggregate the reprs that need to be synced for the dirty Rprims.
164  ///
165  HD_API
166  void EnqueueCollectionToSync(HdRprimCollection const &collection);
167 
168  /// Syncs input tasks, B & S prims, (external) computations and updates the
169  /// Rprim dirty list to then sync the Rprims.
170  /// At the end of this step, all the resources that need to be updated have
171  /// handles to their data sources.
172  /// This is the first phase in Hydra's execution. See HdEngine::Execute
173  HD_API
174  void SyncAll(HdTaskSharedPtrVector *tasks, HdTaskContext *taskContext);
175 
176  // ---------------------------------------------------------------------- //
177  /// \name Execution
178  // ---------------------------------------------------------------------- //
179 
180  /// Returns a list of relevant draw items that match the criteria specified
181  // by renderTags and collection.
182  /// The is typically called during render pass execution, which is the
183  /// final phase in the Hydra's execution. See HdRenderPass::Execute
184  HD_API
186  TfTokenVector const& renderTags);
187 
188  // ---------------------------------------------------------------------- //
189  /// \name Change Tracker
190  // ---------------------------------------------------------------------- //
191 
192  HdChangeTracker& GetChangeTracker() { return _tracker; }
193  HdChangeTracker const& GetChangeTracker() const { return _tracker; }
194 
195  // ---------------------------------------------------------------------- //
196  /// \name Renderable prims (e.g. meshes, basis curves)
197  // ---------------------------------------------------------------------- //
198 
199  /// Returns whether the rprim type is supported by this render index.
200  HD_API
201  bool IsRprimTypeSupported(TfToken const& typeId) const;
202 
203  /// Insert a rprim into index
204  HD_API
205  void InsertRprim(TfToken const& typeId,
206  HdSceneDelegate* sceneDelegate,
207  SdfPath const& rprimId);
208 
209  /// Remove a rprim from index
210  HD_API
211  void RemoveRprim(SdfPath const& id);
212 
213  /// Returns true if rprim \p id exists in index.
214  bool HasRprim(SdfPath const& id) {
215  return _rprimMap.find(id) != _rprimMap.end();
216  }
217 
218  /// Returns the rprim of id
219  HD_API
220  HdRprim const *GetRprim(SdfPath const &id) const;
221 
222  /// Returns the scene delegate for the given rprim
223  HD_API
225 
226  /// Query function to return the id's of the scene delegate and instancer
227  /// associated with the Rprim at the given path.
228  HD_API
230  SdfPath* sceneDelegateId,
231  SdfPath* instancerId) const;
232 
233  /// Returns the render tag for the given rprim
234  HD_API
235  TfToken GetRenderTag(SdfPath const& id) const;
236 
237  /// Like GetRenderTag, but updates the render tag if dirty.
238  TfToken UpdateRenderTag(SdfPath const& id,
239  HdDirtyBits bits);
240 
241  /// Returns a sorted list of all Rprims in the render index.
242  /// The list is sorted by std::less<SdfPath>
243  HD_API
244  const SdfPathVector &GetRprimIds() { return _rprimIds.GetIds(); }
245 
246 
247  /// Returns the subtree rooted under the given path.
248  HD_API
250 
251 
252  // ---------------------------------------------------------------------- //
253  /// \name Instancer Support
254  // ---------------------------------------------------------------------- //
255 
256  /// Insert an instancer into index
257  HD_API
258  void InsertInstancer(HdSceneDelegate* delegate,
259  SdfPath const &id);
260 
261  /// Remove an instancer from index
262  HD_API
263  void RemoveInstancer(SdfPath const& id);
264 
265  /// Returns true if instancer \p id exists in index.
266  bool HasInstancer(SdfPath const& id) {
267  return _instancerMap.find(id) != _instancerMap.end();
268  }
269 
270  /// Returns the instancer of id
271  HD_API
272  HdInstancer *GetInstancer(SdfPath const &id) const;
273 
274  // ---------------------------------------------------------------------- //
275  /// \name Task Support
276  // ---------------------------------------------------------------------- //
277 
278  /// Inserts a new task into the render index with an identifier of \p id.
279  template <typename T>
280  void InsertTask(HdSceneDelegate* delegate, SdfPath const& id);
281 
282  /// Removes the given task from the RenderIndex.
283  HD_API
284  void RemoveTask(SdfPath const& id);
285 
286  /// Returns true if a task exists in the index with the given \p id.
287  bool HasTask(SdfPath const& id) {
288  return _taskMap.find(id) != _taskMap.end();
289  }
290 
291  /// Returns the task for the given \p id.
292  HD_API
293  HdTaskSharedPtr const& GetTask(SdfPath const& id) const;
294 
295  // ---------------------------------------------------------------------- //
296  /// \name Scene state prims (e.g. camera, light)
297  // ---------------------------------------------------------------------- //
298 
299  /// Returns whether the sprim type is supported by this render index.
300  HD_API
301  bool IsSprimTypeSupported(TfToken const& typeId) const;
302 
303  /// Insert a sprim into index
304  HD_API
305  void InsertSprim(TfToken const& typeId,
306  HdSceneDelegate* delegate,
307  SdfPath const& sprimId);
308 
309  HD_API
310  void RemoveSprim(TfToken const& typeId, SdfPath const &id);
311 
312  HD_API
313  HdSprim *GetSprim(TfToken const& typeId, SdfPath const &id) const;
314 
315  /// Returns the subtree rooted under the given path for the given sprim
316  /// type.
317  HD_API
318  SdfPathVector GetSprimSubtree(TfToken const& typeId,
319  SdfPath const& root);
320 
321  /// Returns the fullback prim for the Sprim of the given type.
322  HD_API
323  HdSprim *GetFallbackSprim(TfToken const& typeId) const;
324 
325 
326  // ---------------------------------------------------------------------- //
327  /// \name Buffer prims (e.g. textures, buffers)
328  // ---------------------------------------------------------------------- //
329 
330  /// Returns whether the bprim type is supported by this render index.
331  HD_API
332  bool IsBprimTypeSupported(TfToken const& typeId) const;
333 
334  /// Insert a bprim into index
335  HD_API
336  void InsertBprim(TfToken const& typeId,
337  HdSceneDelegate* delegate,
338  SdfPath const& bprimId);
339 
340  HD_API
341  void RemoveBprim(TfToken const& typeId, SdfPath const &id);
342 
343  HD_API
344  HdBprim *GetBprim(TfToken const& typeId, SdfPath const &id) const;
345 
346  /// Returns the subtree rooted under the given path for the given bprim
347  /// type.
348  HD_API
349  SdfPathVector GetBprimSubtree(TfToken const& typeId,
350  SdfPath const& root);
351 
352  /// Returns the fallback prim for the Bprim of the given type.
353  HD_API
354  HdBprim *GetFallbackBprim(TfToken const& typeId) const;
355 
356  // ---------------------------------------------------------------------- //
357  /// \name Scene indices
358  // ---------------------------------------------------------------------- //
359  HD_API
360  void InsertSceneIndex(
361  HdSceneIndexBaseRefPtr inputSceneIndex,
362  SdfPath const& scenePathPrefix);
363 
364  HD_API
365  void RemoveSceneIndex(
366  HdSceneIndexBaseRefPtr inputSceneIndex);
367 
368  // ---------------------------------------------------------------------- //
369  /// \name Render Delegate
370  // ---------------------------------------------------------------------- //
371  /// Currently, a render index only supports connection to one type of
372  /// render delegate, due to the inserted information and change tracking
373  /// being specific to that delegate type.
374  HD_API
376 
377  // The render delegate may require access to a render context / device
378  // that is provided by the application.
379  HD_API
380  HdDriverVector const& GetDrivers() const;
381 
382  /// Returns a shared ptr to the resource registry of the current render
383  /// delegate.
384  HD_API
386 
387  /// Returns true if scene index features are available
388  /// This is true by default but can be controlled via an
389  /// HD_ENABLE_SCENE_INDEX_EMULATION environment variable.
390  HD_API
391  static bool IsSceneIndexEmulationEnabled();
392 
393  /// An application or legacy scene delegate may prefer for the scene
394  /// index observer notices generated from its prim insertions, removals, or
395  /// invalidations to be consolidated into vectorized batches. Calling this
396  /// will cause subsequent notices to be be queued.
397  ///
398  /// NOTE: This does not currently track any nested state. Repeated calls
399  /// prior to a corresponding SceneIndexEmulationNoticeBatchEnd will
400  /// have no effect.
401  HD_API
403 
404  /// Flushes any queued scene index observer notices and disables further
405  /// queueing.
406  ///
407  /// NOTE: This does not currently track any nested state. Calling this
408  /// will immediately flush and disable queueing regardless of the
409  /// number of times SceneIndexEmulationNoticeBatchBegin is called
410  /// prior.
411  HD_API
413 
414 
415 private:
416  // The render index constructor is private so we can check
417  // renderDelegate before construction: see HdRenderIndex::New(...).
419  HdRenderDelegate *renderDelegate,
420  HdDriverVector const& drivers);
421 
422  // ---------------------------------------------------------------------- //
423  // Private Helper methods
424  // ---------------------------------------------------------------------- //
425 
426  // Go through all RPrims and reallocate their instance ids
427  // This is called once we have exhausted all all 24bit instance ids.
428  void _CompactPrimIds();
429 
430  // Allocate the next available instance id to the prim
431  void _AllocatePrimId(HdRprim* prim);
432 
433  // Inserts the task into the index and updates tracking state.
434  // _TrackDelegateTask is called by the inlined InsertTask<T>, so it needs
435  // to be marked HD_API.
436  HD_API
437  void _TrackDelegateTask(HdSceneDelegate* delegate,
438  SdfPath const& taskId,
439  HdTaskSharedPtr const& task);
440 
441  template <typename T>
442  static inline const TfToken & _GetTypeId();
443 
444 
445  // Private versions of equivalent public methods which insert and remove
446  // from this render index.
447  //
448  // The public versions check to see if scene delegate emulation is active.
449  // If not, they call through to these. Otherwise, they forward to the
450  // the HdLegacyPrimSceneIndex member. If a legacy render delegate is also
451  // in use, the scene index chain will terminate with a
452  // HdSceneIndexAdapterSceneDelegate. That will call the private versions
453  // directly so that the internal render index tables are updated.
454  //
455  // This prevents cyclic insertion/removals while allowing a single
456  // HdRenderIndex to be used for both front and back-end emulation.
457  //
458  // Note: all render index users should call the public APIs; only
459  // sceneIndexAdapterSceneDelegate.cpp should call these versions, to keep
460  // state synchronized. Note, for example, that _RemoveSubtree and _Clear
461  // don't affect the task map, since tasks aren't part of emulation, whereas
462  // RemoveSubtree and Clear do affect the task map...
464  void _InsertRprim(TfToken const& typeId,
465  HdSceneDelegate* sceneDelegate,
466  SdfPath const& rprimId);
467  void _InsertSprim(TfToken const& typeId,
468  HdSceneDelegate* delegate,
469  SdfPath const& sprimId);
470  void _InsertBprim(TfToken const& typeId,
471  HdSceneDelegate* delegate,
472  SdfPath const& bprimId);
473  void _InsertInstancer(HdSceneDelegate* delegate,
474  SdfPath const &id);
475 
476  void _RemoveRprim(SdfPath const& id);
477  void _RemoveSprim(TfToken const& typeId, SdfPath const& id);
478  void _RemoveBprim(TfToken const& typeId, SdfPath const& id);
479  void _RemoveInstancer(SdfPath const& id);
480  void _RemoveSubtree(SdfPath const& id, HdSceneDelegate* sceneDelegate);
481  void _RemoveRprimSubtree(const SdfPath &root,
482  HdSceneDelegate* sceneDelegate);
483  void _RemoveInstancerSubtree(const SdfPath &root,
484  HdSceneDelegate* sceneDelegate);
485  void _RemoveExtComputationSubtree(const SdfPath &root,
486  HdSceneDelegate* sceneDelegate);
487  void _RemoveTaskSubtree(const SdfPath &root,
488  HdSceneDelegate* sceneDelegate);
489  void _Clear();
490 
491  // ---------------------------------------------------------------------- //
492  // Index State
493  // ---------------------------------------------------------------------- //
494  struct _RprimInfo {
495  HdSceneDelegate *sceneDelegate;
496  HdRprim *rprim;
497  };
498 
499  HdLegacyPrimSceneIndexRefPtr _emulationSceneIndex;
500  HdNoticeBatchingSceneIndexRefPtr _emulationNoticeBatchingSceneIndex;
501  std::unique_ptr<class HdSceneIndexAdapterSceneDelegate> _siSd;
502 
503  HdMergingSceneIndexRefPtr _mergingSceneIndex;
504 
505  struct _TaskInfo {
506  HdSceneDelegate *sceneDelegate;
507  HdTaskSharedPtr task;
508  };
509 
510  typedef std::unordered_map<SdfPath, _TaskInfo, SdfPath::Hash> _TaskMap;
512  typedef std::vector<SdfPath> _RprimPrimIDVector;
513 
514  typedef Hd_PrimTypeIndex<HdSprim> _SprimIndex;
515  typedef Hd_PrimTypeIndex<HdBprim> _BprimIndex;
516 
517  _RprimMap _rprimMap;
518  Hd_SortedIds _rprimIds;
519 
520  _RprimPrimIDVector _rprimPrimIdMap;
521 
522  _TaskMap _taskMap;
523 
524  _SprimIndex _sprimIndex;
525  _BprimIndex _bprimIndex;
526 
527  HdChangeTracker _tracker;
528 
530  _InstancerMap _instancerMap;
531 
532  HdRenderDelegate *_renderDelegate;
533  HdDriverVector _drivers;
534 
535  // ---------------------------------------------------------------------- //
536  // Sync State
537  // ---------------------------------------------------------------------- //
538  HdRprimCollectionVector _collectionsToSync;
539  HdDirtyList _rprimDirtyList;
540 
541  // ---------------------------------------------------------------------- //
542 
543  /// Register the render delegate's list of supported prim types.
544  void _InitPrimTypes();
545 
546  /// Creates fallback prims for each supported prim type.
547  bool _CreateFallbackPrims();
548 
549  /// Release the fallback prims.
550  void _DestroyFallbackPrims();
551 
552  typedef tbb::enumerable_thread_specific<HdDrawItemPtrVector>
553  _ConcurrentDrawItems;
554 
555  void _AppendDrawItems(const SdfPathVector &rprimIds,
556  size_t begin,
557  size_t end,
558  HdRprimCollection const& collection,
559  _ConcurrentDrawItems* result);
560 
561  /// Register core hydra reprs. Only ever called once, the first time
562  /// a render index is created.
563  /// XXX: This code should move to the application layer.
564  static void _ConfigureReprs();
565 
566  // Remove default constructor
567  HdRenderIndex() = delete;
568 
569  // Don't allow copies
570  HdRenderIndex(const HdRenderIndex &) = delete;
571  HdRenderIndex &operator=(const HdRenderIndex &) = delete;
572 
573 };
574 
575 template <typename T>
576 void
578 {
581 
582  HdTaskSharedPtr task = std::make_shared<T>(delegate, id);
583  _TrackDelegateTask(delegate, id, task);
584 }
585 
587 
588 #endif //PXR_IMAGING_HD_RENDER_INDEX_H
HD_API void InsertBprim(TfToken const &typeId, HdSceneDelegate *delegate, SdfPath const &bprimId)
Insert a bprim into index.
HD_API ~HdRenderIndex()
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
Definition: renderIndex.h:577
TfToken UpdateRenderTag(SdfPath const &id, HdDirtyBits bits)
Like GetRenderTag, but updates the render tag if dirty.
HD_API void RemoveInstancer(SdfPath const &id)
Remove an instancer from index.
std::shared_ptr< class HdResourceRegistry > HdResourceRegistrySharedPtr
HD_API void InsertSprim(TfToken const &typeId, HdSceneDelegate *delegate, SdfPath const &sprimId)
Insert a sprim into index.
iterator end()
Definition: hashmap.h:318
std::vector< HdDrawItem const * > HdDrawItemPtrVector
Definition: renderIndex.h:123
uint32_t HdDirtyBits
Definition: types.h:158
HD_API void Clear()
Clear all r (render), s (state) and b (buffer) prims.
HD_API HdSprim * GetSprim(TfToken const &typeId, SdfPath const &id) const
Returns whether the sprim type is supported by this render index.
#define HF_MALLOC_TAG_FUNCTION()
Definition: perfLog.h:37
HD_API HdRenderDelegate * GetRenderDelegate() const
HD_API void RemoveSubtree(const SdfPath &root, HdSceneDelegate *sceneDelegate)
HD_API SdfPathVector GetRprimSubtree(SdfPath const &root)
Returns the subtree rooted under the given path.
#define HD_API
Definition: api.h:40
bool HasTask(SdfPath const &id)
Returns true if a task exists in the index with the given id.
Definition: renderIndex.h:287
HD_API HdDrawItemPtrVector GetDrawItems(HdRprimCollection const &collection, TfTokenVector const &renderTags)
Returns a list of relevant draw items that match the criteria specified.
Functor to use for hash maps from tokens to other things.
Definition: token.h:166
HD_API void RemoveSceneIndex(HdSceneIndexBaseRefPtr inputSceneIndex)
HD_API SdfPathVector GetBprimSubtree(TfToken const &typeId, SdfPath const &root)
HD_API bool IsSprimTypeSupported(TfToken const &typeId) const
Returns whether the sprim type is supported by this render index.
std::vector< HdTaskSharedPtr > HdTaskSharedPtrVector
Definition: renderIndex.h:74
HD_API HdRprim const * GetRprim(SdfPath const &id) const
Returns the rprim of id.
HdChangeTracker const & GetChangeTracker() const
Definition: renderIndex.h:193
HD_API TfToken GetRenderTag(SdfPath const &id) const
Returns the render tag for the given rprim.
bool HasRprim(SdfPath const &id)
Returns true if rprim id exists in index.
Definition: renderIndex.h:214
static HD_API bool IsSceneIndexEmulationEnabled()
HD_API SdfPathVector GetSprimSubtree(TfToken const &typeId, SdfPath const &root)
Definition: token.h:87
GLuint64EXT * result
Definition: glew.h:14311
std::vector< HdDriver * > HdDriverVector
HD_API HdResourceRegistrySharedPtr GetResourceRegistry() const
HD_API void SyncAll(HdTaskSharedPtrVector *tasks, HdTaskContext *taskContext)
Definition: rprim.h:54
GLuint GLuint end
Definition: glcorearb.h:475
HD_API void RemoveBprim(TfToken const &typeId, SdfPath const &id)
Returns whether the bprim type is supported by this render index.
HD_API void InsertInstancer(HdSceneDelegate *delegate, SdfPath const &id)
Insert an instancer into index.
#define HD_TRACE_FUNCTION()
Definition: perfLog.h:57
HD_API void SceneIndexEmulationNoticeBatchBegin()
GLuint id
Definition: glcorearb.h:655
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
HD_API void EnqueueCollectionToSync(HdRprimCollection const &collection)
Definition: path.h:290
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:211
HD_API HdSprim * GetFallbackSprim(TfToken const &typeId) const
Returns the fullback prim for the Sprim of the given type.
HD_API void InsertSceneIndex(HdSceneIndexBaseRefPtr inputSceneIndex, SdfPath const &scenePathPrefix)
HD_API HdBprim * GetBprim(TfToken const &typeId, SdfPath const &id) const
Returns whether the bprim type is supported by this render index.
std::unordered_map< TfToken, VtValue, TfToken::HashFunctor > HdTaskContext
Definition: renderIndex.h:77
Definition: sprim.h:51
std::vector< HdRprimCollection > HdRprimCollectionVector
Definition: renderIndex.h:71
HD_API bool GetSceneDelegateAndInstancerIds(SdfPath const &id, SdfPath *sceneDelegateId, SdfPath *instancerId) const
HdChangeTracker & GetChangeTracker()
Definition: renderIndex.h:192
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1394
HD_API const SdfPathVector & GetRprimIds()
Definition: renderIndex.h:244
static HD_API HdRenderIndex * New(HdRenderDelegate *renderDelegate, HdDriverVector const &drivers)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API SdfPath GetRprimPathFromPrimId(int primId) const
Definition: bprim.h:56
HD_API bool IsRprimTypeSupported(TfToken const &typeId) const
Returns whether the rprim type is supported by this render index.
HD_API void RemoveSprim(TfToken const &typeId, SdfPath const &id)
Returns whether the sprim type is supported by this render index.
HD_API HdDriverVector const & GetDrivers() const
HD_API HdInstancer * GetInstancer(SdfPath const &id) const
Returns the instancer of id.
HD_API bool IsBprimTypeSupported(TfToken const &typeId) const
Returns whether the bprim type is supported by this render index.
HD_API const SdfPathVector & GetIds()
Sorts the ids if needed and returns the sorted list of ids.
HD_API void RemoveTask(SdfPath const &id)
Removes the given task from the RenderIndex.
HD_API void RemoveRprim(SdfPath const &id)
Remove a rprim from index.
HD_API void SceneIndexEmulationNoticeBatchEnd()
Definition: value.h:166
std::shared_ptr< class HdTask > HdTaskSharedPtr
Definition: renderIndex.h:72
HD_API void InsertRprim(TfToken const &typeId, HdSceneDelegate *sceneDelegate, SdfPath const &rprimId)
Insert a rprim into index.
HD_API HdBprim * GetFallbackBprim(TfToken const &typeId) const
Returns the fallback prim for the Bprim of the given type.
HD_API HdSceneDelegate * GetSceneDelegateForRprim(SdfPath const &id) const
Returns the scene delegate for the given rprim.
HD_API HdTaskSharedPtr const & GetTask(SdfPath const &id) const
Returns the task for the given id.
bool HasInstancer(SdfPath const &id)
Returns true if instancer id exists in index.
Definition: renderIndex.h:266
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
Definition: node.h:450