Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
DebugSubpass.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Subpass.h"
4 
5 namespace Fling
6 {
7  class CommandBuffer;
8  class LogicalDevice;
9  class FrameBuffer;
10  class MeshRenderer;
11  class Swapchain;
12  class FirstPersonCamera;
13 
14  class DebugSubpass : public Subpass
15  {
16  public:
18  const LogicalDevice* t_Dev,
19  const Swapchain* t_Swap,
20  entt::registry& t_reg,
21  VkRenderPass t_GlobalRenderPass,
22  FirstPersonCamera* t_Cam,
23  std::shared_ptr<Fling::Shader> t_Vert,
24  std::shared_ptr<Fling::Shader> t_Frag
25  );
26 
27  virtual ~DebugSubpass();
28 
29  void Draw(CommandBuffer& t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry& t_reg, float DeltaTime) override;
30 
31  void CreateDescriptorSets(VkDescriptorPool t_Pool, entt::registry& t_reg) override;
32 
33  void PrepareAttachments() override;
34 
35  void CreateGraphicsPipeline() override;
36 
37  void CleanUp(entt::registry& t_reg) override;
38 
39  private:
40 
41  void OnMeshRendererAdded(entt::entity t_Ent, entt::registry& t_Reg, MeshRenderer& t_MeshRend);
42 
43  void CreateMeshDescriptorSet(MeshRenderer& t_MeshRend);
44 
45  VkRenderPass m_GlobalRenderPass = VK_NULL_HANDLE;
46 
48 
49  struct DebugUBO
50  {
51  glm::mat4 Projection;
52  glm::mat4 Model;
53  } m_Ubo;
54 
55  VkDescriptorPool m_DescriptorPool = VK_NULL_HANDLE;
56  };
57 } // namespace Fling
void Draw(CommandBuffer &t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry &t_reg, float DeltaTime) override
Definition: DebugSubpass.cpp:40
struct Fling::DebugSubpass::DebugUBO m_Ubo
Definition: DebugSubpass.h:49
A subpass represents one part of a RenderPipeline.
Definition: Subpass.h:25
void OnMeshRendererAdded(entt::entity t_Ent, entt::registry &t_Reg, MeshRenderer &t_MeshRend)
Definition: DebugSubpass.cpp:179
A simple first person camera.
Definition: FirstPersonCamera.h:9
Encapsulates functionality of a Vulkan Command buffer.
Definition: CommandBuffer.h:17
A logical device represents the application view of the device.
Definition: LogicalDevice.h:13
void CreateGraphicsPipeline() override
Definition: DebugSubpass.cpp:156
Represents a swap chain that can be used throughout the program.
Definition: SwapChain.h:21
VkRenderPass m_GlobalRenderPass
Definition: DebugSubpass.h:45
virtual ~DebugSubpass()
Definition: DebugSubpass.cpp:35
void CreateDescriptorSets(VkDescriptorPool t_Pool, entt::registry &t_reg) override
Given the frame buffers and the registry, create any descriptor sets that we may need Assumes that th...
Definition: DebugSubpass.cpp:99
void PrepareAttachments() override
Add any attachments to a frame buffer that this subpass may need.
Definition: DebugSubpass.cpp:134
DebugSubpass(const LogicalDevice *t_Dev, const Swapchain *t_Swap, entt::registry &t_reg, VkRenderPass t_GlobalRenderPass, FirstPersonCamera *t_Cam, std::shared_ptr< Fling::Shader > t_Vert, std::shared_ptr< Fling::Shader > t_Frag)
Definition: DebugSubpass.cpp:18
glm::mat4 Projection
Definition: DebugSubpass.h:51
const FirstPersonCamera * m_Camera
Definition: DebugSubpass.h:47
void CleanUp(entt::registry &t_reg) override
Cleanup any allocated resources that you may need a registry for.
Definition: DebugSubpass.cpp:170
glm::mat4 Model
Definition: DebugSubpass.h:52
VkDescriptorPool m_DescriptorPool
Definition: DebugSubpass.h:55
void CreateMeshDescriptorSet(MeshRenderer &t_MeshRend)
Definition: DebugSubpass.cpp:104
uint32_t UINT32
Definition: FlingTypes.h:13
Definition: Engine.h:29
Definition: MeshRenderer.h:12
Definition: DebugSubpass.h:14