Loading...
Searching...
No Matches
aovInputTask.h
1//
2// Copyright 2020 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HDX_AOV_INPUT_TASK_H
8#define PXR_IMAGING_HDX_AOV_INPUT_TASK_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdx/api.h"
12#include "pxr/imaging/hdx/task.h"
13#include "pxr/imaging/hgi/texture.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
18
31{
32public:
34
35 HDX_API
36 HdxAovInputTask(HdSceneDelegate* delegate, SdfPath const& id);
37
38 HDX_API
39 ~HdxAovInputTask() override;
40
42 bool IsConverged() const override;
43
44 HDX_API
45 void Prepare(
46 HdTaskContext* ctx,
47 HdRenderIndex* renderIndex) override;
48
49 HDX_API
50 void Execute(HdTaskContext* ctx) override;
51
52protected:
53 HDX_API
54 void _Sync(
55 HdSceneDelegate* delegate,
56 HdTaskContext* ctx,
57 HdDirtyBits* dirtyBits) override;
58
59private:
60 void _UpdateTexture(
61 HdTaskContext* ctx,
62 HgiTextureHandle& texture,
63 HdRenderBuffer* buffer,
64 HgiTextureUsageBits usage);
65
66 void _UpdateIntermediateTexture(
67 HgiTextureHandle& texture,
68 HdRenderBuffer* buffer,
69 HgiTextureUsageBits usage);
70
71 bool _converged;
72
73 SdfPath _aovBufferPath;
74 SdfPath _depthBufferPath;
75
76 HdRenderBuffer* _aovBuffer;
77 HdRenderBuffer* _depthBuffer;
78
79 HgiTextureHandle _aovTexture;
80 HgiTextureHandle _depthTexture;
81 HgiTextureHandle _aovTextureIntermediate;
82 HgiTextureHandle _depthTextureIntermediate;
83
84 HdxAovInputTask() = delete;
85 HdxAovInputTask(const HdxAovInputTask &) = delete;
86 HdxAovInputTask &operator =(const HdxAovInputTask &) = delete;
87};
88
89
95{
97
98 SdfPath aovBufferPath;
99 SdfPath depthBufferPath;
100};
101
102// VtValue requirements
103HDX_API
104std::ostream& operator<<(std::ostream& out, const HdxAovInputTaskParams& pv);
105HDX_API
106bool operator==(const HdxAovInputTaskParams& lhs,
107 const HdxAovInputTaskParams& rhs);
108HDX_API
109bool operator!=(const HdxAovInputTaskParams& lhs,
110 const HdxAovInputTaskParams& rhs);
111
112
113PXR_NAMESPACE_CLOSE_SCOPE
114
115#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:33
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:105
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:31
bool IsConverged() const override
Hooks for progressive rendering.
HDX_API void Prepare(HdTaskContext *ctx, HdRenderIndex *renderIndex) override
Prepare Phase: Resolve bindings and manage resources.
HDX_API void Execute(HdTaskContext *ctx) override
Execute Phase: Runs the task.
Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality.
Definition: task.h:28
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
AovInput parameters.
Definition: aovInputTask.h:95