24#ifndef PXR_IMAGING_PLUGIN_HD_ST_RENDER_PARAM_H
25#define PXR_IMAGING_PLUGIN_HD_ST_RENDER_PARAM_H
28#include "pxr/imaging/hd/renderDelegate.h"
29#include "pxr/imaging/hdSt/api.h"
32#include <shared_mutex>
34PXR_NAMESPACE_OPEN_SCOPE
58 unsigned int GetDrawBatchesVersion()
const;
66 unsigned int GetMaterialTagsVersion()
const;
74 unsigned int GetGeomSubsetDrawItemsVersion()
const;
116 _needsGarbageCollection =
true;
119 void ClearGarbageCollectionNeeded() {
120 _needsGarbageCollection =
false;
123 bool IsGarbageCollectionNeeded()
const {
124 return _needsGarbageCollection;
128 typedef std::unordered_map<TfToken, std::atomic_int, TfHash> _TagToCountMap;
130 void _AdjustTagCount(
131 std::shared_timed_mutex *mutex,
132 _TagToCountMap *tagToCountMap,
134 const int increment);
137 std::shared_timed_mutex *mutex,
138 const _TagToCountMap *tagToCountMap,
141 std::atomic_uint _drawBatchesVersion;
142 std::atomic_uint _materialTagsVersion;
143 std::atomic_uint _geomSubsetDrawItemsVersion;
144 bool _needsGarbageCollection;
147 mutable std::shared_timed_mutex _materialTagToCountMutex;
148 _TagToCountMap _materialTagToCount;
150 mutable std::shared_timed_mutex _renderTagToCountMutex;
151 _TagToCountMap _renderTagToCount;
154PXR_NAMESPACE_CLOSE_SCOPE
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
The render delegate can create an object of type HdRenderParam, to pass to each prim during Sync().
HDST_API void DecreaseRenderTagCount(const TfToken &renderTag)
Unregister that there is an rprim with given renderTag.
HDST_API void MarkDrawBatchesDirty()
Draw items cache and batch invalidation.
HDST_API void MarkMaterialTagsDirty()
Marks material tags dirty, meaning that the draw items associated with the collection of a render pas...
HDST_API void DecreaseMaterialTagCount(const TfToken &materialTag)
Unregister that there is an rprim with given materialTag.
HDST_API void IncreaseRenderTagCount(const TfToken &renderTag)
Register that there is an rprim with given renderTag.
HDST_API bool HasAnyRenderTag(const TfTokenVector &renderTags) const
Render tag tracking.
HDST_API bool HasMaterialTag(const TfToken &materialTag) const
Material tag tracking.
HDST_API void IncreaseMaterialTagCount(const TfToken &materialTag)
Register that there is an rprim with given materialTag.
void SetGarbageCollectionNeeded()
Garbage collection tracking.
HDST_API void MarkGeomSubsetDrawItemsDirty()
Marks geom subsets draw items dirty, meaning that the draw items associated with the collection of a ...
Token for efficient comparison, assignment, and hashing of known strings.
std::vector< TfToken > TfTokenVector
Convenience types.