HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imageShaderRenderPass.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 HDST_IMAGE_SHADER_RENDER_PASS_H
25 #define HDST_IMAGE_SHADER_RENDER_PASS_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdSt/api.h"
31 
32 #include <hboost/shared_ptr.hpp>
33 
35 
36 typedef hboost::shared_ptr<class HdStResourceRegistry>
38 typedef hboost::shared_ptr<class HdSt_ImageShaderRenderPass>
40 typedef hboost::shared_ptr<class HdSt_DrawBatch>
42 
43 class Hgi;
44 
45 /// \class HdSt_ImageShaderRenderPass
46 ///
47 /// A single, full-screen triangle render pass.
48 /// The task that creates this RenderPass should set a RenderPassShader on the
49 /// RenderPassState. The RenderPassShader is your full-screen post-effect.
50 /// The benefit of using RenderPassShader is that it participates in codegen.
51 /// This means your full-screen shader can use buffers created by other tasks.
52 ///
54 public:
55  HDST_API
57  HdRprimCollection const &collection);
58 
59  HDST_API
61 
62 protected:
63  virtual void _Prepare(TfTokenVector const &renderTags) override;
64 
65  virtual void _Execute(HdRenderPassStateSharedPtr const &renderPassState,
66  TfTokenVector const &renderTags) override;
67 
68  virtual void _MarkCollectionDirty() override;
69 
70 private:
71  // Setup a BAR for a single triangle
72  void _SetupVertexPrimvarBAR(HdStResourceRegistrySharedPtr const&);
73 
74  // We re-use the immediateBatch to draw the full-screen triangle.
75  HdRprimSharedData _sharedData;
76  HdStDrawItem _drawItem;
77  HdStDrawItemInstance _drawItemInstance;
78  HdSt_DrawBatchSharedPtr _immediateBatch;
79  Hgi* _hgi;
80 };
81 
83 
84 #endif
hboost::shared_ptr< class HdStResourceRegistry > HdStResourceRegistrySharedPtr
Definition: commandBuffer.h:44
hboost::shared_ptr< class HdSt_ImageShaderRenderPass > HdSt_ImageShaderRenderPassSharedPtr
GLuint index
Definition: glew.h:1814
hboost::shared_ptr< class HdRenderPassState > HdRenderPassStateSharedPtr
Definition: engine.h:42
virtual void _Execute(HdRenderPassStateSharedPtr const &renderPassState, TfTokenVector const &renderTags) override
virtual void _MarkCollectionDirty() override
Optional API: let derived classes mark their collection tracking as dirty.
hboost::shared_ptr< class HdSt_DrawBatch > HdSt_DrawBatchSharedPtr
Definition: commandBuffer.h:49
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
HDST_API HdSt_ImageShaderRenderPass(HdRenderIndex *index, HdRprimCollection const &collection)
Definition: hgi.h:56
PXR_NAMESPACE_OPEN_SCOPE typedef hboost::shared_ptr< class HdStResourceRegistry > HdStResourceRegistrySharedPtr
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
#define HDST_API
Definition: api.h:40
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
virtual HDST_API ~HdSt_ImageShaderRenderPass()
virtual void _Prepare(TfTokenVector const &renderTags) override
Optional API: let derived classes prepare data.
hboost::shared_ptr< class HdSt_DrawBatch > HdSt_DrawBatchSharedPtr