7#ifndef PXR_IMAGING_HD_CACHING_SCENE_H
8#define PXR_IMAGING_HD_CACHING_SCENE_H
10#include "pxr/imaging/hd/api.h"
11#include "pxr/imaging/hd/filteringSceneIndex.h"
13#include "pxr/usd/sdf/pathTable.h"
15#include <tbb/concurrent_hash_map.h>
19PXR_NAMESPACE_OPEN_SCOPE
33 static HdCachingSceneIndexRefPtr
New(
34 HdSceneIndexBaseRefPtr
const &inputScene) {
35 return TfCreateRefPtr(
52 HdSceneIndexBaseRefPtr
const &inputScene);
70 void _ConsolidateRecentPrims();
73 void _ConsolidateRecentChildPaths();
76 void _ConsolidateRecent();
78 struct _PathHashCompare {
82 static size_t hash(
const SdfPath &path) {
91 using _RecentPrimTable =
92 tbb::concurrent_hash_map<SdfPath, HdSceneIndexPrim, _PathHashCompare>;
93 mutable _RecentPrimTable _recentPrims;
96 _ChildPathsTable _childPaths;
98 using _RecentChildPathsTable =
99 tbb::concurrent_hash_map<SdfPath, SdfPathVector, _PathHashCompare>;
100 mutable _RecentChildPathsTable _recentChildPaths;
103PXR_NAMESPACE_CLOSE_SCOPE
A scene index that caches the prim data source and child prim paths.
static HdCachingSceneIndexRefPtr New(HdSceneIndexBaseRefPtr const &inputScene)
Creates a new caching scene index.
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
Abstract interface to scene data.
A path value used to locate objects in layers or scenegraphs.
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Small struct representing a 'prim' in the Hydra scene index.
size_t hash_value(const TfToken &x)
Overload hash_value for TfToken.