All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
aovInputTask.h
1 //
2 // Copyright 2020 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HDX_AOV_INPUT_TASK_H
25 #define PXR_IMAGING_HDX_AOV_INPUT_TASK_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdx/api.h"
29 #include "pxr/imaging/hdx/task.h"
30 #include "pxr/imaging/hgi/texture.h"
31 
32 PXR_NAMESPACE_OPEN_SCOPE
33 
45 class HdxAovInputTask : public HdxTask
46 {
47 public:
48  HDX_API
49  HdxAovInputTask(HdSceneDelegate* delegate, SdfPath const& id);
50 
51  HDX_API
52  ~HdxAovInputTask() override;
53 
55  bool IsConverged() const override;
56 
57  HDX_API
58  void Prepare(
59  HdTaskContext* ctx,
60  HdRenderIndex* renderIndex) override;
61 
62  HDX_API
63  void Execute(HdTaskContext* ctx) override;
64 
65 protected:
66  HDX_API
67  void _Sync(
68  HdSceneDelegate* delegate,
69  HdTaskContext* ctx,
70  HdDirtyBits* dirtyBits) override;
71 
72 private:
73  void _UpdateTexture(
74  HdTaskContext* ctx,
75  HgiTextureHandle& texture,
76  HdRenderBuffer* buffer);
77 
78  void _UpdateIntermediateTexture(
79  HgiTextureHandle& texture,
80  HdRenderBuffer* buffer);
81 
82  bool _converged;
83 
84  SdfPath _aovBufferPath;
85  SdfPath _depthBufferPath;
86 
87  HdRenderBuffer* _aovBuffer;
88  HdRenderBuffer* _depthBuffer;
89 
90  HgiTextureHandle _aovTexture;
91  HgiTextureHandle _depthTexture;
92  HgiTextureHandle _aovTextureIntermediate;
93 
94  HdxAovInputTask() = delete;
95  HdxAovInputTask(const HdxAovInputTask &) = delete;
96  HdxAovInputTask &operator =(const HdxAovInputTask &) = delete;
97 };
98 
99 
105 {
107  : aovBufferPath()
108  , depthBufferPath()
109  {}
110 
111  SdfPath aovBufferPath;
112  SdfPath depthBufferPath;
113 };
114 
115 // VtValue requirements
116 HDX_API
117 std::ostream& operator<<(std::ostream& out, const HdxAovInputTaskParams& pv);
118 HDX_API
119 bool operator==(const HdxAovInputTaskParams& lhs,
120  const HdxAovInputTaskParams& rhs);
121 HDX_API
122 bool operator!=(const HdxAovInputTaskParams& lhs,
123  const HdxAovInputTaskParams& rhs);
124 
125 
126 PXR_NAMESPACE_CLOSE_SCOPE
127 
128 #endif
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:116
AR_API bool operator!=(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
AR_API bool operator==(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
A task for taking input AOV data comming from a render buffer that was filled by render tasks and con...
Definition: aovInputTask.h:45
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality...
Definition: task.h:44
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
AovInput parameters.
Definition: aovInputTask.h:104
bool IsConverged() const override
Hooks for progressive rendering.
A render buffer is a handle to a data resource that can be rendered into, such as a 2d image for a dr...
Definition: renderBuffer.h:51