24 #ifndef PXR_IMAGING_HD_RENDER_INDEX_H
25 #define PXR_IMAGING_HD_RENDER_INDEX_H
44 #include <tbb/enumerable_thread_specific.h>
47 #include <unordered_map>
216 return _rprimMap.find(
id) != _rprimMap.
end();
268 return _instancerMap.find(
id) != _instancerMap.
end();
280 template <
typename T>
289 return _taskMap.find(
id) != _taskMap.end();
389 void _CompactPrimIds();
392 void _AllocatePrimId(
HdRprim* prim);
402 template <
typename T>
403 static inline const TfToken & _GetTypeId();
405 void _RemoveRprimSubtree(
const SdfPath &root,
407 void _RemoveInstancerSubtree(
const SdfPath &root,
409 void _RemoveExtComputationSubtree(
const SdfPath &root,
411 void _RemoveTaskSubtree(
const SdfPath &root,
427 typedef std::unordered_map<SdfPath, _TaskInfo, SdfPath::Hash> _TaskMap;
429 typedef std::vector<SdfPath> _RprimPrimIDVector;
437 _RprimPrimIDVector _rprimPrimIdMap;
441 _SprimIndex _sprimIndex;
442 _BprimIndex _bprimIndex;
447 _InstancerMap _instancerMap;
449 struct _SyncQueueEntry {
454 typedef std::vector<_SyncQueueEntry> _SyncQueue;
455 _SyncQueue _syncQueue;
469 std::unordered_map<HdDirtyBits, const SdfPathVector> _dirtyRprimIdsMap;
481 unsigned int _renderTagVersion;
484 void _InitPrimTypes();
487 bool _CreateFallbackPrims();
490 void _DestroyFallbackPrims();
494 typedef tbb::enumerable_thread_specific<HdDrawItemPtrVector>
495 _ConcurrentDrawItems;
501 _ConcurrentDrawItems*
result);
506 static void _ConfigureReprs();
517 template <
typename T>
525 _TrackDelegateTask(delegate,
id, task);
530 #endif //PXR_IMAGING_HD_RENDER_INDEX_H
HD_API void InsertBprim(TfToken const &typeId, HdSceneDelegate *delegate, SdfPath const &bprimId)
Insert a bprim into index.
void InsertTask(HdSceneDelegate *delegate, SdfPath const &id)
Inserts a new task into the render index with an identifier of id.
HD_API void RemoveInstancer(SdfPath const &id)
Remove an instancer from index.
std::shared_ptr< class HdResourceRegistry > HdResourceRegistrySharedPtr
HD_API void InsertSprim(TfToken const &typeId, HdSceneDelegate *delegate, SdfPath const &sprimId)
Insert a sprim into index.
HD_API void EnqueuePrimsToSync(HdDirtyListSharedPtr const &dirtyList, HdRprimCollection const &collection)
std::vector< HdDrawItem const * > HdDrawItemPtrVector
HD_API void Clear()
Clear all r (render), s (state) and b (buffer) prims.
HD_API HdSprim * GetSprim(TfToken const &typeId, SdfPath const &id) const
Returns whether the sprim type is supported by this render index.
#define HF_MALLOC_TAG_FUNCTION()
HD_API HdRenderDelegate * GetRenderDelegate() const
HD_API void RemoveSubtree(const SdfPath &root, HdSceneDelegate *sceneDelegate)
HD_API SdfPathVector GetRprimSubtree(SdfPath const &root)
Returns the subtree rooted under the given path.
bool HasTask(SdfPath const &id)
Returns true if a task exists in the index with the given id.
HD_API HdDrawItemPtrVector GetDrawItems(HdRprimCollection const &collection, TfTokenVector const &renderTags)
Returns a list of relevant draw items that match the criteria specified.
Functor to use for hash maps from tokens to other things.
HD_API SdfPathVector GetBprimSubtree(TfToken const &typeId, SdfPath const &root)
HD_API bool IsSprimTypeSupported(TfToken const &typeId) const
Returns whether the sprim type is supported by this render index.
std::vector< HdTaskSharedPtr > HdTaskSharedPtrVector
HD_API HdRprim const * GetRprim(SdfPath const &id) const
Returns the rprim of id.
HdChangeTracker const & GetChangeTracker() const
HD_API TfToken GetRenderTag(SdfPath const &id) const
Returns the render tag for the given rprim.
bool HasRprim(SdfPath const &id)
Returns true if rprim id exists in index.
HD_API SdfPathVector GetSprimSubtree(TfToken const &typeId, SdfPath const &root)
std::vector< HdDriver * > HdDriverVector
HD_API HdResourceRegistrySharedPtr GetResourceRegistry() const
HD_API void SyncAll(HdTaskSharedPtrVector *tasks, HdTaskContext *taskContext)
HD_API void RemoveBprim(TfToken const &typeId, SdfPath const &id)
Returns whether the bprim type is supported by this render index.
HD_API void InsertInstancer(HdSceneDelegate *delegate, SdfPath const &id)
Insert an instancer into index.
#define HD_TRACE_FUNCTION()
std::vector< TfToken > TfTokenVector
Convenience types.
HD_API TfToken GetMaterialTag(SdfPath const &id) const
Return the material tag for the given rprim.
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
HD_API HdSprim * GetFallbackSprim(TfToken const &typeId) const
Returns the fullback prim for the Sprim of the given type.
HD_API HdBprim * GetBprim(TfToken const &typeId, SdfPath const &id) const
Returns whether the bprim type is supported by this render index.
std::unordered_map< TfToken, VtValue, TfToken::HashFunctor > HdTaskContext
HD_API bool GetSceneDelegateAndInstancerIds(SdfPath const &id, SdfPath *sceneDelegateId, SdfPath *instancerId) const
HdChangeTracker & GetChangeTracker()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HD_API const SdfPathVector & GetRprimIds()
static HD_API HdRenderIndex * New(HdRenderDelegate *renderDelegate, HdDriverVector const &drivers)
#define PXR_NAMESPACE_CLOSE_SCOPE
HD_API SdfPath GetRprimPathFromPrimId(int primId) const
HD_API bool IsRprimTypeSupported(TfToken const &typeId) const
Returns whether the rprim type is supported by this render index.
HD_API void RemoveSprim(TfToken const &typeId, SdfPath const &id)
Returns whether the sprim type is supported by this render index.
HD_API HdDriverVector const & GetDrivers() const
HD_API HdInstancer * GetInstancer(SdfPath const &id) const
Returns the instancer of id.
HD_API bool IsBprimTypeSupported(TfToken const &typeId) const
Returns whether the bprim type is supported by this render index.
HD_API const SdfPathVector & GetIds()
Sorts the ids if needed and returns the sorted list of ids.
HD_API void RemoveTask(SdfPath const &id)
Removes the given task from the RenderIndex.
std::shared_ptr< class HdDirtyList > HdDirtyListSharedPtr
HD_API void RemoveRprim(SdfPath const &id)
Remove a rprim from index.
std::shared_ptr< class HdTask > HdTaskSharedPtr
HD_API void InsertRprim(TfToken const &typeId, HdSceneDelegate *sceneDelegate, SdfPath const &rprimId)
Insert a rprim into index.
HD_API HdBprim * GetFallbackBprim(TfToken const &typeId) const
Returns the fallback prim for the Bprim of the given type.
HD_API HdSceneDelegate * GetSceneDelegateForRprim(SdfPath const &id) const
Returns the scene delegate for the given rprim.
HD_API HdTaskSharedPtr const & GetTask(SdfPath const &id) const
Returns the task for the given id.
bool HasInstancer(SdfPath const &id)
Returns true if instancer id exists in index.