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 terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HD_ST_IMAGE_SHADER_RENDER_PASS_H
8 #define PXR_IMAGING_HD_ST_IMAGE_SHADER_RENDER_PASS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hdSt/api.h"
14 
15 #include <memory>
16 
18 
20  std::shared_ptr<class HdStResourceRegistry>;
21 
23  std::shared_ptr<class HdSt_ImageShaderRenderPass>;
25  std::shared_ptr<class HdStResourceRegistry>;
26 
27 class Hgi;
28 
29 /// \class HdSt_ImageShaderRenderPass
30 ///
31 /// A single, full-screen triangle render pass.
32 /// The task that creates this RenderPass should set a RenderPassShader on the
33 /// RenderPassState. The RenderPassShader is your full-screen post-effect.
34 /// The benefit of using RenderPassShader is that it participates in codegen.
35 /// This means your full-screen shader can use buffers created by other tasks.
36 ///
38 public:
39  HDST_API
41  HdRprimCollection const &collection);
42 
43  HDST_API
45 
46  // Set the vertex BAR and geometric shader for the triangle.
47  // This function should be called before the Execute task phase.
48  HDST_API
50 protected:
51 
52  void _Execute(HdRenderPassStateSharedPtr const &renderPassState,
53  TfTokenVector const &renderTags) override;
54 
55 private:
56  // Setup a BAR for a single triangle
57  void _SetupVertexPrimvarBAR(HdStResourceRegistrySharedPtr const&);
58 
59  // We re-use the immediateBatch to draw the full-screen triangle.
60  HdRprimSharedData _sharedData;
61  HdStDrawItem _drawItem;
62  HdStDrawItemInstance _drawItemInstance;
63  HdSt_DrawBatchSharedPtr _drawBatch;
64  Hgi* _hgi;
65 };
66 
68 
69 #endif
std::shared_ptr< class HdRenderPassState > HdRenderPassStateSharedPtr
Definition: engine.h:25
std::shared_ptr< class HdSt_ImageShaderRenderPass > HdSt_ImageShaderRenderPassSharedPtr
void _Execute(HdRenderPassStateSharedPtr const &renderPassState, TfTokenVector const &renderTags) override
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
HDST_API HdSt_ImageShaderRenderPass(HdRenderIndex *index, HdRprimCollection const &collection)
Definition: hgi.h:93
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define HDST_API
Definition: api.h:23
GLuint index
Definition: glcorearb.h:786
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
virtual HDST_API ~HdSt_ImageShaderRenderPass()
std::shared_ptr< class HdStResourceRegistry > HdStResourceRegistrySharedPtr
Definition: commandBuffer.h:30
HDST_API void SetupFullscreenTriangleDrawItem()
std::shared_ptr< class HdSt_DrawBatch > HdSt_DrawBatchSharedPtr
Definition: commandBuffer.h:36