All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
drawTargetRenderPass.h
1 //
2 // Copyright 2016 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_DRAW_TARGET_RENDER_PASS_H
25 #define PXR_IMAGING_HDX_DRAW_TARGET_RENDER_PASS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdx/api.h"
29 #include "pxr/imaging/hdSt/renderPass.h"
30 #include "pxr/imaging/hd/rprimCollection.h"
31 
32 #include "pxr/imaging/glf/drawTarget.h"
33 
34 #include <vector>
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
38 
39 typedef std::shared_ptr<class GlfGLContext> GlfGLContextSharedPtr;
40 
42 
51 class HdxDrawTargetRenderPass : boost::noncopyable {
52 public:
53  HDX_API
55  HDX_API
56  virtual ~HdxDrawTargetRenderPass();
57 
60  HDX_API
61  void SetDrawTarget(const GlfDrawTargetRefPtr &drawTarget);
62 
64  HDX_API
65  GlfDrawTargetRefPtr GetDrawTarget();
66 
68  HDX_API
69  void SetHasDependentDrawTargets(bool value);
70 
75  HDX_API
76  bool HasDependentDrawTargets() const;
77 
80  HDX_API
81  void SetRenderPassState(const HdStDrawTargetRenderPassState *renderPassState);
82 
84  HDX_API
85  void SetRprimCollection(HdRprimCollection const& col);
86 
88  HDX_API
89  void Sync();
90 
92  HDX_API
93  void Prepare();
94 
96  HDX_API
97  void Execute(HdRenderPassStateSharedPtr const &renderPassState,
98  TfTokenVector const &renderTags);
99 
100 private:
102  HdSt_RenderPass _renderPass;
103 
105  const HdStDrawTargetRenderPassState *_drawTargetRenderPassState;
106 
108  GlfDrawTargetRefPtr _drawTarget;
109 
111  GlfGLContextSharedPtr _drawTargetContext;
112 
113  unsigned int _collectionObjectVersion;
114 
115  bool _hasDependentDrawTargets;
116 
118  void _ClearBuffers();
119 
120  // No default/copy
121  HdxDrawTargetRenderPass() = delete;
122  HdxDrawTargetRenderPass(const HdxDrawTargetRenderPass &) = delete;
123  HdxDrawTargetRenderPass &operator =(const HdxDrawTargetRenderPass &) = delete;
124 };
125 
126 
127 PXR_NAMESPACE_CLOSE_SCOPE
128 
129 #endif // PXR_IMAGING_HDX_DRAW_TARGET_RENDER_PASS_H
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:121
HDX_API GlfDrawTargetRefPtr GetDrawTarget()
Returns the draw target associated to this render pass.
HDX_API void SetDrawTarget(const GlfDrawTargetRefPtr &drawTarget)
Sets the target draw object of this render pass containing the color buffers and depth buffer to use...
HDX_API void SetRenderPassState(const HdStDrawTargetRenderPassState *renderPassState)
Sets the non-context dependent state.
HDX_API void Prepare()
Prepare the draw target render pass.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:431
A named, semantic collection of objects.
HDX_API bool HasDependentDrawTargets() const
Whether other draw targets depend on this draw target.
HDX_API void Execute(HdRenderPassStateSharedPtr const &renderPassState, TfTokenVector const &renderTags)
Execute the draw target render pass.
HDX_API void Sync()
Sync the draw target render pass.
Represents an render pass that renders to a draw target.
HDX_API void SetRprimCollection(HdRprimCollection const &col)
Sets the collection of rprims associated to this render pass.
Represents common non-gl context specific render pass state for a draw target.
HDX_API void SetHasDependentDrawTargets(bool value)
Sets whether other draw targets depend on this draw target.