| 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:
17 DebugSubpass(
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
47 const FirstPersonCamera* m_Camera;
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
Fling::DebugSubpass::Draw
void Draw(CommandBuffer &t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry &t_reg, float DeltaTime) override
Definition: DebugSubpass.cpp:40
Fling::DebugSubpass::m_Ubo
struct Fling::DebugSubpass::DebugUBO m_Ubo
Fling::DebugSubpass::DebugUBO
Definition: DebugSubpass.h:49
Fling::Subpass
A subpass represents one part of a RenderPipeline.
Definition: Subpass.h:25
Fling::DebugSubpass::OnMeshRendererAdded
void OnMeshRendererAdded(entt::entity t_Ent, entt::registry &t_Reg, MeshRenderer &t_MeshRend)
Definition: DebugSubpass.cpp:179
Fling::FirstPersonCamera
A simple first person camera.
Definition: FirstPersonCamera.h:9
Fling::CommandBuffer
Encapsulates functionality of a Vulkan Command buffer.
Definition: CommandBuffer.h:17
Fling::LogicalDevice
A logical device represents the application view of the device.
Definition: LogicalDevice.h:13
Fling::DebugSubpass::CreateGraphicsPipeline
void CreateGraphicsPipeline() override
Definition: DebugSubpass.cpp:156
Fling::Swapchain
Represents a swap chain that can be used throughout the program.
Definition: SwapChain.h:21
Fling::DebugSubpass::m_GlobalRenderPass
VkRenderPass m_GlobalRenderPass
Definition: DebugSubpass.h:45
Fling::DebugSubpass::~DebugSubpass
virtual ~DebugSubpass()
Definition: DebugSubpass.cpp:35
Fling::DebugSubpass::CreateDescriptorSets
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
Fling::DebugSubpass::PrepareAttachments
void PrepareAttachments() override
Add any attachments to a frame buffer that this subpass may need.
Definition: DebugSubpass.cpp:134
Fling::DebugSubpass::DebugSubpass
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
Fling::DebugSubpass::DebugUBO::Projection
glm::mat4 Projection
Definition: DebugSubpass.h:51
Subpass.h
Fling::DebugSubpass::m_Camera
const FirstPersonCamera * m_Camera
Definition: DebugSubpass.h:47
Fling::DebugSubpass::CleanUp
void CleanUp(entt::registry &t_reg) override
Cleanup any allocated resources that you may need a registry for.
Definition: DebugSubpass.cpp:170
Fling::DebugSubpass::DebugUBO::Model
glm::mat4 Model
Definition: DebugSubpass.h:52
Fling::DebugSubpass::m_DescriptorPool
VkDescriptorPool m_DescriptorPool
Definition: DebugSubpass.h:55
Fling::DebugSubpass::CreateMeshDescriptorSet
void CreateMeshDescriptorSet(MeshRenderer &t_MeshRend)
Definition: DebugSubpass.cpp:104
UINT32
uint32_t UINT32
Definition: FlingTypes.h:13
Fling
Definition: Engine.h:29
Fling::MeshRenderer
Definition: MeshRenderer.h:12
Fling::DebugSubpass
Definition: DebugSubpass.h:14