Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Private Member Functions | Private Attributes
Fling::GeometrySubpass Class Reference

The geometry subpass is in charge of sending the geometry portion of the Deferred pipeline to the GPU. More...

#include <GeometrySubpass.h>

Inherits Fling::Subpass.

Public Member Functions

 GeometrySubpass (const LogicalDevice *t_Dev, const Swapchain *t_Swap, entt::registry &t_reg, VkRenderPass t_GlobalRenderPass, FirstPersonCamera *t_Cam, FrameBuffer *t_OffscreenDep, std::shared_ptr< Fling::Shader > t_Vert, std::shared_ptr< Fling::Shader > t_Frag)
 
virtual ~GeometrySubpass ()
 
void Draw (CommandBuffer &t_CmdBuf, VkFramebuffer t_PresentFrameBuf, UINT32 t_ActiveFrameInFlight, entt::registry &t_reg, float DeltaTime) override
 
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 the frame buffer has been prepared with it's attachments already. More...
 
void CreateGraphicsPipeline () override
 
- Public Member Functions inherited from Fling::Subpass
 Subpass (const LogicalDevice *t_Dev, const Swapchain *t_Swap, std::shared_ptr< Fling::Shader > t_Vert, std::shared_ptr< Fling::Shader > t_Frag)
 
virtual ~Subpass ()
 
virtual void PrepareAttachments ()
 Add any attachments to a frame buffer that this subpass may need. More...
 
virtual void CleanUp (entt::registry &t_reg)
 Cleanup any allocated resources that you may need a registry for. More...
 
virtual void GatherPresentDependencies (std::vector< CommandBuffer *> &t_CmdBuffs, std::vector< VkSemaphore > &t_Deps, UINT32 t_ActiveFrameIndex, UINT32 t_CurrentFrameInFlight)
 If a subpass has a command buffer that the final swap chain presentation is dependent on, then add it this vector. More...
 
virtual void GatherPresentBuffers (std::vector< CommandBuffer *> &t_CmdBuffs, UINT32 t_ActiveFrameIndex)
 If a subpass has an additional command buffer to add to the final swap chain draw submission but it is not dependent on it, then add it here. More...
 
GraphicsPipelineGetGraphicsPipeline () const noexcept
 
const std::vector< VkClearValue > & GetClearValues () const
 
- Public Member Functions inherited from Fling::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=default
 

Private Member Functions

void OnPointLightAdded (entt::entity t_Ent, entt::registry &t_Reg, PointLight &t_Light)
 
void UpdateLightingUBO (entt::registry &t_Reg, UINT32 t_ActiveFrame)
 

Private Attributes

std::shared_ptr< Modelm_QuadModel
 
VkRenderPass m_GlobalRenderPass = VK_NULL_HANDLE
 
const FirstPersonCameram_Camera
 
FrameBufferm_OffscreenFrameBuf = nullptr
 The offscreen frame buffer that has the G Buffer attachments. More...
 
std::vector< VkDescriptorSet > m_DescriptorSets
 
std::vector< Buffer * > m_LightingUboBuffers
 
std::vector< Buffer * > m_CameraUboBuffers
 
std::vector< Buffer * > m_QuadUboBuffer
 
LightingUbo m_LightingUBO = {}
 
CameraInfoUbo m_CamInfoUBO = {}
 

Additional Inherited Members

- Protected Member Functions inherited from Fling::NonCopyable
 NonCopyable ()=default
 
virtual ~NonCopyable ()=default
 
- Protected Attributes inherited from Fling::Subpass
const LogicalDevicem_Device
 
const Swapchainm_SwapChain
 
std::shared_ptr< Fling::Shaderm_VertexShader
 
std::shared_ptr< Fling::Shaderm_FragShader
 
std::vector< VkClearValue > m_ClearValues = std::vector<VkClearValue>(2)
 The clear values that will be used when building the command buffer to run this subpass. More...
 
GraphicsPipelinem_GraphicsPipeline = nullptr
 Layouts created in the constructor via shader reflection. More...
 

Detailed Description

The geometry subpass is in charge of sending the geometry portion of the Deferred pipeline to the GPU.

This includes frame buffer attachments for albedo, normals, and depth as well some actual mesh data via a Uniform buffer Uses the Deferred shaders

Constructor & Destructor Documentation

◆ GeometrySubpass()

Fling::GeometrySubpass::GeometrySubpass ( const LogicalDevice t_Dev,
const Swapchain t_Swap,
entt::registry &  t_reg,
VkRenderPass  t_GlobalRenderPass,
FirstPersonCamera t_Cam,
FrameBuffer t_OffscreenDep,
std::shared_ptr< Fling::Shader t_Vert,
std::shared_ptr< Fling::Shader t_Frag 
)

◆ ~GeometrySubpass()

Fling::GeometrySubpass::~GeometrySubpass ( )
virtual

Member Function Documentation

◆ CreateDescriptorSets()

void Fling::GeometrySubpass::CreateDescriptorSets ( VkDescriptorPool  t_Pool,
entt::registry &  t_reg 
)
overridevirtual

Given the frame buffers and the registry, create any descriptor sets that we may need Assumes that the frame buffer has been prepared with it's attachments already.

Parameters
t_FrameBufferThe swap chain frame buffer

Implements Fling::Subpass.

◆ CreateGraphicsPipeline()

void Fling::GeometrySubpass::CreateGraphicsPipeline ( )
overridevirtual
Parameters
t_FrameBufferThe swap chain frame buffer

Implements Fling::Subpass.

◆ Draw()

void Fling::GeometrySubpass::Draw ( CommandBuffer t_CmdBuf,
VkFramebuffer  t_PresentFrameBuf,
UINT32  t_ActiveFrameInFlight,
entt::registry &  t_reg,
float  DeltaTime 
)
overridevirtual

Implements Fling::Subpass.

◆ OnPointLightAdded()

void Fling::GeometrySubpass::OnPointLightAdded ( entt::entity  t_Ent,
entt::registry &  t_Reg,
PointLight t_Light 
)
private

◆ UpdateLightingUBO()

void Fling::GeometrySubpass::UpdateLightingUBO ( entt::registry &  t_Reg,
UINT32  t_ActiveFrame 
)
private

Field Documentation

◆ m_Camera

const FirstPersonCamera* Fling::GeometrySubpass::m_Camera
private

◆ m_CameraUboBuffers

std::vector<Buffer*> Fling::GeometrySubpass::m_CameraUboBuffers
private

◆ m_CamInfoUBO

CameraInfoUbo Fling::GeometrySubpass::m_CamInfoUBO = {}
private

◆ m_DescriptorSets

std::vector<VkDescriptorSet> Fling::GeometrySubpass::m_DescriptorSets
private

◆ m_GlobalRenderPass

VkRenderPass Fling::GeometrySubpass::m_GlobalRenderPass = VK_NULL_HANDLE
private

◆ m_LightingUBO

LightingUbo Fling::GeometrySubpass::m_LightingUBO = {}
private

◆ m_LightingUboBuffers

std::vector<Buffer*> Fling::GeometrySubpass::m_LightingUboBuffers
private

◆ m_OffscreenFrameBuf

FrameBuffer* Fling::GeometrySubpass::m_OffscreenFrameBuf = nullptr
private

The offscreen frame buffer that has the G Buffer attachments.

◆ m_QuadModel

std::shared_ptr<Model> Fling::GeometrySubpass::m_QuadModel
private

◆ m_QuadUboBuffer

std::vector<Buffer*> Fling::GeometrySubpass::m_QuadUboBuffer
private

The documentation for this class was generated from the following files: