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 Apache License, Version 2.0 (the "Apache License")
6 // with the following modification; you may not use this file except in
7 // compliance with the Apache License and the following modification to it:
8 // Section 6. Trademarks. is deleted and replaced with:
9 //
10 // 6. Trademarks. This License does not grant permission to use the trade
11 // names, trademarks, service marks, or product names of the Licensor
12 // and its affiliates, except as required to comply with Section 4(c) of
13 // the License and to reproduce the content of the NOTICE file.
14 //
15 // You may obtain a copy of the Apache License at
16 //
17 // http://www.apache.org/licenses/LICEN SE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the Apache License with the above modification is
21 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22 // KIND, either express or implied. See the Apache License for the specific
23 // language governing permissions and limitations under the Apache License.
24 //
25 // XXX change directive
26 #ifndef PXR_IMAGING_HDSI_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_H
27 #define PXR_IMAGING_HDSI_EXT_COMPUTATION_PRIMVAR_PRUNING_SCENE_INDEX_H
28 
29 #include "pxr/imaging/hdsi/api.h"
31 
33 
35 
36 /// \class HdSiExtComputationPrimvarPruningSceneIndex
37 ///
38 /// Hydra ExtComputations provide a simple computation framework allowing
39 /// primvars to be computed using CPU or GPU kernels.
40 /// Computed primvars backed by CPU kernels are evaluated during the Hydra
41 /// sync phase. This disallows transformations on the computed values via
42 /// scene indices.
43 /// This scene index alleviates this by pruning computed primvars and presenting
44 /// them as authored primvars. The computation is executed when pulling on the
45 /// primvar's value.
46 /// Thus, scene indices downstream that take this as an input can transform
47 /// the (computed) primvar data just like any authored primvar.
48 ///
49 /// \note This scene index is in service of emulated ExtComputations (i.e., when
50 /// HD_ENABLE_SCENE_INDEX_EMULATION is true).
51 ///
54 {
55 public:
56  HDSI_API
57  static HdSiExtComputationPrimvarPruningSceneIndexRefPtr
58  New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
59 
60  HDSI_API
61  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final;
62 
63  HDSI_API
64  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override final;
65 
66 protected:
67  HDSI_API
68  void _PrimsAdded(
69  const HdSceneIndexBase &sender,
70  const HdSceneIndexObserver::AddedPrimEntries &entries) override final;
71 
72  HDSI_API
73  void _PrimsRemoved(
74  const HdSceneIndexBase &sender,
75  const HdSceneIndexObserver::RemovedPrimEntries &entries) override final;
76 
77  HDSI_API
78  void _PrimsDirtied(
79  const HdSceneIndexBase &sender,
80  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override final;
81 
82  HDSI_API
84  const HdSceneIndexBaseRefPtr &inputSceneIndex);
85 
86 };
87 
89 
90 #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
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const overridefinal
Definition: path.h:290
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:211
#define HDSI_API
Definition: api.h:40
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HDSI_API HdSiExtComputationPrimvarPruningSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HDSI_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) overridefinal
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) overridefinal