| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

RenderPipeline.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "Subpass.h"
4 #include "NonCopyable.hpp"
5 #include <entt/entity/registry.hpp>
6
7 namespace Fling
8 {
9 class CommandBuffer;
10 class LogicalDevice;
11 class Swapchain;
12 class FrameBuffer;
13 class MeshRenderer;
14
19 class RenderPipeline : public NonCopyable
20 {
21 public:
22
23 RenderPipeline(entt::registry& t_Reg, LogicalDevice* t_dev, Swapchain* t_Swap, std::vector<std::unique_ptr<Subpass>>& t_Subpasses);
24 ~RenderPipeline();
25
26 void Draw(CommandBuffer& t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry& t_Reg, float DeltaTime);
27
29 void GatherPresentDependencies(std::vector<CommandBuffer*>& t_CmdBuffs, std::vector<VkSemaphore>& t_Deps, UINT32 t_ActiveFrameIndex, UINT32 t_CurrentFrameInFlight);
30
31 void GatherPresentBuffers(std::vector<CommandBuffer*>& t_CmdBuffs, UINT32 t_ActiveFrameIndex);
32
34 void CleanUp(entt::registry& t_reg);
35
36 private:
37
41 void CreateDescriptors(entt::registry& t_Reg);
42
43 std::vector<std::unique_ptr<Subpass>> m_Subpasses;
44
45 VkDescriptorPool m_DescriptorPool = VK_NULL_HANDLE;
46
47 const LogicalDevice* m_Device;
48
50 const Swapchain* m_SwapChain;
51 };
52 } // namespace Fling
Fling::RenderPipeline::GatherPresentDependencies
void GatherPresentDependencies(std::vector< CommandBuffer *> &t_CmdBuffs, std::vector< VkSemaphore > &t_Deps, UINT32 t_ActiveFrameIndex, UINT32 t_CurrentFrameInFlight)
Given a frame index, get any semaphores that the swap chain command buffer needs to wait for...
Definition: RenderPipeline.cpp:58
Fling::RenderPipeline::m_Subpasses
std::vector< std::unique_ptr< Subpass > > m_Subpasses
Definition: RenderPipeline.h:43
Fling::RenderPipeline::GatherPresentBuffers
void GatherPresentBuffers(std::vector< CommandBuffer *> &t_CmdBuffs, UINT32 t_ActiveFrameIndex)
Definition: RenderPipeline.cpp:66
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::Swapchain
Represents a swap chain that can be used throughout the program.
Definition: SwapChain.h:21
NonCopyable.hpp
Fling::RenderPipeline::~RenderPipeline
~RenderPipeline()
Definition: RenderPipeline.cpp:31
Fling::RenderPipeline::m_SwapChain
const Swapchain * m_SwapChain
Keep track of the swap chain so that we know how many frame buffers to create and what extents to use...
Definition: RenderPipeline.h:50
Fling::RenderPipeline::m_DescriptorPool
VkDescriptorPool m_DescriptorPool
Definition: RenderPipeline.h:45
Subpass.h
Fling::RenderPipeline::RenderPipeline
RenderPipeline(entt::registry &t_Reg, LogicalDevice *t_dev, Swapchain *t_Swap, std::vector< std::unique_ptr< Subpass >> &t_Subpasses)
Definition: RenderPipeline.cpp:11
Fling::RenderPipeline::CleanUp
void CleanUp(entt::registry &t_reg)
Clean up any allocated VK resources that may have been set in a sub pass and need the registry...
Definition: RenderPipeline.cpp:74
Fling::NonCopyable
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
Fling::RenderPipeline::Draw
void Draw(CommandBuffer &t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry &t_Reg, float DeltaTime)
Definition: RenderPipeline.cpp:41
Fling::RenderPipeline
A render pipeline encapsulates the functionality of a.
Definition: RenderPipeline.h:19
Fling::RenderPipeline::CreateDescriptors
void CreateDescriptors(entt::registry &t_Reg)
Creates the descriptor pool and the descriptor sets for each sub pass to use.
Definition: RenderPipeline.cpp:82
UINT32
uint32_t UINT32
Definition: FlingTypes.h:13
Fling
Definition: Engine.h:29
Fling::RenderPipeline::m_Device
const LogicalDevice * m_Device
Definition: RenderPipeline.h:47