24 #ifndef PXR_IMAGING_HD_SCENE_INDEX_ADAPTER_SCENE_DELEGATE_H
25 #define PXR_IMAGING_HD_SCENE_INDEX_ADAPTER_SCENE_DELEGATE_H
31 #include <tbb/concurrent_unordered_map.h>
49 HdSceneIndexBaseRefPtr inputSceneIndex,
60 HdSceneIndexBaseRefPtr inputSceneIndex,
SdfPath const &delegateID);
98 SdfPath const &volumeId)
override;
105 float *sampleTimes,
GfMatrix4d *sampleValues)
override;
108 SdfPath const &instancerId)
override;
110 size_t maxSampleCount,
float *sampleTimes,
122 VtIntArray *outIndices)
override;
125 size_t maxSampleCount,
float *sampleTimes,
126 VtValue *sampleValues)
override;
129 VtIntArray *sampleIndices)
override;
136 SdfPath const &instancerId)
override;
164 TfToken const ¶mName)
override;
170 TfToken const ¶mName)
override;
182 SdfPath const &computationId)
override;
188 size_t maxSampleCount,
190 VtValue *sampleValues)
override;
193 SdfPath const &computationId)
override;
195 SdfPath const &computationId)
override;
218 using _InputPrimCacheEntry = std::pair<SdfPath, HdSceneIndexPrim>;
222 std::hash<std::thread::id> > _inputPrimCache;
229 VtIntArray *outIndices);
232 const HdContainerDataSourceHandle &primvarsDataSource,
234 VtIntArray *outIndices);
238 size_t maxNumSamples,
float *times,
VtValue *samples,
239 VtIntArray *sampleIndices);
241 HdSceneIndexBaseRefPtr _inputSceneIndex;
243 struct _PrimCacheEntry
246 : primvarDescriptorsState(ReadStateUnread)
247 , extCmpPrimvarDescriptorsState(ReadStateUnread)
250 _PrimCacheEntry(
const _PrimCacheEntry &rhs)
252 primType = rhs.primType;
253 primvarDescriptorsState.store(rhs.primvarDescriptorsState.load());
254 extCmpPrimvarDescriptorsState.store(
255 rhs.extCmpPrimvarDescriptorsState.load());
260 enum ReadState :
unsigned char {
266 std::atomic<ReadState> primvarDescriptorsState;
267 std::atomic<ReadState> extCmpPrimvarDescriptorsState;
268 std::map<HdInterpolation, HdPrimvarDescriptorVector>
270 std::map<HdInterpolation, HdExtComputationPrimvarDescriptorVector>
271 extCmpPrimvarDescriptors;
277 bool _sceneDelegatesBuilt;
278 std::vector<HdSceneDelegate*> _sceneDelegates;
std::shared_ptr< SdfPathVector > HdIdVectorSharedPtr
A shared pointer to a vector of id's.
GfMatrix4d GetInstancerTransform(SdfPath const &instancerId) override
Returns the instancer transform.
~HdSceneIndexAdapterSceneDelegate() override
VtValue Get(SdfPath const &id, TfToken const &key) override
Returns a named value.
void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries) override
HdIdVectorSharedPtr GetCoordSysBindings(SdfPath const &id) override
Returns the coordinate system bindings, or a nullptr if none are bound.
GLsizei const GLchar *const * string
VtIntArray GetInstanceIndices(SdfPath const &instancerId, SdfPath const &prototypeId) override
size_t SampleTransform(SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
HdExtComputationOutputDescriptorVector GetExtComputationOutputDescriptors(SdfPath const &computationId) override
SdfPath GetDataSharingId(SdfPath const &primId) override
VtValue GetLightParamValue(SdfPath const &id, TfToken const ¶mName) override
std::vector< HdExtComputationInputDescriptor > HdExtComputationInputDescriptorVector
HdPrimvarDescriptorVector GetPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolation) override
Returns descriptors for all primvars of the given interpolation type.
HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id) override
Gets the topological curve data for a given prim.
std::vector< HdExtComputationOutputDescriptor > HdExtComputationOutputDescriptorVector
HdVolumeFieldDescriptorVector GetVolumeFieldDescriptors(SdfPath const &volumeId) override
VtValue GetShadingStyle(SdfPath const &id) override
Returns the shading style for the given prim.
void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries) override
SdfPath GetInstancerId(SdfPath const &primId) override
Returns the parent instancer of the given rprim or instancer.
void Sync(HdSyncRequestVector *request) override
Synchronizes the delegate state for the given request vector.
std::string GetExtComputationKernel(SdfPath const &computationId) override
std::vector< VtArray< TfToken > > GetInstanceCategories(SdfPath const &instancerId) override
Returns the categories for all instances in the instancer.
VtValue GetMaterialResource(SdfPath const &id) override
Returns the material ID bound to the rprim rprimId.
GfMatrix4d GetTransform(SdfPath const &id) override
Returns the object space transform, including all parent transforms.
void PostSyncCleanup() override
size_t SamplePrimvar(SdfPath const &id, TfToken const &key, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
VtValue GetExtComputationInput(SdfPath const &computationId, TfToken const &input) override
size_t SampleInstancerTransform(SdfPath const &instancerId, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues) override
HdDisplayStyle GetDisplayStyle(SdfPath const &id) override
void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries) override
HdCullStyle GetCullStyle(SdfPath const &id) override
Returns the cullstyle for the given prim.
GfRange3d GetExtent(SdfPath const &id) override
VtValue GetIndexedPrimvar(SdfPath const &id, TfToken const &key, VtIntArray *outIndices) override
size_t SampleIndexedPrimvar(SdfPath const &id, TfToken const &key, size_t maxNumSamples, float *times, VtValue *samples, VtIntArray *sampleIndices) override
HdExtComputationInputDescriptorVector GetExtComputationInputDescriptors(SdfPath const &computationId) override
void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries) override
std::vector< TfToken > TfTokenVector
Convenience types.
HdSceneIndexAdapterSceneDelegate(HdSceneIndexBaseRefPtr inputSceneIndex, HdRenderIndex *parentIndex, SdfPath const &delegateID)
std::vector< HdVolumeFieldDescriptor > HdVolumeFieldDescriptorVector
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
HdRenderBufferDescriptor GetRenderBufferDescriptor(SdfPath const &id) override
Returns the allocation descriptor for a given render buffer prim.
static HdSceneIndexBaseRefPtr AppendDefaultSceneFilters(HdSceneIndexBaseRefPtr inputSceneIndex, SdfPath const &delegateID)
VtArray< TfToken > GetCategories(SdfPath const &id) override
Returns the prim categories.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
void InvokeExtComputation(SdfPath const &computationId, HdExtComputationContext *context) override
bool GetVisible(SdfPath const &id) override
Returns the authored visible state of the prim.
PxOsdSubdivTags GetSubdivTags(SdfPath const &id) override
Gets the subdivision surface tags (sharpness, holes, etc).
#define PXR_NAMESPACE_CLOSE_SCOPE
SdfPath GetMaterialId(SdfPath const &id) override
Returns the material ID bound to the rprim rprimId.
TfTokenVector GetExtComputationSceneInputNames(SdfPath const &computationId) override
std::vector< HdPrimvarDescriptor > HdPrimvarDescriptorVector
TfToken GetRenderTag(SdfPath const &id) override
bool GetDoubleSided(SdfPath const &id) override
Returns the doubleSided state for the given prim.
HdExtComputationPrimvarDescriptorVector GetExtComputationPrimvarDescriptors(SdfPath const &id, HdInterpolation interpolationMode) override
SdfPathVector GetInstancerPrototypes(SdfPath const &instancerId) override
VtValue GetCameraParamValue(SdfPath const &cameraId, TfToken const ¶mName) override
HdMeshTopology GetMeshTopology(SdfPath const &id) override
Gets the topological mesh data for a given prim.
size_t SampleExtComputationInput(SdfPath const &computationId, TfToken const &input, size_t maxSampleCount, float *sampleTimes, VtValue *sampleValues) override
std::vector< HdExtComputationPrimvarDescriptor > HdExtComputationPrimvarDescriptorVector
HdReprSelector GetReprSelector(SdfPath const &id) override
Returns the authored repr (if any) for the given prim.