Loading...
Searching...
No Matches
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
32PXR_NAMESPACE_OPEN_SCOPE
33
46{
47public:
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
65protected:
66 HDX_API
67 void _Sync(
68 HdSceneDelegate* delegate,
69 HdTaskContext* ctx,
70 HdDirtyBits* dirtyBits) override;
71
72private:
73 void _UpdateTexture(
74 HdTaskContext* ctx,
75 HgiTextureHandle& texture,
76 HdRenderBuffer* buffer,
77 HgiTextureUsageBits usage);
78
79 void _UpdateIntermediateTexture(
80 HgiTextureHandle& texture,
81 HdRenderBuffer* buffer,
82 HgiTextureUsageBits usage);
83
84 bool _converged;
85
86 SdfPath _aovBufferPath;
87 SdfPath _depthBufferPath;
88
89 HdRenderBuffer* _aovBuffer;
90 HdRenderBuffer* _depthBuffer;
91
92 HgiTextureHandle _aovTexture;
93 HgiTextureHandle _depthTexture;
94 HgiTextureHandle _aovTextureIntermediate;
95 HgiTextureHandle _depthTextureIntermediate;
96
97 HdxAovInputTask() = delete;
98 HdxAovInputTask(const HdxAovInputTask &) = delete;
99 HdxAovInputTask &operator =(const HdxAovInputTask &) = delete;
100};
101
102
108{
110 : aovBufferPath()
111 , depthBufferPath()
112 {}
113
114 SdfPath aovBufferPath;
115 SdfPath depthBufferPath;
116};
117
118// VtValue requirements
119HDX_API
120std::ostream& operator<<(std::ostream& out, const HdxAovInputTaskParams& pv);
121HDX_API
122bool operator==(const HdxAovInputTaskParams& lhs,
123 const HdxAovInputTaskParams& rhs);
124HDX_API
125bool operator!=(const HdxAovInputTaskParams& lhs,
126 const HdxAovInputTaskParams& rhs);
127
128
129PXR_NAMESPACE_CLOSE_SCOPE
130
131#endif
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:50
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:121
Adapter class providing data exchange with the client scene graph.
A task for taking input AOV data comming from a render buffer that was filled by render tasks and con...
Definition: aovInputTask.h:46
bool IsConverged() const override
Hooks for progressive rendering.
Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality.
Definition: task.h:45
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
AovInput parameters.
Definition: aovInputTask.h:108