All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
renderPass.h
1//
2// Copyright 2016 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_HD_RENDER_PASS_H
8#define PXR_IMAGING_HD_RENDER_PASS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/rprimCollection.h"
14#include "pxr/imaging/hd/task.h"
15
16#include <memory>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20class HdRenderIndex;
21class HdSceneDelegate;
22
23using HdRenderPassSharedPtr = std::shared_ptr<class HdRenderPass>;
24using HdRenderPassStateSharedPtr = std::shared_ptr<class HdRenderPassState>;
25
53{
54public:
55 HD_API
56 HdRenderPass(HdRenderIndex *index, HdRprimCollection const& collection);
57 HD_API
58 virtual ~HdRenderPass();
59
61 HdRprimCollection const& GetRprimCollection() const { return _collection; }
62
65 HD_API
67
69 HdRenderIndex* GetRenderIndex() const { return _renderIndex; }
70
71 // ---------------------------------------------------------------------- //
73 // ---------------------------------------------------------------------- //
74
76 HD_API
77 void Sync();
78
79 // ---------------------------------------------------------------------- //
81 // ---------------------------------------------------------------------- //
82
84 HD_API
85 void Execute(HdRenderPassStateSharedPtr const &renderPassState,
86 TfTokenVector const &renderTags);
87
88 // ---------------------------------------------------------------------- //
90 // ---------------------------------------------------------------------- //
91
92 virtual bool IsConverged() const { return true; }
93
94protected:
97 virtual void _Execute(HdRenderPassStateSharedPtr const &renderPassState,
98 TfTokenVector const &renderTags) = 0;
99
101 virtual void _MarkCollectionDirty() {}
102
104 virtual void _Sync() {}
105
106private:
107
108 // Don't allow copies
109 HdRenderPass(const HdRenderPass &) = delete;
110 HdRenderPass &operator=(const HdRenderPass &) = delete;
111
112 // ---------------------------------------------------------------------- //
113 // \name Change Tracking State
114 // ---------------------------------------------------------------------- //
115 // The renderIndex to which this renderPass belongs
116 // (can't change after construction)
117 HdRenderIndex * const _renderIndex;
118
119 // ---------------------------------------------------------------------- //
120 // \name Core RenderPass State
121 // ---------------------------------------------------------------------- //
122 HdRprimCollection _collection;
123};
124
125PXR_NAMESPACE_CLOSE_SCOPE
126
127#endif //PXR_IMAGING_HD_RENDER_PASS_H
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:104
An abstract class representing a single render iteration over a set of prims (the HdRprimCollection),...
Definition: renderPass.h:53
virtual void _Execute(HdRenderPassStateSharedPtr const &renderPassState, TfTokenVector const &renderTags)=0
Virtual API: Execute the buckets corresponding to renderTags; renderTags.empty() implies execute ever...
virtual void _Sync()
Optional API: let derived classes sync data.
Definition: renderPass.h:104
HdRprimCollection const & GetRprimCollection() const
Returns the HdRprimCollection to be drawn by this RenderPass.
Definition: renderPass.h:61
HD_API void Execute(HdRenderPassStateSharedPtr const &renderPassState, TfTokenVector const &renderTags)
Execute a subset of buckets of this renderpass.
HdRenderIndex * GetRenderIndex() const
Return the render index.
Definition: renderPass.h:69
HD_API void SetRprimCollection(HdRprimCollection const &col)
Sets the HdRprimCollection, note that this may invalidate internal caches used to accelerate drawing.
virtual void _MarkCollectionDirty()
Optional API: let derived classes mark their collection tracking as dirty.
Definition: renderPass.h:101
HD_API void Sync()
Sync the render pass resources.
A named, semantic collection of objects.
Adapter class providing data exchange with the client scene graph.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440