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"
31 #include "pxr/imaging/hd/perfLog.h"
36 #include "pxr/imaging/hd/tokens.h"
37 
38 #include "pxr/imaging/hf/perfLog.h"
39 
40 #include "pxr/usd/sdf/path.h"
41 
42 #include "pxr/base/gf/vec4i.h"
43 #include "pxr/base/tf/hashmap.h"
44 
45 #include <tbb/enumerable_thread_specific.h>
46 
47 #include <vector>
48 #include <unordered_map>
49 #include <memory>
50 
52 
53 class HdRprim;
54 class HdSprim;
55 class HdBprim;
56 class HdDrawItem;
57 class HdRprimCollection;
58 class HdSceneDelegate;
59 class HdRenderDelegate;
60 class HdExtComputation;
61 class VtValue;
62 class HdInstancer;
63 class HdDriver;
64 
65 using HdDirtyListSharedPtr = std::shared_ptr<class HdDirtyList>;
66 
67 using HdTaskSharedPtr = std::shared_ptr<class HdTask>;
68 
69 using HdResourceRegistrySharedPtr = std::shared_ptr<class HdResourceRegistry>;
70 using HdTaskSharedPtrVector = std::vector<HdTaskSharedPtr>;
71 using HdTaskContext = std::unordered_map<TfToken,
72  VtValue,
74 using HdDriverVector = std::vector<HdDriver*>;
75 
76 /// \class HdRenderIndex
77 ///
78 /// The Hydra render index is a flattened representation of the client scene
79 /// graph, which may be composed of several self-contained scene graphs, each of
80 /// which provides a HdSceneDelegate adapter for data access.
81 ///
82 /// Thus, multiple HdSceneDelegate's may be tied to the same HdRenderIndex.
83 ///
84 /// The render index, however, is tied to a single HdRenderDelegate, which
85 /// handles the actual creation and deletion of Hydra scene primitives. These
86 /// include geometry and non-drawable objects (such as the camera and texture
87 /// buffers). The render index simply holds a handle to these primitives, and
88 /// tracks any changes to them via the HdChangeTracker.
89 /// It also tracks computations and tasks that may update resources and render a
90 /// subset of the renderable primitives.
91 ///
92 /// The render index orchestrates the "syncing" of scene primitives, by
93 /// providing the relevant scene delegate for data access, and leaves resource
94 /// management to the rendering backend (via HdResourceRegistry).
95 ///
96 /// It also provides "execution" functionality for application facing Hydra
97 /// concepts (such as HdTask/HdRenderPass) in computing the set of HdDrawItems
98 /// for a given HdRprimCollection, for rendering.
99 ///
100 /// \sa
101 /// HdChangeTracker
102 /// HdDrawItem
103 /// HdRenderDelegate
104 /// HdRprimCollection
105 /// HdSceneDelegate
106 ///
107 /// \note
108 /// The current design ties a HdRenderIndex to a HdRenderDelegate.
109 /// However, the HdRenderIndex isn't tied to a viewer (viewport).
110 /// It is common to have multiple viewers image the composed scene (for example,
111 /// with different cameras), in which case the HdRenderIndex and
112 /// HdRenderDelegate are shared by the viewers.
113 ///
114 /// If two viewers use different HdRenderDelegate's, then it may unfortunately
115 /// require populating two HdRenderIndex's.
116 ///
117 class HdRenderIndex final
118 {
119 public:
120  typedef std::vector<HdDrawItem const*> HdDrawItemPtrVector;
121 
122  /// Create a render index with the given render delegate.
123  /// Returns null if renderDelegate is null.
124  /// The render delegate and render tasks may require access to a renderer's
125  /// device provided by the application. The objects can be
126  /// passed in as 'drivers'. Hgi is an example of a HdDriver.
127  // hgi = Hgi::CreatePlatformDefaultHgi()
128  // hgiDriver = new HdDriver<Hgi*>(HgiTokens→renderDriver, hgi)
129  // HdRenderIndex::New(_renderDelegate, {_hgiDriver})
130  HD_API
131  static HdRenderIndex* New(
132  HdRenderDelegate *renderDelegate,
133  HdDriverVector const& drivers);
134 
135  HD_API
136  ~HdRenderIndex();
137 
138  /// Clear all r (render), s (state) and b (buffer) prims.
139  HD_API
140  void Clear();
141 
142  /// Clear all entries in the render index under
143  /// the given root and belong to a specified delegate.
144  ///
145  /// Used for example to unload a delegate.
146  HD_API
147  void RemoveSubtree(const SdfPath &root, HdSceneDelegate* sceneDelegate);
148 
149  // ---------------------------------------------------------------------- //
150  /// Given a prim id, returns the path of the corresponding rprim
151  /// or an empty path if none is found.
152  HD_API
153  SdfPath GetRprimPathFromPrimId(int primId) const;
154 
155  // ---------------------------------------------------------------------- //
156  /// \name Synchronization
157  // ---------------------------------------------------------------------- //
158 
159  /// Adds the dirty list to the sync queue. The actual processing of the
160  /// dirty list happens later in SyncAll().
161  ///
162  /// This is typically called from HdRenderPass::Sync. However, the current
163  /// call chain ties it to SyncAll, i.e.
164  /// HdRenderIndex::SyncAll > .... > HdRenderPass::Sync > HdRenderIndex::Sync
165  HD_API
166  void EnqueuePrimsToSync(
167  HdDirtyListSharedPtr const &dirtyList,
168  HdRprimCollection const &collection);
169 
170  /// Syncs input tasks, B & S prims, (external) computations and processes
171  /// all pending dirty lists (which syncs the R prims). At the end of this
172  /// step, all the resources that need to be updated have handles to their
173  /// data sources.
174  /// This is the first phase in Hydra's execution. See HdEngine::Execute
175  HD_API
176  void SyncAll(HdTaskSharedPtrVector *tasks, HdTaskContext *taskContext);
177 
178  // ---------------------------------------------------------------------- //
179  /// \name Execution
180  // ---------------------------------------------------------------------- //
181 
182  /// Returns a list of relevant draw items that match the criteria specified
183  // by renderTags and collection.
184  /// The is typically called during render pass execution, which is the
185  /// final phase in the Hydra's execution. See HdRenderPass::Execute
186  HD_API
188  TfTokenVector const& renderTags);
189 
190  // ---------------------------------------------------------------------- //
191  /// \name Change Tracker
192  // ---------------------------------------------------------------------- //
193 
194  HdChangeTracker& GetChangeTracker() { return _tracker; }
195  HdChangeTracker const& GetChangeTracker() const { return _tracker; }
196 
197  // ---------------------------------------------------------------------- //
198  /// \name Renderable prims (e.g. meshes, basis curves)
199  // ---------------------------------------------------------------------- //
200 
201  /// Returns whether the rprim type is supported by this render index.
202  HD_API
203  bool IsRprimTypeSupported(TfToken const& typeId) const;
204 
205  /// Insert a rprim into index
206  HD_API
207  void InsertRprim(TfToken const& typeId,
208  HdSceneDelegate* sceneDelegate,
209  SdfPath const& rprimId,
210  SdfPath const& instancerId = SdfPath());
211 
212  /// Remove a rprim from index
213  HD_API
214  void RemoveRprim(SdfPath const& id);
215 
216  /// Returns true if rprim \p id exists in index.
217  bool HasRprim(SdfPath const& id) {
218  return _rprimMap.find(id) != _rprimMap.end();
219  }
220 
221  /// Returns the rprim of id
222  HD_API
223  HdRprim const *GetRprim(SdfPath const &id) const;
224 
225  /// Returns the scene delegate for the given rprim
226  HD_API
228 
229  /// Query function to return the id's of the scene delegate and instancer
230  /// associated with the Rprim at the given path.
231  HD_API
233  SdfPath* sceneDelegateId,
234  SdfPath* instancerId) const;
235 
236  /// Returns the render tag for the given rprim
237  HD_API
238  TfToken GetRenderTag(SdfPath const& id) const;
239 
240  /// Return the material tag for the given rprim
241  HD_API
242  TfToken GetMaterialTag(SdfPath const& id) const;
243 
244  /// Returns a sorted list of all Rprims in the render index.
245  /// The list is sorted by std::less<SdfPath>
246  HD_API
247  const SdfPathVector &GetRprimIds() { return _rprimIds.GetIds(); }
248 
249 
250  /// Returns the subtree rooted under the given path.
251  HD_API
253 
254 
255  // ---------------------------------------------------------------------- //
256  /// \name Instancer Support
257  // ---------------------------------------------------------------------- //
258 
259  /// Insert an instancer into index
260  HD_API
261  void InsertInstancer(HdSceneDelegate* delegate,
262  SdfPath const &id,
263  SdfPath const &parentId = SdfPath());
264 
265  /// Remove an instancer from index
266  HD_API
267  void RemoveInstancer(SdfPath const& id);
268 
269  /// Returns true if instancer \p id exists in index.
270  bool HasInstancer(SdfPath const& id) {
271  return _instancerMap.find(id) != _instancerMap.end();
272  }
273 
274  /// Returns the instancer of id
275  HD_API
276  HdInstancer *GetInstancer(SdfPath const &id) const;
277 
278  // ---------------------------------------------------------------------- //
279  /// \name Task Support
280  // ---------------------------------------------------------------------- //
281 
282  /// Inserts a new task into the render index with an identifier of \p id.
283  template <typename T>
284  void InsertTask(HdSceneDelegate* delegate, SdfPath const& id);
285 
286  /// Removes the given task from the RenderIndex.
287  HD_API
288  void RemoveTask(SdfPath const& id);
289 
290  /// Returns true if a task exists in the index with the given \p id.
291  bool HasTask(SdfPath const& id) {
292  return _taskMap.find(id) != _taskMap.end();
293  }
294 
295  /// Returns the task for the given \p id.
296  HD_API
297  HdTaskSharedPtr const& GetTask(SdfPath const& id) const;
298 
299  // ---------------------------------------------------------------------- //
300  /// \name Scene state prims (e.g. camera, light)
301  // ---------------------------------------------------------------------- //
302 
303  /// Returns whether the sprim type is supported by this render index.
304  HD_API
305  bool IsSprimTypeSupported(TfToken const& typeId) const;
306 
307  /// Insert a sprim into index
308  HD_API
309  void InsertSprim(TfToken const& typeId,
310  HdSceneDelegate* delegate,
311  SdfPath const& sprimId);
312 
313  HD_API
314  void RemoveSprim(TfToken const& typeId, SdfPath const &id);
315 
316  HD_API
317  HdSprim *GetSprim(TfToken const& typeId, SdfPath const &id) const;
318 
319  /// Returns the subtree rooted under the given path for the given sprim
320  /// type.
321  HD_API
322  SdfPathVector GetSprimSubtree(TfToken const& typeId,
323  SdfPath const& root);
324 
325  /// Returns the fullback prim for the Sprim of the given type.
326  HD_API
327  HdSprim *GetFallbackSprim(TfToken const& typeId) const;
328 
329 
330  // ---------------------------------------------------------------------- //
331  /// \name Buffer prims (e.g. textures, buffers)
332  // ---------------------------------------------------------------------- //
333 
334  /// Returns whether the bprim type is supported by this render index.
335  HD_API
336  bool IsBprimTypeSupported(TfToken const& typeId) const;
337 
338  /// Insert a bprim into index
339  HD_API
340  void InsertBprim(TfToken const& typeId,
341  HdSceneDelegate* delegate,
342  SdfPath const& bprimId);
343 
344  HD_API
345  void RemoveBprim(TfToken const& typeId, SdfPath const &id);
346 
347  HD_API
348  HdBprim *GetBprim(TfToken const& typeId, SdfPath const &id) const;
349 
350  /// Returns the subtree rooted under the given path for the given bprim
351  /// type.
352  HD_API
353  SdfPathVector GetBprimSubtree(TfToken const& typeId,
354  SdfPath const& root);
355 
356  /// Returns the fallback prim for the Bprim of the given type.
357  HD_API
358  HdBprim *GetFallbackBprim(TfToken const& typeId) const;
359 
360  /// Helper utility to convert texture resource id's which are unique
361  /// to this render index, into a globally unique texture key
362  HD_API
365 
366 
367  // ---------------------------------------------------------------------- //
368  /// \name Render Delegate
369  // ---------------------------------------------------------------------- //
370  /// Currently, a render index only supports connection to one type of
371  /// render delegate, due to the inserted information and change tracking
372  /// being specific to that delegate type.
373  HD_API
375 
376  // The render delegate may require access to a render context / device
377  // that is provided by the application.
378  HD_API
379  HdDriverVector const& GetDrivers() const;
380 
381  /// Returns a shared ptr to the resource registry of the current render
382  /// delegate.
383  HD_API
385 
386 private:
387  // The render index constructor is private so we can check
388  // renderDelegate before construction: see HdRenderIndex::New(...).
390  HdRenderDelegate *renderDelegate,
391  HdDriverVector const& drivers);
392 
393  // ---------------------------------------------------------------------- //
394  // Private Helper methods
395  // ---------------------------------------------------------------------- //
396 
397  // Go through all RPrims and reallocate their instance ids
398  // This is called once we have exhausted all all 24bit instance ids.
399  void _CompactPrimIds();
400 
401  // Allocate the next available instance id to the prim
402  void _AllocatePrimId(HdRprim* prim);
403 
404  // Inserts the task into the index and updates tracking state.
405  // _TrackDelegateTask is called by the inlined InsertTask<T>, so it needs
406  // to be marked HD_API.
407  HD_API
408  void _TrackDelegateTask(HdSceneDelegate* delegate,
409  SdfPath const& taskId,
410  HdTaskSharedPtr const& task);
411 
412  template <typename T>
413  static inline const TfToken & _GetTypeId();
414 
415  void _RemoveRprimSubtree(const SdfPath &root,
416  HdSceneDelegate* sceneDelegate);
417  void _RemoveInstancerSubtree(const SdfPath &root,
418  HdSceneDelegate* sceneDelegate);
419  void _RemoveExtComputationSubtree(const SdfPath &root,
420  HdSceneDelegate* sceneDelegate);
421  void _RemoveTaskSubtree(const SdfPath &root,
422  HdSceneDelegate* sceneDelegate);
423 
424  // ---------------------------------------------------------------------- //
425  // Index State
426  // ---------------------------------------------------------------------- //
427  struct _RprimInfo {
428  HdSceneDelegate *sceneDelegate;
429  HdRprim *rprim;
430  };
431 
432  struct _TaskInfo {
433  HdSceneDelegate *sceneDelegate;
434  HdTaskSharedPtr task;
435  };
436 
437  typedef std::unordered_map<SdfPath, _TaskInfo, SdfPath::Hash> _TaskMap;
439  typedef std::vector<SdfPath> _RprimPrimIDVector;
440 
441  typedef Hd_PrimTypeIndex<HdSprim> _SprimIndex;
442  typedef Hd_PrimTypeIndex<HdBprim> _BprimIndex;
443 
444  _RprimMap _rprimMap;
445  Hd_SortedIds _rprimIds;
446 
447  _RprimPrimIDVector _rprimPrimIdMap;
448 
449  _TaskMap _taskMap;
450 
451  _SprimIndex _sprimIndex;
452  _BprimIndex _bprimIndex;
453 
454  HdChangeTracker _tracker;
455 
457  _InstancerMap _instancerMap;
458 
459  struct _SyncQueueEntry {
460  HdDirtyListSharedPtr dirtyList;
461  HdRprimCollection collection;
462 
463  };
464  typedef std::vector<_SyncQueueEntry> _SyncQueue;
465  _SyncQueue _syncQueue;
466 
467  /// With the removal of task-based collection include/exclude path
468  /// filtering, HdDirtyLists were generating their lists of dirty rprim IDs
469  /// by looking through every rprim in the render index. When the number of
470  /// tasks/render passes/dirty lists grew large, this resulted in
471  /// significant overhead and lots of duplication of work.
472  /// Instead, the render index itself now takes care of generating the
473  /// complete list of dirty rprim IDs when requested by the HdDirtyList.
474  /// During SyncAll(), the first HdDirtyList to request the list of dirty
475  /// IDs for a given HdDirtyBits mask triggers the render index to produce
476  /// that list and cache it in a map. Subsequent requests reuse the cached
477  /// list. At the end of SyncAll(), the map is cleared in preparation for
478  /// the next sync.
479  std::unordered_map<HdDirtyBits, const SdfPathVector> _dirtyRprimIdsMap;
480 
481  friend class HdDirtyList;
482  const SdfPathVector& _GetDirtyRprimIds(HdDirtyBits mask);
483 
484  HdRenderDelegate *_renderDelegate;
485  HdDriverVector _drivers;
486 
487  // ---------------------------------------------------------------------- //
488  // Sync State
489  // ---------------------------------------------------------------------- //
490  TfTokenVector _activeRenderTags;
491  unsigned int _renderTagVersion;
492 
493  /// Register the render delegate's list of supported prim types.
494  void _InitPrimTypes();
495 
496  /// Creates fallback prims for each supported prim type.
497  bool _CreateFallbackPrims();
498 
499  /// Release the fallback prims.
500  void _DestroyFallbackPrims();
501 
502  void _GatherRenderTags(const HdTaskSharedPtrVector *tasks);
503 
504  typedef tbb::enumerable_thread_specific<HdDrawItemPtrVector>
505  _ConcurrentDrawItems;
506 
507  void _AppendDrawItems(const SdfPathVector &rprimIds,
508  size_t begin,
509  size_t end,
510  HdRprimCollection const& collection,
511  _ConcurrentDrawItems* result);
512 
513  /// Register core hydra reprs. Only ever called once, the first time
514  /// a render index is created.
515  /// XXX: This code should move to the application layer.
516  static void _ConfigureReprs();
517 
518  // Remove default constructor
519  HdRenderIndex() = delete;
520 
521  // Don't allow copies
522  HdRenderIndex(const HdRenderIndex &) = delete;
523  HdRenderIndex &operator=(const HdRenderIndex &) = delete;
524 
525 };
526 
527 template <typename T>
528 void
530 {
533 
534  HdTaskSharedPtr task = std::make_shared<T>(delegate, id);
535  _TrackDelegateTask(delegate, id, task);
536 }
537 
539 
540 #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:529
GLuint id
Definition: glew.h:1679
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.
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
Definition: format.h:251
HD_API void EnqueuePrimsToSync(HdDirtyListSharedPtr const &dirtyList, HdRprimCollection const &collection)
iterator end()
Definition: hashmap.h:318
std::vector< HdDrawItem const * > HdDrawItemPtrVector
Definition: renderIndex.h:120
uint32_t HdDirtyBits
Definition: types.h:127
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:291
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 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.
GLenum GLint GLuint mask
Definition: glew.h:1845
std::vector< HdTaskSharedPtr > HdTaskSharedPtrVector
Definition: renderIndex.h:70
HD_API HdRprim const * GetRprim(SdfPath const &id) const
Returns the rprim of id.
HdChangeTracker const & GetChangeTracker() const
Definition: renderIndex.h:195
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:217
HD_API SdfPathVector GetSprimSubtree(TfToken const &typeId, SdfPath const &root)
Definition: token.h:87
std::vector< HdDriver * > HdDriverVector
HD_API HdResourceRegistrySharedPtr GetResourceRegistry() const
HD_API void SyncAll(HdTaskSharedPtrVector *tasks, HdTaskContext *taskContext)
Definition: rprim.h:68
HD_API void RemoveBprim(TfToken const &typeId, SdfPath const &id)
Returns whether the bprim type is supported by this render index.
#define HD_TRACE_FUNCTION()
Definition: perfLog.h:57
GLuint GLuint end
Definition: glew.h:1253
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:446
HD_API void InsertInstancer(HdSceneDelegate *delegate, SdfPath const &id, SdfPath const &parentId=SdfPath())
Insert an instancer into index.
HD_API TfToken GetMaterialTag(SdfPath const &id) const
Return the material tag for the given rprim.
Definition: path.h:288
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:209
HD_API HdSprim * GetFallbackSprim(TfToken const &typeId) const
Returns the fullback prim for the Sprim of the given type.
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:73
Definition: sprim.h:52
HD_API bool GetSceneDelegateAndInstancerIds(SdfPath const &id, SdfPath *sceneDelegateId, SdfPath *instancerId) const
HdChangeTracker & GetChangeTracker()
Definition: renderIndex.h:194
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
HD_API const SdfPathVector & GetRprimIds()
Definition: renderIndex.h:247
HD_API HdResourceRegistry::TextureKey GetTextureKey(HdTextureResource::ID id) const
static HD_API HdRenderIndex * New(HdRenderDelegate *renderDelegate, HdDriverVector const &drivers)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
HD_API void InsertRprim(TfToken const &typeId, HdSceneDelegate *sceneDelegate, SdfPath const &rprimId, SdfPath const &instancerId=SdfPath())
Insert a rprim into index.
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.
GLuint64EXT * result
Definition: glew.h:14007
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.
std::shared_ptr< class HdDirtyList > HdDirtyListSharedPtr
Definition: dirtyList.h:39
HD_API void RemoveRprim(SdfPath const &id)
Remove a rprim from index.
Definition: value.h:174
std::shared_ptr< class HdTask > HdTaskSharedPtr
Definition: renderIndex.h:67
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:270