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