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);
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 
48 
51  };
52 } // namespace Fling
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
std::vector< std::unique_ptr< Subpass > > m_Subpasses
Definition: RenderPipeline.h:43
void GatherPresentBuffers(std::vector< CommandBuffer *> &t_CmdBuffs, UINT32 t_ActiveFrameIndex)
Definition: RenderPipeline.cpp:66
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
Represents a swap chain that can be used throughout the program.
Definition: SwapChain.h:21
~RenderPipeline()
Definition: RenderPipeline.cpp:31
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
VkDescriptorPool m_DescriptorPool
Definition: RenderPipeline.h:45
RenderPipeline(entt::registry &t_Reg, LogicalDevice *t_dev, Swapchain *t_Swap, std::vector< std::unique_ptr< Subpass >> &t_Subpasses)
Definition: RenderPipeline.cpp:11
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
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
void Draw(CommandBuffer &t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry &t_Reg, float DeltaTime)
Definition: RenderPipeline.cpp:41
A render pipeline encapsulates the functionality of a.
Definition: RenderPipeline.h:19
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_t UINT32
Definition: FlingTypes.h:13
Definition: Engine.h:29
const LogicalDevice * m_Device
Definition: RenderPipeline.h:47