changeTracker.h
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_CHANGE_TRACKER_H
25 #define PXR_IMAGING_HD_CHANGE_TRACKER_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/version.h"
30 #include "pxr/imaging/hd/rprimCollection.h"
31 #include "pxr/imaging/hd/types.h"
32 #include "pxr/usd/sdf/path.h"
33 #include "pxr/base/tf/hashmap.h"
34 
35 #include <tbb/concurrent_hash_map.h>
36 #include <atomic>
37 
38 PXR_NAMESPACE_OPEN_SCOPE
39 
41 
52 {
53 public:
54 
55  // Common dirty bits for Rprims
56  // XXX: Move this to HdRprim
57  enum RprimDirtyBits : HdDirtyBits {
58  Clean = 0,
59  InitRepr = 1 << 0,
60  Varying = 1 << 1,
61  AllDirty = ~Varying,
62  DirtyPrimID = 1 << 2,
63  DirtyExtent = 1 << 3,
64  DirtyDisplayStyle = 1 << 4,
65  DirtyPoints = 1 << 5,
66  DirtyPrimvar = 1 << 6,
67  DirtyMaterialId = 1 << 7,
68  DirtyTopology = 1 << 8,
69  DirtyTransform = 1 << 9,
70  DirtyVisibility = 1 << 10,
71  DirtyNormals = 1 << 11,
72  DirtyDoubleSided = 1 << 12,
73  DirtyCullStyle = 1 << 13,
74  DirtySubdivTags = 1 << 14,
75  DirtyWidths = 1 << 15,
76  DirtyInstancer = 1 << 16,
77  DirtyInstanceIndex = 1 << 17,
78  DirtyRepr = 1 << 18,
79  DirtyRenderTag = 1 << 19,
80  DirtyComputationPrimvarDesc = 1 << 20,
81  DirtyCategories = 1 << 21,
82  DirtyVolumeField = 1 << 22,
83  AllSceneDirtyBits = ((1<<23) - 1),
84 
85  NewRepr = 1 << 23,
86 
87  CustomBitsBegin = 1 << 24,
88  CustomBitsEnd = 1 << 30,
89  CustomBitsMask = 0x7f << 24,
90  };
91 
92  // InstancerDirtybits are a subset of rprim dirty bits right now:
93  // DirtyPrimvar, DirtyTransform, DirtyInstanceIndex, DirtyInstancer.
94 
95  // Dirty bits for Tasks
96  // XXX: Move this to HdTask
97  enum TaskDirtyBits : HdDirtyBits {
98  //Varying = 1 << 0,
99  DirtyType = 1 << 1,
100  DirtyParams = 1 << 2,
101  DirtyCollection = 1 << 3,
102  DirtyRenderTags = 1 << 4,
103  };
104 
105  HD_API
106  HdChangeTracker();
107  HD_API
108  virtual ~HdChangeTracker();
109 
110  // ---------------------------------------------------------------------- //
113  // ---------------------------------------------------------------------- //
114 
116  HD_API
117  void RprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
118 
120  HD_API
121  void RprimRemoved(SdfPath const& id);
122 
123  // ---------------------------------------------------------------------- //
127  // ---------------------------------------------------------------------- //
128 
130  HD_API
131  HdDirtyBits GetRprimDirtyBits(SdfPath const& id) const;
132 
135  HD_API
136  void MarkRprimDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
137 
141  HD_API
142  void MarkRprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
143 
145  HD_API
146  void MarkPrimvarDirty(SdfPath const& id, TfToken const& name);
147 
151  HD_API
152  void MarkAllRprimsDirty(HdDirtyBits bits);
153 
161  HD_API
162  void ResetVaryingState();
163 
167  HD_API
168  void ResetRprimVaryingState(SdfPath const& id);
169 
170 
171  // ---------------------------------------------------------------------- //
172 
174  HD_API
175  bool IsRprimDirty(SdfPath const& id);
176 
178  HD_API
179  bool IsExtentDirty(SdfPath const& id);
180 
182  HD_API
183  bool IsDisplayStyleDirty(SdfPath const& id);
184 
187  HD_API
188  bool IsPrimvarDirty(SdfPath const& id, TfToken const& name);
189 
191  HD_API
192  bool IsAnyPrimvarDirty(SdfPath const& id);
193 
195  HD_API
196  bool IsTopologyDirty(SdfPath const& id);
197 
199  HD_API
200  bool IsDoubleSidedDirty(SdfPath const& id);
201 
203  HD_API
204  bool IsCullStyleDirty(SdfPath const& id);
205 
207  HD_API
208  bool IsSubdivTagsDirty(SdfPath const& id);
209 
211  HD_API
212  bool IsTransformDirty(SdfPath const& id);
213 
215  HD_API
216  bool IsVisibilityDirty(SdfPath const& id);
217 
219  HD_API
220  bool IsPrimIdDirty(SdfPath const& id);
221 
224  static bool IsDirty(HdDirtyBits dirtyBits) {
225  return (dirtyBits & AllDirty) != 0;
226  }
227 
229  static bool IsClean(HdDirtyBits dirtyBits) {
230  return (dirtyBits & AllDirty) == 0;
231  }
232 
234  static bool IsVarying(HdDirtyBits dirtyBits) {
235  return (dirtyBits & Varying) != 0;
236  }
237 
239  HD_API
240  static bool IsExtentDirty(HdDirtyBits dirtyBits, SdfPath const& id);
241 
243  HD_API
244  static bool IsDisplayStyleDirty(HdDirtyBits dirtyBits, SdfPath const& id);
245 
247  HD_API
248  static bool IsSubdivTagsDirty(HdDirtyBits dirtyBits, SdfPath const& id);
249 
252  HD_API
253  static bool IsPrimvarDirty(HdDirtyBits dirtyBits, SdfPath const& id,
254  TfToken const& name);
255 
258  HD_API
259  static bool IsAnyPrimvarDirty(HdDirtyBits dirtyBits, SdfPath const& id);
260 
262  HD_API
263  static bool IsTopologyDirty(HdDirtyBits dirtyBits, SdfPath const& id);
264 
266  HD_API
267  static bool IsDoubleSidedDirty(HdDirtyBits dirtyBits, SdfPath const& id);
268 
270  HD_API
271  static bool IsCullStyleDirty(HdDirtyBits dirtyBits, SdfPath const& id);
272 
274  HD_API
275  static bool IsTransformDirty(HdDirtyBits dirtyBits, SdfPath const& id);
276 
278  HD_API
279  static bool IsVisibilityDirty(HdDirtyBits dirtyBits, SdfPath const& id);
280 
282  HD_API
283  static bool IsPrimIdDirty(HdDirtyBits dirtyBits, SdfPath const& id);
284 
286  HD_API
287  static bool IsInstancerDirty(HdDirtyBits dirtyBits, SdfPath const& id);
288 
290  HD_API
291  static bool IsInstanceIndexDirty(HdDirtyBits dirtyBits, SdfPath const& id);
292 
293  HD_API
294  static bool IsReprDirty(HdDirtyBits dirtyBits, SdfPath const &id);
295 
296  // ---------------------------------------------------------------------- //
297 
299  HD_API
300  static void MarkPrimvarDirty(HdDirtyBits *dirtyBits, TfToken const &name);
301 
302  // ---------------------------------------------------------------------- //
306  // ---------------------------------------------------------------------- //
307 
309  HD_API
310  void TaskInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
311 
313  HD_API
314  void TaskRemoved(SdfPath const& id);
315 
317  HD_API
318  void MarkTaskDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
319 
321  HD_API
322  HdDirtyBits GetTaskDirtyBits(SdfPath const& id);
323 
325  HD_API
326  void MarkTaskClean(SdfPath const& id, HdDirtyBits newBits=Clean);
327 
330  HD_API
331  unsigned GetRenderTagVersion() const;
332 
334  HD_API
335  unsigned GetTaskRenderTagsVersion() const;
336 
337  // ---------------------------------------------------------------------- //
341  // ---------------------------------------------------------------------- //
342 
344  HD_API
345  void InstancerInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
346 
348  HD_API
349  void InstancerRemoved(SdfPath const& id);
350 
352  HD_API
353  HdDirtyBits GetInstancerDirtyBits(SdfPath const& id);
354 
357  HD_API
358  void MarkInstancerDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
359 
361  HD_API
362  void MarkInstancerClean(SdfPath const& id, HdDirtyBits newBits=Clean);
363 
367  HD_API
368  void AddInstancerRprimDependency(SdfPath const& instancerId,
369  SdfPath const& rprimId);
370 
373  HD_API
374  void RemoveInstancerRprimDependency(SdfPath const& instancerId,
375  SdfPath const& rprimId);
376 
380  HD_API
381  void AddInstancerInstancerDependency(SdfPath const& parentInstancerId,
382  SdfPath const& instancerId);
383 
386  HD_API
387  void RemoveInstancerInstancerDependency(SdfPath const& parentInstancerId,
388  SdfPath const& instancerId);
389 
390  // ---------------------------------------------------------------------- //
394  // ---------------------------------------------------------------------- //
395 
397  HD_API
398  void SprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
399 
401  HD_API
402  void SprimRemoved(SdfPath const& id);
403 
405  HD_API
406  HdDirtyBits GetSprimDirtyBits(SdfPath const& id);
407 
409  HD_API
410  void MarkSprimDirty(SdfPath const& id, HdDirtyBits bits);
411 
413  HD_API
414  void MarkSprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
415 
418  HD_API
419  void AddSprimSprimDependency(SdfPath const& parentSprimId,
420  SdfPath const& sprimId);
421 
424  HD_API
425  void RemoveSprimSprimDependency(SdfPath const& parentSprimId,
426  SdfPath const& sprimId);
427 
429  HD_API
430  void RemoveSprimFromSprimSprimDependencies(SdfPath const& sprimId);
431 
432  // ---------------------------------------------------------------------- //
436  // ---------------------------------------------------------------------- //
437 
439  HD_API
440  void BprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
441 
443  HD_API
444  void BprimRemoved(SdfPath const& id);
445 
447  HD_API
448  HdDirtyBits GetBprimDirtyBits(SdfPath const& id);
449 
451  HD_API
452  void MarkBprimDirty(SdfPath const& id, HdDirtyBits bits);
453 
455  HD_API
456  void MarkBprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
457 
458  // ---------------------------------------------------------------------- //
462  // ---------------------------------------------------------------------- //
463 
465  HD_API
466  void AddCollection(TfToken const& collectionName);
467 
470  HD_API
471  void MarkCollectionDirty(TfToken const& collectionName);
472 
474  HD_API
475  unsigned GetCollectionVersion(TfToken const& collectionName) const;
476 
479  HD_API
480  unsigned GetVisibilityChangeCount() const;
481 
484  unsigned GetVaryingStateVersion() const {
485  return _varyingStateVersion;
486  }
487 
488  // ---------------------------------------------------------------------- //
492  // ---------------------------------------------------------------------- //
493 
497  unsigned GetRprimIndexVersion() const {
498  return _rprimIndexVersion;
499  }
500 
504  unsigned GetSprimIndexVersion() const {
505  return _sprimIndexVersion;
506  }
507 
511  unsigned GetBprimIndexVersion() const {
512  return _bprimIndexVersion;
513  }
514 
518  unsigned GetInstancerIndexVersion() const {
519  return _instancerIndexVersion;
520  }
521 
522 
528  unsigned GetSceneStateVersion() const {
529  return _sceneStateVersion;
530  }
531 
532  // ---------------------------------------------------------------------- //
536  // ---------------------------------------------------------------------- //
537 
539  HD_API
540  void AddState(TfToken const& name);
541 
544  HD_API
545  void MarkStateDirty(TfToken const& name);
546 
548  HD_API
549  unsigned GetStateVersion(TfToken const &name) const;
550 
551  // ---------------------------------------------------------------------- //
555  // ---------------------------------------------------------------------- //
556  HD_API
557  static std::string StringifyDirtyBits(HdDirtyBits dirtyBits);
558 
559  HD_API
560  static void DumpDirtyBits(HdDirtyBits dirtyBits);
561 
563 
564 private:
565 
566  // Don't allow copies
567  HdChangeTracker(const HdChangeTracker &) = delete;
568  HdChangeTracker &operator=(const HdChangeTracker &) = delete;
569 
570 
571  static void _LogCacheAccess(TfToken const& cacheName,
572  SdfPath const& id, bool hit);
573 
574  typedef TfHashMap<SdfPath, HdDirtyBits, SdfPath::Hash> _IDStateMap;
575  typedef TfHashMap<TfToken, int, TfToken::HashFunctor> _CollectionStateMap;
576  typedef TfHashMap<TfToken, unsigned, TfToken::HashFunctor> _GeneralStateMap;
577 
578  struct _PathHashCompare {
579  static bool equal(const SdfPath& a, const SdfPath& b)
580  { return a == b; }
581 
582  static size_t hash(const SdfPath& path)
583  { return hash_value(path); }
584  };
585  typedef tbb::concurrent_hash_map<SdfPath, SdfPathSet, _PathHashCompare>
586  _DependencyMap;
587 
588  // Core dirty state.
589  _IDStateMap _rprimState;
590  _IDStateMap _instancerState;
591  _IDStateMap _taskState;
592  _IDStateMap _sprimState;
593  _IDStateMap _bprimState;
594  _GeneralStateMap _generalState;
595 
596  // Collection versions / state.
597  _CollectionStateMap _collectionState;
598 
599  // Provides reverse-association between instancers and the child
600  // instancers/rprims that use them.
601  _DependencyMap _instancerRprimDependencies;
602  _DependencyMap _instancerInstancerDependencies;
603 
604  // Provides forward and reverse-association between sprims and the child
605  // sprims that reference them. For example, a light prim (child) who needs
606  // to know when its light filter (parent) is modified.
607  // Maps parent sprim to child sprim.
608  _DependencyMap _sprimSprimTargetDependencies;
609  // Maps child sprim to parent sprim.
610  _DependencyMap _sprimSprimSourceDependencies;
611 
612  // Dependency map helpers
613  void _AddDependency(_DependencyMap &depMap,
614  SdfPath const& parent, SdfPath const& child);
615  void _RemoveDependency(_DependencyMap &depMap,
616  SdfPath const& parent, SdfPath const& child);
617 
618  // Typically the Rprims that get marked dirty per update iteration end up
619  // being a stable set of objects; to leverage this fact, we require the
620  // delegate notify the change tracker when that state changes, which bumps
621  // the varyingStateVersion, which triggers downstream invalidation.
622  unsigned _varyingStateVersion;
623 
624  // Tracks changes (insertions/removals) of prims in the render index.
625  // This is used to indicating that cached gather operations need to be
626  // re-evaluated, such as dirty lists or batch building.
627  unsigned _rprimIndexVersion;
628  unsigned _sprimIndexVersion;
629  unsigned _bprimIndexVersion;
630  unsigned _instancerIndexVersion;
631 
632  // The following tracks any changes of state. As a result it is very broad.
633  // The use case to detect, when no changes have been made, as to
634  // avoid the need to sync or reset progressive renderers.
635  unsigned _sceneStateVersion;
636 
637  // Used to detect that visibility changed somewhere in the render index.
638  unsigned _visChangeCount;
639 
640  // Used to detect changes to the render tag opinion of rprims.
641  unsigned _rprimRenderTagVersion;
642 
643  // Used to detect changes to the render tags opinion of tasks.
644  unsigned _taskRenderTagsVersion;
645 
646  // Allow HdRenderIndex to provide a scene index to forward dirty
647  // information. This is necessary to accommodate legacy HdSceneDelegate
648  // based applications that rely on the HdChangeTracker for invalidating
649  // state on Hydra prims.
650  friend class HdRenderIndex;
651  // Does not take ownership. The HdRenderIndex manages the lifetime of this
652  // scene index.
653  HdRetainedSceneIndex * _emulationSceneIndex;
654  void _SetTargetSceneIndex(HdRetainedSceneIndex *emulationSceneIndex);
655 
656  // Private methods which implement the behaviors of their public
657  // equivalents. The public versions check to see if legacy emulation is
658  // active. If so, they dirty the HdRetainedSceneIndex member instead
659  // of directly acting. If legacy render delegate emulation is active, these
660  // will eventually make their way back to the private methods via
661  // HdSceneIndexAdapterSceneDelegate. This prevents dirtying cycles while
662  // allowing single HdRenderIndex/HdChangeTracker instances to be used for
663  // both ends of emulation.
665  void _MarkRprimDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
666  void _MarkSprimDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
667  void _MarkBprimDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
668  void _MarkInstancerDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
669 };
670 
671 
672 PXR_NAMESPACE_CLOSE_SCOPE
673 
674 #endif //PXR_IMAGING_HD_CHANGE_TRACKER_H
HD_API void ResetRprimVaryingState(SdfPath const &id)
Reset the varying state on one Rprim This is done for Rprims, where we choose not to clean them (due ...
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:120
HD_API void MarkInstancerClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Clean the specified dirty bits for the instancer with id.
HD_API void MarkBprimDirty(SdfPath const &id, HdDirtyBits bits)
Set the dirty flags to bits.
HD_API HdDirtyBits GetTaskDirtyBits(SdfPath const &id)
Get the dirty bits for Task with the given id.
HD_API void MarkPrimvarDirty(SdfPath const &id, TfToken const &name)
Mark the primvar for the rprim with id as being dirty.
Tracks changes from the HdSceneDelegate, providing invalidation cues to the render engine.
Definition: changeTracker.h:51
HD_API void RprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking Rprim with the given id.
HD_API void SprimRemoved(SdfPath const &id)
Stop tracking sprim with the given id.
HD_API void MarkTaskClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
HD_API bool IsCullStyleDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty cullstyle.
static HD_API bool IsInstanceIndexDirty(HdDirtyBits dirtyBits, SdfPath const &id)
Returns true if the dirtyBits has a dirty instance index. id is for perflog.
static bool IsVarying(HdDirtyBits dirtyBits)
Returns true if the varying flag is set.
HD_API void MarkRprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Clear the dirty flags for an HdRprim.
HD_API HdDirtyBits GetInstancerDirtyBits(SdfPath const &id)
Returns the dirty bits for the instancer with id.
HD_API void BprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking bprim with the given id.
HD_API bool IsAnyPrimvarDirty(SdfPath const &id)
Returns true if the rprim identified by id has any dirty primvars.
HD_API unsigned GetStateVersion(TfToken const &name) const
Returns the current version of the named state.
HD_API void MarkInstancerDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
Flag the Instancer with the given id as being dirty.
HD_API HdDirtyBits GetSprimDirtyBits(SdfPath const &id)
Get the dirty bits for sprim with the given id.
HD_API void InstancerRemoved(SdfPath const &id)
Stop tracking Instancer with the given id.
Concrete scene container which can be externally populated and dirtied.
HD_API void TaskInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking Task with the given id.
HD_API void MarkStateDirty(TfToken const &name)
Marks a named state as being dirty., this bumps the version of the state.
HD_API bool IsDoubleSidedDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty doubleSided state.
HD_API unsigned GetTaskRenderTagsVersion() const
Retrieve the current version number of the task's render tags opinion.
HD_API HdDirtyBits GetBprimDirtyBits(SdfPath const &id)
Get the dirty bits for bprim with the given id.
Scene delegate which observes notices from an HdSceneIndex and applies them to an HdRenderIndex.
HD_API bool IsTransformDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty transform.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
HD_API bool IsRprimDirty(SdfPath const &id)
Returns true if the rprim identified by id has any dirty flags set.
HD_API unsigned GetCollectionVersion(TfToken const &collectionName) const
Returns the current version of the named collection.
HD_API bool IsPrimIdDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty primID.
HD_API void RemoveSprimFromSprimSprimDependencies(SdfPath const &sprimId)
Remove all dependencies involving sprimId as a parent or child.
HD_API void MarkSprimDirty(SdfPath const &id, HdDirtyBits bits)
Set the dirty flags to bits.
unsigned GetInstancerIndexVersion() const
Returns the current version of the Render Index's Instancer set.
HD_API void ResetVaryingState()
Clear Varying bit of all prims.
HD_API void MarkTaskDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
Set the dirty flags to bits.
HD_API void MarkCollectionDirty(TfToken const &collectionName)
Marks a named collection as being dirty, this bumps the version of the collection.
static bool IsDirty(HdDirtyBits dirtyBits)
Returns true if the dirtyBits has any flags set other than the varying flag.
unsigned GetRprimIndexVersion() const
Returns the current version of the Render Index's RPrim set.
HD_API void AddInstancerRprimDependency(SdfPath const &instancerId, SdfPath const &rprimId)
Insert a dependency between rprimId and parent instancer instancerId.
HD_API void MarkBprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
HD_API void InstancerInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking Instancer with the given id.
HD_API bool IsTopologyDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty topology.
static bool IsClean(HdDirtyBits dirtyBits)
Returns true if the dirtyBits has no flags set except the varying flag.
HD_API void AddCollection(TfToken const &collectionName)
Adds a named collection for tracking.
HD_API void BprimRemoved(SdfPath const &id)
Stop tracking bprim with the given id.
HD_API void MarkRprimDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
Flag the Rprim with the given id as being dirty.
HD_API void MarkAllRprimsDirty(HdDirtyBits bits)
Flag all the Rprim with the given id as being dirty.
unsigned GetSceneStateVersion() const
Returns the current version of the scene state.
std::enable_if< std::is_same< Half, half >::value, size_t >::type hash_value(const Half &h)
Overload hash_value for half.
Definition: half.h:50
unsigned GetSprimIndexVersion() const
Returns the current version of the Render Index's SPrim set.
HD_API bool IsVisibilityDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty visibility.
HD_API bool IsSubdivTagsDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty subdiv tags.
HD_API void AddSprimSprimDependency(SdfPath const &parentSprimId, SdfPath const &sprimId)
Insert a dependency between sprimId and parent sprim parentSprimId.
HD_API void SprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking sprim with the given id.
HD_API bool IsExtentDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty extent.
HD_API bool IsDisplayStyleDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty display style.
HD_API void MarkSprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
HD_API void AddState(TfToken const &name)
Adds a named state for tracking.
unsigned GetVaryingStateVersion() const
Returns the current version of varying state.
unsigned GetBprimIndexVersion() const
Returns the current version of the Render Index's BPrim set.
HD_API void RprimRemoved(SdfPath const &id)
Stop tracking Rprim with the given id.
HD_API void RemoveInstancerRprimDependency(SdfPath const &instancerId, SdfPath const &rprimId)
Remove a dependency between rprimId and parent instancer instancerId.
HD_API unsigned GetVisibilityChangeCount() const
Returns the number of changes to visibility.
HD_API HdDirtyBits GetRprimDirtyBits(SdfPath const &id) const
Returns the dirty bits for the rprim with id.
HD_API void RemoveInstancerInstancerDependency(SdfPath const &parentInstancerId, SdfPath const &instancerId)
Remove a dependency between instancerId and parent instancer parentInstancerId.
HD_API void RemoveSprimSprimDependency(SdfPath const &parentSprimId, SdfPath const &sprimId)
Remove a dependency between sprimId and parent sprim parentSprimId.
HD_API bool IsPrimvarDirty(SdfPath const &id, TfToken const &name)
Returns true if the rprim identified by id with primvar name is dirty.
static HD_API bool IsInstancerDirty(HdDirtyBits dirtyBits, SdfPath const &id)
Returns true if the dirtyBits has a dirty instancer. id is for perflog.
HD_API void AddInstancerInstancerDependency(SdfPath const &parentInstancerId, SdfPath const &instancerId)
Insert a dependency between instancerId and parent instancer parentInstancerId.
HD_API unsigned GetRenderTagVersion() const
Retrieve the current version number of the rprim render tag set XXX Rename to GetRprimRenderTagVersio...
HD_API void TaskRemoved(SdfPath const &id)
Stop tracking Task with the given id.