Loading...
Searching...
No Matches
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_ST_RENDER_PASS_H
8#define PXR_IMAGING_HD_ST_RENDER_PASS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hdSt/commandBuffer.h"
13#include "pxr/imaging/hd/renderPass.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17class Hgi;
18
23class HdSt_RenderPass : public HdRenderPass {
24public:
25 HDST_API
26 HdSt_RenderPass(HdRenderIndex *index, HdRprimCollection const &collection);
27 HDST_API
28 virtual ~HdSt_RenderPass();
29
35 HDST_API
36 bool HasDrawItems(TfTokenVector const &renderTags) const;
37
38protected:
39 virtual void _Execute(HdRenderPassStateSharedPtr const &renderPassState,
40 TfTokenVector const &renderTags) override;
41
42 virtual void _MarkCollectionDirty() override;
43
44private:
45 void _UpdateDrawItems(TfTokenVector const& renderTags);
46 void _UpdateCommandBuffer(TfTokenVector const& renderTags);
47
48 // -----------------------------------------------------------------------
49 // Drawing state
50 HdStCommandBuffer _cmdBuffer;
51
52 int _lastSettingsVersion;
53 bool _useTinyPrimCulling;
54
55 // -----------------------------------------------------------------------
56 // Change tracking state.
57 // XXX: This is necessary only when not using the draw items cache.
58
59 // The version number of the currently held collection.
60 int _collectionVersion;
61
62 // The version number of the render tag opinion of rprims
63 int _rprimRenderTagVersion;
64
65 // The version number of the render tags opinion of tasks.
66 int _taskRenderTagsVersion;
67
68 // The renderTags passed to _Execute(), for comparison next _Execute().
69 TfTokenVector _prevRenderTags;
70
71 // The version number of the material tags (of the rprims).
72 unsigned int _materialTagsVersion;
73
74 // The version number of the geom subset draw items.
75 unsigned int _geomSubsetDrawItemsVersion;
76
77 // A flag indicating that the held collection changed since this renderPass
78 // was last drawn.
79 //
80 // When _collectionChanged is true, it indicates that _collectionVersion is
81 // no longer accurate, because _collectionVersion was stored for the
82 // previously held collection.
83 bool _collectionChanged;
84
85 // -----------------------------------------------------------------------
86 // DrawItems that are used to build the draw batches.
87 HdDrawItemConstPtrVectorSharedPtr _drawItems;
88 size_t _drawItemCount;
89 bool _drawItemsChanged;
90
91 Hgi* _hgi;
92};
93
94PXR_NAMESPACE_CLOSE_SCOPE
95
96#endif // PXR_IMAGING_HD_ST_RENDER_PASS_H
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:105
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 _MarkCollectionDirty()
Optional API: let derived classes mark their collection tracking as dirty.
Definition: renderPass.h:101
A named, semantic collection of objects.
A buffer of commands (HdStDrawItem or HdComputeItem objects) to be executed.
Definition: commandBuffer.h:47
Hydra Graphics Interface.
Definition: hgi.h:95
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440