7#ifndef PXR_IMAGING_PLUGIN_HD_ST_RENDER_PARAM_H
8#define PXR_IMAGING_PLUGIN_HD_ST_RENDER_PARAM_H
11#include "pxr/imaging/hd/renderDelegate.h"
12#include "pxr/imaging/hdSt/api.h"
15#include <shared_mutex>
17PXR_NAMESPACE_OPEN_SCOPE
41 unsigned int GetDrawBatchesVersion()
const;
49 unsigned int GetMaterialTagsVersion()
const;
57 unsigned int GetGeomSubsetDrawItemsVersion()
const;
99 _needsGarbageCollection =
true;
102 void ClearGarbageCollectionNeeded() {
103 _needsGarbageCollection =
false;
106 bool IsGarbageCollectionNeeded()
const {
107 return _needsGarbageCollection;
111 typedef std::unordered_map<TfToken, std::atomic_int, TfHash> _TagToCountMap;
113 void _AdjustTagCount(
114 std::shared_timed_mutex *mutex,
115 _TagToCountMap *tagToCountMap,
117 const int increment);
120 std::shared_timed_mutex *mutex,
121 const _TagToCountMap *tagToCountMap,
124 std::atomic_uint _drawBatchesVersion;
125 std::atomic_uint _materialTagsVersion;
126 std::atomic_uint _geomSubsetDrawItemsVersion;
127 bool _needsGarbageCollection;
130 mutable std::shared_timed_mutex _materialTagToCountMutex;
131 _TagToCountMap _materialTagToCount;
133 mutable std::shared_timed_mutex _renderTagToCountMutex;
134 _TagToCountMap _renderTagToCount;
137PXR_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.