HatchitGraphics
ht_renderpass_base.h
1 
23 #pragma once
24 
25 #include <ht_platform.h> //HT_API
26 #include <ht_math.h> //Math::Matrix4
27 #include <ht_renderpass_resource.h> //Resource::RenderPass
28 #include <ht_shadervariablechunk.h> //ShaderVariableChunk
29 
30 #include <ht_material.h> //MaterialHandle
31 #include <ht_mesh.h> //MeshHandle
32 #include <ht_rendertarget.h> //RenderTargetHandle
33 #include <ht_commandpool.h> //ICommandPool
34 
35 namespace Hatchit
36 {
37  namespace Graphics
38  {
40  {
41  PipelineHandle pipeline;
42  MaterialHandle material;
43  MeshHandle mesh;
44  ShaderVariableChunk* instanceData;
45  };
46 
47  struct Renderable
48  {
49  MaterialHandle material;
50  MeshHandle mesh;
51  };
52 
54  {
55  Renderable renderable;
56  uint32_t count;
57  };
58 
59  class HT_API RenderPassBase
60  {
61  public:
62  virtual ~RenderPassBase() { };
63 
64  virtual void VUpdate() = 0;
65 
66  void SetView(Math::Matrix4 view);
67  void SetProj(Math::Matrix4 proj);
68 
69  virtual bool VBuildCommandList(const ICommandPool* commandPool) = 0;
70 
71  virtual void ScheduleRenderRequest(MaterialHandle material, MeshHandle mesh, ShaderVariableChunk* instanceVariables);
72 
73  virtual uint64_t GetLayerFlags();
74 
75  protected:
76  void BuildRenderRequestHeirarchy();
77 
78  //Input
79  std::vector<RenderRequest> m_renderRequests;
80 
81  std::map<PipelineHandle, std::vector<RenderableInstances>> m_pipelineList;
82  std::map<MeshHandle, std::vector<ShaderVariableChunk*>> m_instanceData;
83 
84  //Output
85  std::vector<RenderTargetHandle> m_outputRenderTargets;
86 
87  //Internals
88  uint64_t m_layerflags = 1;
89 
90  uint32_t m_width;
91  uint32_t m_height;
92 
93  Math::Matrix4 m_view;
94  Math::Matrix4 m_proj;
95  };
96  }
97 }
Definition: ht_renderpass_base.h:47
Definition: ht_renderpass_base.h:53
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_renderpass_base.h:59
Definition: ht_commandpool.h:31
Definition: ht_renderpass_base.h:39
Definition: ht_shadervariablechunk.h:38