HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
presentTask.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 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_PRESENT_TASK_H
25 #define PXR_IMAGING_HDX_PRESENT_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/tokens.h"
32 
34 
35 
36 /// \class HdxPresentTask
37 ///
38 /// A task for taking the final result of the aovs and compositing it over the
39 /// currently bound framebuffer.
40 /// This task uses the 'color' and optionally 'depth' aov's in the task
41 /// context.
42 ///
43 class HdxPresentTask : public HdxTask
44 {
45 public:
46  HDX_API
47  HdxPresentTask(HdSceneDelegate* delegate, SdfPath const& id);
48 
49  HDX_API
50  virtual ~HdxPresentTask();
51 
52  HDX_API
53  virtual void Prepare(HdTaskContext* ctx,
54  HdRenderIndex* renderIndex) override;
55 
56  HDX_API
57  virtual void Execute(HdTaskContext* ctx) override;
58 
59 protected:
60  HDX_API
61  virtual void _Sync(HdSceneDelegate* delegate,
62  HdTaskContext* ctx,
63  HdDirtyBits* dirtyBits) override;
64 
65 private:
66  TfToken _interopDst;
67  HgiInterop _interop;
68 
69  HdxPresentTask() = delete;
70  HdxPresentTask(const HdxPresentTask &) = delete;
71  HdxPresentTask &operator =(const HdxPresentTask &) = delete;
72 };
73 
74 
75 /// \class HdxPresentTaskParams
76 ///
77 /// PresentTask parameters.
78 ///
80 {
82  : interopDst(HgiTokens->OpenGL)
83  {}
84 
85  // The graphics lib that is used by the application / viewer.
86  // (The 'interopSrc' is determined by checking Hgi->GetAPIName)
88 };
89 
90 // VtValue requirements
91 HDX_API
92 std::ostream& operator<<(std::ostream& out, const HdxPresentTaskParams& pv);
93 HDX_API
94 bool operator==(const HdxPresentTaskParams& lhs,
95  const HdxPresentTaskParams& rhs);
96 HDX_API
97 bool operator!=(const HdxPresentTaskParams& lhs,
98  const HdxPresentTaskParams& rhs);
99 
100 
102 
103 #endif
uint32_t HdDirtyBits
Definition: types.h:127
#define HDX_API
Definition: api.h:40
virtual HDX_API void _Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) override
Definition: token.h:87
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:563
Definition: path.h:288
std::unordered_map< TfToken, VtValue, TfToken::HashFunctor > HdTaskContext
Definition: renderIndex.h:73
Definition: task.h:44
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
virtual HDX_API void Execute(HdTaskContext *ctx) override
HDX_API std::ostream & operator<<(std::ostream &out, const HdxPresentTaskParams &pv)
virtual HDX_API ~HdxPresentTask()
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:549
virtual HDX_API void Prepare(HdTaskContext *ctx, HdRenderIndex *renderIndex) override