HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extComputationPrimvarPruningSceneIndex.h
Go to the documentation of this file.
1 
2 //
3 // Copyright 2022 Pixar
4 //
5 // Licensed under the terms set forth in the LICENSE.txt file available at
6 // https://openusd.org/license.
7 //
8 // XXX change directive
9 #ifndef PXR_IMAGING_HDSI_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_H
10 #define PXR_IMAGING_HDSI_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_H
11 
12 #include "pxr/imaging/hdsi/api.h"
14 
16 
18 
19 /// \class HdSiExtComputationPrimvarPruningSceneIndex
20 ///
21 /// Hydra ExtComputations provide a simple computation framework allowing
22 /// primvars to be computed using CPU or GPU kernels.
23 /// Computed primvars backed by CPU kernels are evaluated during the Hydra
24 /// sync phase. This disallows transformations on the computed values via
25 /// scene indices.
26 /// This scene index alleviates this by pruning computed primvars and presenting
27 /// them as authored primvars. The computation is executed when pulling on the
28 /// primvar's value.
29 /// Thus, scene indices downstream that take this as an input can transform
30 /// the (computed) primvar data just like any authored primvar.
31 ///
32 /// \note This scene index is in service of emulated ExtComputations (i.e., when
33 /// HD_ENABLE_SCENE_INDEX_EMULATION is true).
34 ///
37 {
38 public:
39  HDSI_API
40  static HdSiExtComputationPrimvarPruningSceneIndexRefPtr
41  New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
42 
43  HDSI_API
44  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final;
45 
46  HDSI_API
47  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override final;
48 
49 protected:
50  HDSI_API
51  void _PrimsAdded(
52  const HdSceneIndexBase &sender,
53  const HdSceneIndexObserver::AddedPrimEntries &entries) override final;
54 
55  HDSI_API
56  void _PrimsRemoved(
57  const HdSceneIndexBase &sender,
58  const HdSceneIndexObserver::RemovedPrimEntries &entries) override final;
59 
60  HDSI_API
61  void _PrimsDirtied(
62  const HdSceneIndexBase &sender,
63  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override final;
64 
65  HDSI_API
67  const HdSceneIndexBaseRefPtr &inputSceneIndex);
68 
69 };
70 
72 
73 #endif //PXR_IMAGING_HDSI_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_H
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const overridefinal
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(HdSiExtComputationPrimvarPruningSceneIndex)
static HDSI_API HdSiExtComputationPrimvarPruningSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex)
HDSI_API void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) overridefinal
std::vector< class SdfPath > SdfPathVector
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const overridefinal
Definition: path.h:273
#define HDSI_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HDSI_API HdSiExtComputationPrimvarPruningSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HDSI_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) overridefinal
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) overridefinal