HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
changeTracker.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_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"
31 #include "pxr/imaging/hd/types.h"
32 #include "pxr/usd/sdf/path.h"
33 #include "pxr/base/tf/hashmap.h"
34 
35 #include <atomic>
36 
38 
39 
40 /// \class HdChangeTracker
41 ///
42 /// Tracks changes from the HdSceneDelegate, providing invalidation cues to the
43 /// render engine.
44 ///
45 /// Changes flagged here are accumulated until the next time resource associated
46 /// with the change is required, at which point the resource is updated and the
47 /// flag is cleared.
48 ///
50 {
51 public:
52 
53  // Common dirty bits for Rprims
54  // XXX: Move this to HdRprim
56  Clean = 0,
57  InitRepr = 1 << 0,
58  Varying = 1 << 1,
60  DirtyPrimID = 1 << 2,
61  DirtyExtent = 1 << 3,
63  DirtyPoints = 1 << 5,
64  DirtyPrimvar = 1 << 6,
65  DirtyMaterialId = 1 << 7,
66  DirtyTopology = 1 << 8,
67  DirtyTransform = 1 << 9,
68  DirtyVisibility = 1 << 10,
69  DirtyNormals = 1 << 11,
70  DirtyDoubleSided = 1 << 12,
71  DirtyCullStyle = 1 << 13,
72  DirtySubdivTags = 1 << 14,
73  DirtyWidths = 1 << 15,
74  DirtyInstancer = 1 << 16,
75  DirtyInstanceIndex = 1 << 17,
76  DirtyRepr = 1 << 18,
77  DirtyRenderTag = 1 << 19,
79  DirtyCategories = 1 << 21,
80  DirtyVolumeField = 1 << 22,
81  AllSceneDirtyBits = ((1<<23) - 1),
82 
83  NewRepr = 1 << 23,
84 
85  CustomBitsBegin = 1 << 24,
86  CustomBitsEnd = 1 << 30,
87  };
88 
89  // InstancerDirtybits are a subset of rprim dirty bits right now:
90  // DirtyPrimvar, DirtyTransform, DirtyInstanceIndex, DirtyInstancer.
91 
92  // Dirty bits for Tasks
93  // XXX: Move this to HdTask
95  //Varying = 1 << 0,
96  DirtyType = 1 << 1,
97  DirtyParams = 1 << 2,
98  DirtyCollection = 1 << 3,
99  DirtyRenderTags = 1 << 4,
100  };
101 
102  HD_API
103  HdChangeTracker();
104  HD_API
105  virtual ~HdChangeTracker();
106 
107  // ---------------------------------------------------------------------- //
108  /// \name Rprim Object Tracking
109  /// @{
110  // ---------------------------------------------------------------------- //
111 
112  /// Start tracking Rprim with the given \p id.
113  HD_API
114  void RprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
115 
116  /// Stop tracking Rprim with the given \p id.
117  HD_API
118  void RprimRemoved(SdfPath const& id);
119 
120  // ---------------------------------------------------------------------- //
121  /// @}
122  /// \name Rprim State Tracking
123  /// @{
124  // ---------------------------------------------------------------------- //
125 
126  /// Returns the dirty bits for the rprim with \p id.
127  HD_API
128  HdDirtyBits GetRprimDirtyBits(SdfPath const& id) const;
129 
130  /// Flag the Rprim with the given \p id as being dirty. Multiple calls with
131  /// different dirty bits accumulate.
132  HD_API
133  void MarkRprimDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
134 
135  /// Clear the dirty flags for an HdRprim. if inSync is true, set OutOfSync
136  /// flag to notify dirtyList will discover the prim to sync the residual
137  /// data for new repr.
138  HD_API
139  void MarkRprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
140 
141  /// Mark the primvar for the rprim with \p id as being dirty.
142  HD_API
143  void MarkPrimvarDirty(SdfPath const& id, TfToken const& name);
144 
145  /// Flag all the Rprim with the given \p id as being dirty. Multiple calls
146  /// with different dirty bits accumulate.
147  /// Doesn't touch varying state.
148  HD_API
149  void MarkAllRprimsDirty(HdDirtyBits bits);
150 
151  /// Clear Varying bit of all prims.
152  ///
153  /// The idea is that from frame to frame (update iteration), the set of
154  /// dirty rprims and their dirty bits do not change; that is, the same
155  /// rprims get dirtied with the same dirty bits.. The change tracker can
156  /// leverage this and build stable sets of dirty lists and reduce the
157  /// overall cost of an update iteration.
158  HD_API
159  void ResetVaryingState();
160 
161  /// Reset the varying state on one Rprim
162  /// This is done for Rprims, where we choose not to clean them
163  /// (due to state like invisibility).
164  HD_API
165  void ResetRprimVaryingState(SdfPath const& id);
166 
167 
168  // ---------------------------------------------------------------------- //
169 
170  /// Returns true if the rprim identified by \p id has any dirty flags set.
171  HD_API
172  bool IsRprimDirty(SdfPath const& id);
173 
174  /// Returns true if the rprim identified by \p id has a dirty extent.
175  HD_API
176  bool IsExtentDirty(SdfPath const& id);
177 
178  /// Returns true if the rprim identified by \p id has a dirty display style.
179  HD_API
180  bool IsDisplayStyleDirty(SdfPath const& id);
181 
182  /// Returns true if the rprim identified by \p id with primvar \p name is
183  /// dirty.
184  HD_API
185  bool IsPrimvarDirty(SdfPath const& id, TfToken const& name);
186 
187  /// Returns true if the rprim identified by \p id has any dirty primvars.
188  HD_API
189  bool IsAnyPrimvarDirty(SdfPath const& id);
190 
191  /// Returns true if the rprim identified by \p id has a dirty topology.
192  HD_API
193  bool IsTopologyDirty(SdfPath const& id);
194 
195  /// Returns true if the rprim identified by \p id has dirty doubleSided state.
196  HD_API
197  bool IsDoubleSidedDirty(SdfPath const& id);
198 
199  /// Returns true if the rprim identified by \p id has dirty cullstyle.
200  HD_API
201  bool IsCullStyleDirty(SdfPath const& id);
202 
203  /// Returns true if the rprim identified by \p id has a dirty subdiv tags.
204  HD_API
205  bool IsSubdivTagsDirty(SdfPath const& id);
206 
207  /// Returns true if the rprim identified by \p id has a dirty transform.
208  HD_API
209  bool IsTransformDirty(SdfPath const& id);
210 
211  /// Returns true if the rprim identified by \p id has dirty visibility.
212  HD_API
213  bool IsVisibilityDirty(SdfPath const& id);
214 
215  /// Returns true if the rprim identified by \p id has a dirty primID.
216  HD_API
217  bool IsPrimIdDirty(SdfPath const& id);
218 
219  /// Returns true if the dirtyBits has any flags set other than the varying flag.
220  static bool IsDirty(HdDirtyBits dirtyBits) {
221  return (dirtyBits & AllDirty) != 0;
222  }
223 
224  /// Returns true if the dirtyBits has no flags set except the varying flag.
225  static bool IsClean(HdDirtyBits dirtyBits) {
226  return (dirtyBits & AllDirty) == 0;
227  }
228 
229  /// Returns true if the dirtyBits has no flags set except the varying flag.
230  static bool IsVarying(HdDirtyBits dirtyBits) {
231  return (dirtyBits & Varying) != 0;
232  }
233 
234  /// Returns true if the dirtyBits has a dirty extent. id is for perflog.
235  HD_API
236  static bool IsExtentDirty(HdDirtyBits dirtyBits, SdfPath const& id);
237 
238  /// Returns true if the dirtyBits has a dirty display style. id is for perflog.
239  HD_API
240  static bool IsDisplayStyleDirty(HdDirtyBits dirtyBits, SdfPath const& id);
241 
242  /// Returns true if the dirtyBits has a dirty subdiv tags. id is for perflog.
243  HD_API
244  static bool IsSubdivTagsDirty(HdDirtyBits dirtyBits, SdfPath const& id);
245 
246  /// Returns true if the dirtyBits has a dirty primvar \p name.
247  /// id is for perflog.
248  HD_API
249  static bool IsPrimvarDirty(HdDirtyBits dirtyBits, SdfPath const& id,
250  TfToken const& name);
251 
252  /// Returns true if the dirtyBits has any dirty primvars.
253  /// id is for perflog.
254  HD_API
255  static bool IsAnyPrimvarDirty(HdDirtyBits dirtyBits, SdfPath const& id);
256 
257  /// Returns true if the dirtyBits has a dirty topology. id is for perflog.
258  HD_API
259  static bool IsTopologyDirty(HdDirtyBits dirtyBits, SdfPath const& id);
260 
261  /// Returns true if the dirtyBits has dirty doubleSided state. id is for perflog.
262  HD_API
263  static bool IsDoubleSidedDirty(HdDirtyBits dirtyBits, SdfPath const& id);
264 
265  /// Returns true if the dirtyBits has dirty cullstyle. id is for perflog.
266  HD_API
267  static bool IsCullStyleDirty(HdDirtyBits dirtyBits, SdfPath const& id);
268 
269  /// Returns true if the dirtyBits has a dirty transform. id is for perflog.
270  HD_API
271  static bool IsTransformDirty(HdDirtyBits dirtyBits, SdfPath const& id);
272 
273  /// Returns true if the dirtyBits has dirty visibility. id is for perflog.
274  HD_API
275  static bool IsVisibilityDirty(HdDirtyBits dirtyBits, SdfPath const& id);
276 
277  /// Returns true if the dirtyBits has a dirty primID. id is for perflog.
278  HD_API
279  static bool IsPrimIdDirty(HdDirtyBits dirtyBits, SdfPath const& id);
280 
281  /// Returns true if the dirtyBits has a dirty instancer. id is for perflog.
282  HD_API
283  static bool IsInstancerDirty(HdDirtyBits dirtyBits, SdfPath const& id);
284 
285  /// Returns true if the dirtyBits has a dirty instance index. id is for perflog.
286  HD_API
287  static bool IsInstanceIndexDirty(HdDirtyBits dirtyBits, SdfPath const& id);
288 
289  HD_API
290  static bool IsReprDirty(HdDirtyBits dirtyBits, SdfPath const &id);
291 
292  // ---------------------------------------------------------------------- //
293 
294  /// Set the primvar dirty flag to \p dirtyBits.
295  HD_API
296  static void MarkPrimvarDirty(HdDirtyBits *dirtyBits, TfToken const &name);
297 
298  // ---------------------------------------------------------------------- //
299  /// @}
300  /// \name Instancer Object Tracking
301  /// @{
302  // ---------------------------------------------------------------------- //
303 
304  /// Start tracking Instancer with the given \p id.
305  HD_API
306  void InstancerInserted(SdfPath const& id);
307 
308  /// Stop tracking Instancer with the given \p id.
309  HD_API
310  void InstancerRemoved(SdfPath const& id);
311 
312  /// Insert a dependency between \p rprimId and parent instancer
313  /// \p instancerId. Changes to the latter mark the former with
314  /// DirtyInstancer.
315  HD_API
316  void AddInstancerRprimDependency(SdfPath const& instancerId,
317  SdfPath const& rprimId);
318 
319  /// Remove a dependency between \p rprimId and parent instancer
320  /// \p instancerId.
321  HD_API
322  void RemoveInstancerRprimDependency(SdfPath const& instancerId,
323  SdfPath const& rprimId);
324 
325  /// Insert a dependency between \p instancerId and parent instancer
326  /// \p parentInstancerId. Changes to the latter mark the former with
327  /// DirtyInstancer.
328  HD_API
329  void AddInstancerInstancerDependency(SdfPath const& parentInstancerId,
330  SdfPath const& instancerId);
331 
332  /// Remove a dependency between \p instancerId and parent instancer
333  /// \p parentInstancerId.
334  HD_API
335  void RemoveInstancerInstancerDependency(SdfPath const& parentInstancerId,
336  SdfPath const& instancerId);
337 
338  // ---------------------------------------------------------------------- //
339  /// @}
340  /// \name Task Object Tracking
341  /// @{
342  // ---------------------------------------------------------------------- //
343 
344  /// Start tracking Task with the given \p id.
345  HD_API
346  void TaskInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
347 
348  /// Stop tracking Task with the given \p id.
349  HD_API
350  void TaskRemoved(SdfPath const& id);
351 
352  /// Set the dirty flags to \p bits.
353  HD_API
354  void MarkTaskDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
355 
356  /// Get the dirty bits for Task with the given \p id.
357  HD_API
359 
360  /// Set the dirty flags to \p newBits.
361  HD_API
362  void MarkTaskClean(SdfPath const& id, HdDirtyBits newBits=Clean);
363 
364  /// Called to flag when the set of active render tags have changed.
365  /// This can either be because either the Task's opinion (which
366  /// resolves both view and render pass opinions) and a Prims opinion.
367  ///
368  /// Calling this means that any cached prim gathers that filter by render
369  /// tag need to invalidated.
370  HD_API
371  void MarkRenderTagsDirty();
372 
373  /// Retrieve the current version number of the render tag set
374  HD_API
375  unsigned GetRenderTagVersion() const;
376 
377  // ---------------------------------------------------------------------- //
378  /// @}
379  /// \name Instancer State Tracking
380  /// @{
381  // ---------------------------------------------------------------------- //
382 
383  /// Returns the dirty bits for the instancer with \p id.
384  HD_API
386 
387  /// Flag the Instancer with the given \p id as being dirty. Multiple calls
388  /// with different dirty bits accumulate.
389  HD_API
390  void MarkInstancerDirty(SdfPath const& id, HdDirtyBits bits=AllDirty);
391 
392  /// Clean the specified dirty bits for the instancer with \p id.
393  HD_API
394  void MarkInstancerClean(SdfPath const& id, HdDirtyBits newBits=Clean);
395 
396  // ---------------------------------------------------------------------- //
397  /// @}
398  /// \name Sprim (scene state prim: camera, light, ...) state Tracking
399  /// @{
400  // ---------------------------------------------------------------------- //
401 
402  /// Start tracking sprim with the given \p id.
403  HD_API
404  void SprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
405 
406  /// Stop tracking sprim with the given \p id.
407  HD_API
408  void SprimRemoved(SdfPath const& id);
409 
410  /// Get the dirty bits for sprim with the given \p id.
411  HD_API
413 
414  /// Set the dirty flags to \p bits.
415  HD_API
416  void MarkSprimDirty(SdfPath const& id, HdDirtyBits bits);
417 
418  /// Set the dirty flags to \p newBits.
419  HD_API
420  void MarkSprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
421 
422  // ---------------------------------------------------------------------- //
423  /// @}
424  /// \name Bprim (buffer prim: texture, buffer, ...) state Tracking
425  /// @{
426  // ---------------------------------------------------------------------- //
427 
428  /// Start tracking bprim with the given \p id.
429  HD_API
430  void BprimInserted(SdfPath const& id, HdDirtyBits initialDirtyState);
431 
432  /// Stop tracking bprim with the given \p id.
433  HD_API
434  void BprimRemoved(SdfPath const& id);
435 
436  /// Get the dirty bits for bprim with the given \p id.
437  HD_API
439 
440  /// Set the dirty flags to \p bits.
441  HD_API
442  void MarkBprimDirty(SdfPath const& id, HdDirtyBits bits);
443 
444  /// Set the dirty flags to \p newBits.
445  HD_API
446  void MarkBprimClean(SdfPath const& id, HdDirtyBits newBits=Clean);
447 
448  // ---------------------------------------------------------------------- //
449  /// @}
450  /// \name GarbageCollection Tracking
451  /// @{
452  // ---------------------------------------------------------------------- //
453 
454  /// Clears the garbageCollectionNeeded flag.
456  _needsGarbageCollection = false;
457  }
458 
459  /// Sets the garbageCollectionNeeded flag.
461  _needsGarbageCollection = true;
462  }
463 
464  /// Returns true if garbage collection was flagged to be run.
465  /// Currently, this flag only gets set internally when Rprims are removed.
467  return _needsGarbageCollection;
468  }
469 
471  _needsBprimGarbageCollection = false;
472  }
473 
474  /// Sets the garbageCollectionNeeded flag.
476  _needsBprimGarbageCollection = true;
477  }
478 
479  /// Returns true if garbage collection was flagged to be run.
480  /// Currently, this flag only gets set internally when Rprims are removed.
482  return _needsBprimGarbageCollection;
483  }
484 
485 
486  // ---------------------------------------------------------------------- //
487  /// @}
488  /// \name RprimCollection Tracking
489  /// @{
490  // ---------------------------------------------------------------------- //
491 
492  /// Adds a named collection for tracking.
493  HD_API
494  void AddCollection(TfToken const& collectionName);
495 
496  /// Marks a named collection as being dirty, this bumps the version of the
497  /// collection.
498  HD_API
499  void MarkCollectionDirty(TfToken const& collectionName);
500 
501  /// Returns the current version of the named collection.
502  HD_API
503  unsigned GetCollectionVersion(TfToken const& collectionName) const;
504 
505  /// Returns the number of changes to visibility. This is intended to be used
506  /// to detect when visibility has changed for *any* Rprim.
507  HD_API
508  unsigned GetVisibilityChangeCount() const;
509 
510  /// Returns the current version of varying state. This is used to refresh
511  /// cached DirtyLists
512  unsigned GetVaryingStateVersion() const {
513  return _varyingStateVersion;
514  }
515 
516  /// Marks all batches dirty, meaning they need to be validated and
517  /// potentially rebuilt.
518  HD_API
519  void MarkBatchesDirty();
520 
521  /// Returns the current batch version.
522  HD_API
523  unsigned GetBatchVersion() const;
524 
525  // ---------------------------------------------------------------------- //
526  /// @}
527  /// \name Render Index Versioning
528  /// @{
529  // ---------------------------------------------------------------------- //
530 
531  /// Returns the current version of the Render Index's RPrim set.
532  /// This version number changes when Rprims are inserted or removed
533  /// from the render index. Invalidating any cached gather operations.
534  unsigned GetRprimIndexVersion() const {
535  return _rprimIndexVersion;
536  }
537 
538  /// Returns the current version of the Render Index's SPrim set.
539  /// This version number changes when Sprims are inserted or removed
540  /// from the render index. Invalidating any cached gather operations.
541  unsigned GetSprimIndexVersion() const {
542  return _sprimIndexVersion;
543  }
544 
545  /// Returns the current version of the Render Index's BPrim set.
546  /// This version number changes when Bprims are inserted or removed
547  /// from the render index. Invalidating any cached gather operations.
548  unsigned GetBprimIndexVersion() const {
549  return _bprimIndexVersion;
550  }
551 
552  /// Returns the current version of the Render Index's Instancer set.
553  /// This version number changes when Instancers are inserted or removed
554  /// from the render index. Invalidating any cached gather operations.
555  unsigned GetInstancerIndexVersion() const {
556  return _instancerIndexVersion;
557  }
558 
559 
560  /// Returns the current version of the scene state.
561  /// This version number changes whenever any prims are inserted, removed
562  /// or marked dirty.
563  /// The use case is to detect that nothing has changed, so the Sync
564  /// phase can be avoided.
565  unsigned GetSceneStateVersion() const {
566  return _sceneStateVersion;
567  }
568 
569  // ---------------------------------------------------------------------- //
570  /// @}
571  /// \name General state tracking
572  /// @{
573  // ---------------------------------------------------------------------- //
574 
575  /// Adds a named state for tracking.
576  HD_API
577  void AddState(TfToken const& name);
578 
579  /// Marks a named state as being dirty., this bumps the version of the
580  /// state.
581  HD_API
582  void MarkStateDirty(TfToken const& name);
583 
584  /// Returns the current version of the named state.
585  HD_API
586  unsigned GetStateVersion(TfToken const &name) const;
587 
588  // ---------------------------------------------------------------------- //
589  /// @}
590  /// \name Debug
591  /// @{
592  // ---------------------------------------------------------------------- //
593  HD_API
594  static std::string StringifyDirtyBits(HdDirtyBits dirtyBits);
595 
596  HD_API
597  static void DumpDirtyBits(HdDirtyBits dirtyBits);
598 
599  /// @}
600 
601 private:
602 
603  // Don't allow copies
604  HdChangeTracker(const HdChangeTracker &) = delete;
605  HdChangeTracker &operator=(const HdChangeTracker &) = delete;
606 
607 
608  static void _LogCacheAccess(TfToken const& cacheName,
609  SdfPath const& id, bool hit);
610 
612  typedef TfHashMap<TfToken, int, TfToken::HashFunctor> _CollectionStateMap;
613  typedef TfHashMap<SdfPath, SdfPathSet, SdfPath::Hash> _DependencyMap;
615 
616  // Core dirty state.
617  _IDStateMap _rprimState;
618  _IDStateMap _instancerState;
619  _IDStateMap _taskState;
620  _IDStateMap _sprimState;
621  _IDStateMap _bprimState;
622  _GeneralStateMap _generalState;
623 
624  // Collection versions / state.
625  _CollectionStateMap _collectionState;
626  bool _needsGarbageCollection;
627  bool _needsBprimGarbageCollection;
628 
629  // Provides reverse-association between instancers and the child
630  // instancers/rprims that use them.
631  _DependencyMap _instancerRprimDependencies;
632  _DependencyMap _instancerInstancerDependencies;
633 
634  // Dependency map helpers
635  void _AddDependency(_DependencyMap &depMap,
636  SdfPath const& parent, SdfPath const& child);
637  void _RemoveDependency(_DependencyMap &depMap,
638  SdfPath const& parent, SdfPath const& child);
639 
640  // Typically the Rprims that get marked dirty per update iteration end up
641  // being a stable set of objects; to leverage this fact, we require the
642  // delegate notify the change tracker when that state changes, which bumps
643  // the varyingStateVersion, which triggers downstream invalidation.
644  unsigned _varyingStateVersion;
645 
646  // Tracks changes (insertions/removals) of prims in the render index.
647  // This is used to indicating that cached gather operations need to be
648  // re-evaluated, such as dirty lists or batch building.
649  unsigned _rprimIndexVersion;
650  unsigned _sprimIndexVersion;
651  unsigned _bprimIndexVersion;
652  unsigned _instancerIndexVersion;
653 
654  // The following tracks any changes of state. As a result it is very broad.
655  // The use case to detect, when no changes have been made, as to
656  // avoid the need to sync or reset progressive renderers.
657  unsigned _sceneStateVersion;
658 
659  // Used to detect that visibility changed somewhere in the render index.
660  unsigned _visChangeCount;
661 
662  // Used to detect changes to the set of active render tags
663  unsigned _renderTagVersion;
664 
665  // Used to validate draw batches.
666  std::atomic_uint _batchVersion;
667 };
668 
669 
671 
672 #endif //PXR_IMAGING_HD_CHANGE_TRACKER_H
HD_API void AddInstancerRprimDependency(SdfPath const &instancerId, SdfPath const &rprimId)
HD_API void RprimRemoved(SdfPath const &id)
Stop tracking Rprim with the given id.
HD_API bool IsSubdivTagsDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty subdiv tags.
HD_API bool IsExtentDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty extent.
HD_API void SprimRemoved(SdfPath const &id)
Stop tracking sprim with the given id.
HD_API void RemoveInstancerInstancerDependency(SdfPath const &parentInstancerId, SdfPath const &instancerId)
GLuint const GLchar * name
Definition: glew.h:1814
HD_API void ResetRprimVaryingState(SdfPath const &id)
void SetBprimGarbageCollectionNeeded()
Sets the garbageCollectionNeeded flag.
virtual HD_API ~HdChangeTracker()
uint32_t HdDirtyBits
Definition: types.h:127
HD_API unsigned GetBatchVersion() const
Returns the current batch version.
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 IsDirty(HdDirtyBits dirtyBits)
Returns true if the dirtyBits has any flags set other than the varying flag.
unsigned GetSceneStateVersion() const
#define HD_API
Definition: api.h:40
HD_API void MarkTaskClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
HD_API bool IsPrimIdDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty primID.
HD_API HdDirtyBits GetInstancerDirtyBits(SdfPath const &id)
Returns the dirty bits for the instancer with id.
HD_API unsigned GetVisibilityChangeCount() const
void ClearBprimGarbageCollectionNeeded()
Clears the garbageCollectionNeeded flag.
HD_API void MarkInstancerClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Clean the specified dirty bits for the instancer with id.
HD_API void MarkAllRprimsDirty(HdDirtyBits bits)
HD_API void BprimRemoved(SdfPath const &id)
Stop tracking bprim with the given id.
HD_API void MarkCollectionDirty(TfToken const &collectionName)
HD_API bool IsTransformDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty transform.
static bool IsClean(HdDirtyBits dirtyBits)
Returns true if the dirtyBits has no flags set except the varying flag.
HD_API void RprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking Rprim with the given id.
HD_API unsigned GetStateVersion(TfToken const &name) const
Returns the current version of the named state.
HD_API void MarkSprimDirty(SdfPath const &id, HdDirtyBits bits)
Set the dirty flags to bits.
HD_API HdChangeTracker()
HD_API void MarkPrimvarDirty(SdfPath const &id, TfToken const &name)
Mark the primvar for the rprim with id as being dirty.
HD_API void MarkTaskDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
Set the dirty flags to bits.
HD_API HdDirtyBits GetBprimDirtyBits(SdfPath const &id)
Get the dirty bits for bprim with the given id.
Definition: token.h:87
HD_API void BprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking bprim with the given id.
HD_API bool IsPrimvarDirty(SdfPath const &id, TfToken const &name)
HD_API bool IsRprimDirty(SdfPath const &id)
Returns true if the rprim identified by id has any dirty flags set.
HD_API void MarkBprimDirty(SdfPath const &id, HdDirtyBits bits)
Set the dirty flags to bits.
static HD_API bool IsReprDirty(HdDirtyBits dirtyBits, SdfPath const &id)
Returns the dirty bits for the rprim with id.
HD_API HdDirtyBits GetTaskDirtyBits(SdfPath const &id)
Get the dirty bits for Task with the given id.
HD_API void InstancerInserted(SdfPath const &id)
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.
HD_API HdDirtyBits GetRprimDirtyBits(SdfPath const &id) const
Returns the dirty bits for the rprim with id.
HD_API void MarkRprimDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
HD_API void AddCollection(TfToken const &collectionName)
Adds a named collection for tracking.
static bool IsVarying(HdDirtyBits dirtyBits)
Returns true if the dirtyBits has no flags set except the varying flag.
HD_API void RemoveInstancerRprimDependency(SdfPath const &instancerId, SdfPath const &rprimId)
bool IsBprimGarbageCollectionNeeded() const
unsigned GetRprimIndexVersion() const
Definition: path.h:288
HD_API void TaskInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking Task with the given id.
unsigned GetVaryingStateVersion() const
HD_API void TaskRemoved(SdfPath const &id)
Stop tracking Task with the given id.
HD_API void SprimInserted(SdfPath const &id, HdDirtyBits initialDirtyState)
Start tracking sprim with the given id.
HD_API unsigned GetRenderTagVersion() const
Retrieve the current version number of the render tag set.
void SetGarbageCollectionNeeded()
Sets the garbageCollectionNeeded flag.
static HD_API void DumpDirtyBits(HdDirtyBits dirtyBits)
HD_API void MarkRenderTagsDirty()
GLsizei const GLchar *const * string
Definition: glew.h:1844
unsigned GetBprimIndexVersion() const
HD_API void MarkRprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
HD_API void MarkInstancerDirty(SdfPath const &id, HdDirtyBits bits=AllDirty)
HD_API void AddState(TfToken const &name)
Adds a named state for tracking.
HD_API void AddInstancerInstancerDependency(SdfPath const &parentInstancerId, SdfPath const &instancerId)
static HD_API std::string StringifyDirtyBits(HdDirtyBits dirtyBits)
unsigned GetInstancerIndexVersion() const
HD_API bool IsCullStyleDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty cullstyle.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdDirtyBits GetSprimDirtyBits(SdfPath const &id)
Get the dirty bits for sprim with the given id.
static HD_API bool IsInstancerDirty(HdDirtyBits dirtyBits, SdfPath const &id)
Returns true if the dirtyBits has a dirty instancer. id is for perflog.
void ClearGarbageCollectionNeeded()
Clears the garbageCollectionNeeded flag.
HD_API void MarkStateDirty(TfToken const &name)
HD_API void InstancerRemoved(SdfPath const &id)
Stop tracking Instancer with the given id.
HD_API unsigned GetCollectionVersion(TfToken const &collectionName) const
Returns the current version of the named collection.
HD_API bool IsVisibilityDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty visibility.
HD_API bool IsAnyPrimvarDirty(SdfPath const &id)
Returns true if the rprim identified by id has any dirty primvars.
HD_API void MarkBprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
HD_API void MarkBatchesDirty()
HD_API bool IsDisplayStyleDirty(SdfPath const &id)
Returns true if the rprim identified by id has a dirty display style.
unsigned GetSprimIndexVersion() const
HD_API void MarkSprimClean(SdfPath const &id, HdDirtyBits newBits=Clean)
Set the dirty flags to newBits.
bool IsGarbageCollectionNeeded() const
HD_API void ResetVaryingState()
HD_API bool IsDoubleSidedDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty doubleSided state.