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 HDX_DRAW_TARGET_RENDER_PASS_H
25 #define 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 boost::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 
69  HDX_API
70  void SetRenderPassState(const HdStDrawTargetRenderPassState *renderPassState);
71 
73  HDX_API
74  void SetRprimCollection(HdRprimCollection const& col);
75 
77  HDX_API
78  void Sync();
79 
81  HDX_API
82  void Prepare();
83 
85  HDX_API
86  void Execute(HdRenderPassStateSharedPtr const &renderPassState,
87  TfTokenVector const &renderTags);
88 
89 private:
91  HdSt_RenderPass _renderPass;
92 
94  const HdStDrawTargetRenderPassState *_drawTargetRenderPassState;
95 
97  GlfDrawTargetRefPtr _drawTarget;
98 
100  GlfGLContextSharedPtr _drawTargetContext;
101 
102  unsigned int _collectionObjectVersion;
103 
105  void _ClearBuffers();
106 
107  // No default/copy
108  HdxDrawTargetRenderPass() = delete;
109  HdxDrawTargetRenderPass(const HdxDrawTargetRenderPass &) = delete;
110  HdxDrawTargetRenderPass &operator =(const HdxDrawTargetRenderPass &) = delete;
111 };
112 
113 
114 PXR_NAMESPACE_CLOSE_SCOPE
115 
116 #endif // 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:119
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:438
A named, semantic collection of objects.
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.