Created a descriptor pool for Graphics System
This commit is contained in:
parent
fe954271cb
commit
d7954245d6
|
@ -11,7 +11,7 @@ namespace SHADE
|
||||||
/* Constructor/Destructor */
|
/* Constructor/Destructor */
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
SHVkDescriptorPool::SHVkDescriptorPool(Handle<SHVkLogicalDevice> device, const Config& config)
|
SHVkDescriptorPool::SHVkDescriptorPool(Handle<SHVkLogicalDevice> device, const Config& config)
|
||||||
: device { device }
|
: device{ device }
|
||||||
{
|
{
|
||||||
// Create the Pool
|
// Create the Pool
|
||||||
const vk::DescriptorPoolCreateInfo POOL_CREATE_INFO
|
const vk::DescriptorPoolCreateInfo POOL_CREATE_INFO
|
||||||
|
@ -24,12 +24,32 @@ namespace SHADE
|
||||||
pool = device->GetVkLogicalDevice().createDescriptorPool(POOL_CREATE_INFO);
|
pool = device->GetVkLogicalDevice().createDescriptorPool(POOL_CREATE_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHVkDescriptorPool::SHVkDescriptorPool(SHVkDescriptorPool&& rhs) noexcept
|
||||||
|
: device{ rhs.device }
|
||||||
|
, pool{ rhs.pool }
|
||||||
|
{
|
||||||
|
rhs.pool = VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
SHVkDescriptorPool::~SHVkDescriptorPool() noexcept
|
SHVkDescriptorPool::~SHVkDescriptorPool() noexcept
|
||||||
{
|
{
|
||||||
if (pool)
|
if (pool)
|
||||||
device->GetVkLogicalDevice().destroyDescriptorPool(pool);
|
device->GetVkLogicalDevice().destroyDescriptorPool(pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SHVkDescriptorPool& SHVkDescriptorPool::operator=(SHVkDescriptorPool&& rhs) noexcept
|
||||||
|
{
|
||||||
|
if (&rhs == this)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
device = rhs.device;
|
||||||
|
pool = rhs.pool;
|
||||||
|
|
||||||
|
rhs.pool = VK_NULL_HANDLE;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<Handle<SHVkDescriptorSetGroup>> SHVkDescriptorPool::Allocate(const std::vector<Handle<SHVkDescriptorSetLayout>>& layouts, std::vector<uint32_t> const& variableDescCounts)
|
std::vector<Handle<SHVkDescriptorSetGroup>> SHVkDescriptorPool::Allocate(const std::vector<Handle<SHVkDescriptorSetLayout>>& layouts, std::vector<uint32_t> const& variableDescCounts)
|
||||||
{
|
{
|
||||||
SHVkInstance::GetResourceManager().Create<SHVkDescriptorSetGroup>(device, GetHandle(), layouts, variableDescCounts);
|
SHVkInstance::GetResourceManager().Create<SHVkDescriptorSetGroup>(device, GetHandle(), layouts, variableDescCounts);
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace SHADE
|
||||||
/// </param>
|
/// </param>
|
||||||
SHVkDescriptorPool(Handle<SHVkLogicalDevice> device, const Config& config = {});
|
SHVkDescriptorPool(Handle<SHVkLogicalDevice> device, const Config& config = {});
|
||||||
SHVkDescriptorPool(const SHVkDescriptorPool&) = delete;
|
SHVkDescriptorPool(const SHVkDescriptorPool&) = delete;
|
||||||
SHVkDescriptorPool(SHVkDescriptorPool&& rhs) noexcept = default;
|
SHVkDescriptorPool(SHVkDescriptorPool&& rhs) noexcept;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Destructor which will unload and deallocate all resources for this Pool.
|
/// Destructor which will unload and deallocate all resources for this Pool.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -75,7 +75,7 @@ namespace SHADE
|
||||||
/* Overloaded Operators */
|
/* Overloaded Operators */
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
SHVkDescriptorPool& operator=(const SHVkDescriptorPool&) = delete;
|
SHVkDescriptorPool& operator=(const SHVkDescriptorPool&) = delete;
|
||||||
SHVkDescriptorPool& operator=(SHVkDescriptorPool&& rhs) noexcept = default;
|
SHVkDescriptorPool& operator=(SHVkDescriptorPool&& rhs) noexcept;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
/* Getter Functions */
|
/* Getter Functions */
|
||||||
|
|
|
@ -509,6 +509,12 @@ namespace SHADE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Handle<SHVkDescriptorPool> SHVkLogicalDevice::CreateDescriptorPools(const SHVkDescriptorPool::Config& config /*= {}*/) noexcept
|
||||||
|
{
|
||||||
|
return SHVkInstance::GetResourceManager().Create <SHVkDescriptorPool>(GetHandle(), config);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "Graphics/Pipeline/SHPipelineState.h"
|
#include "Graphics/Pipeline/SHPipelineState.h"
|
||||||
#include "Graphics/Pipeline/SHPipelineType.h"
|
#include "Graphics/Pipeline/SHPipelineType.h"
|
||||||
#include "vk_mem_alloc.h"
|
#include "vk_mem_alloc.h"
|
||||||
//#include "Graphics/DescriptorSets/SHDescriptorPool.h"
|
#include "Graphics/Descriptors/SHVkDescriptorPool.h"
|
||||||
#include "Graphics/Descriptors/SHVkDescriptorSetLayout.h"
|
#include "Graphics/Descriptors/SHVkDescriptorSetLayout.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
|
@ -165,6 +165,7 @@ namespace SHADE
|
||||||
Handle<SHVkRenderpass> CreateRenderpass (std::span<vk::AttachmentDescription> const vkDescriptions, std::span<vk::SubpassDescription> const spDescs, std::span<vk::SubpassDependency> const spDeps) noexcept;
|
Handle<SHVkRenderpass> CreateRenderpass (std::span<vk::AttachmentDescription> const vkDescriptions, std::span<vk::SubpassDescription> const spDescs, std::span<vk::SubpassDependency> const spDeps) noexcept;
|
||||||
Handle<SHVkFramebuffer> CreateFramebuffer (Handle<SHVkRenderpass> const& renderpassHdl, std::vector<Handle<SHVkImageView>> const& attachments, uint32_t inWidth, uint32_t inHeight) noexcept;
|
Handle<SHVkFramebuffer> CreateFramebuffer (Handle<SHVkRenderpass> const& renderpassHdl, std::vector<Handle<SHVkImageView>> const& attachments, uint32_t inWidth, uint32_t inHeight) noexcept;
|
||||||
Handle<SHVkDescriptorSetLayout> CreateDescriptorSetLayout (std::vector<SHVkDescriptorSetLayout::Binding> const& bindings) noexcept;
|
Handle<SHVkDescriptorSetLayout> CreateDescriptorSetLayout (std::vector<SHVkDescriptorSetLayout::Binding> const& bindings) noexcept;
|
||||||
|
Handle<SHVkDescriptorPool> CreateDescriptorPools (const SHVkDescriptorPool::Config& config = {}) noexcept;
|
||||||
Handle<SHVkPipelineLayout> CreatePipelineLayout (SHPipelineLayoutParams& pipelineLayoutParams) noexcept;
|
Handle<SHVkPipelineLayout> CreatePipelineLayout (SHPipelineLayoutParams& pipelineLayoutParams) noexcept;
|
||||||
Handle<SHVkFence> CreateFence (void) const noexcept;
|
Handle<SHVkFence> CreateFence (void) const noexcept;
|
||||||
Handle<SHVkSemaphore> CreateSemaphore (void) const noexcept;
|
Handle<SHVkSemaphore> CreateSemaphore (void) const noexcept;
|
||||||
|
|
|
@ -86,6 +86,8 @@ namespace SHADE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
descPool = device->CreateDescriptorPools();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
|
@ -22,6 +22,7 @@ of DigiPen Institute of Technology is prohibited.
|
||||||
#include "Graphics/MiddleEnd/PerFrame/SHRenderContext.h"
|
#include "Graphics/MiddleEnd/PerFrame/SHRenderContext.h"
|
||||||
#include "Graphics/RenderGraph/SHRenderGraph.h"
|
#include "Graphics/RenderGraph/SHRenderGraph.h"
|
||||||
#include "Engine/ECS_Base/System/SHSystem.h"
|
#include "Engine/ECS_Base/System/SHSystem.h"
|
||||||
|
#include "Graphics/Descriptors/SHVkDescriptorPool.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
|
@ -113,7 +114,8 @@ namespace SHADE
|
||||||
Handle<SHVkSwapchain> GetSwapchain() const { return swapchain; }
|
Handle<SHVkSwapchain> GetSwapchain() const { return swapchain; }
|
||||||
Handle<SHVkSurface> GetSurface() const { return surface; }
|
Handle<SHVkSurface> GetSurface() const { return surface; }
|
||||||
Handle<SHVkPhysicalDevice> GetPhysicalDevice() const {return physicalDevice;}
|
Handle<SHVkPhysicalDevice> GetPhysicalDevice() const {return physicalDevice;}
|
||||||
Handle<SHVkQueue> GetQueue () const {return queue;}
|
Handle<SHVkQueue> GetQueue() const { return queue; }
|
||||||
|
Handle<SHVkDescriptorPool> GetDescriptorPool() const { return descPool; }
|
||||||
//Handle<SHVkRenderpass> GetRenderPass() const { return renderPass; }
|
//Handle<SHVkRenderpass> GetRenderPass() const { return renderPass; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,6 +129,7 @@ namespace SHADE
|
||||||
Handle<SHVkSurface> surface;
|
Handle<SHVkSurface> surface;
|
||||||
Handle<SHVkSwapchain> swapchain;
|
Handle<SHVkSwapchain> swapchain;
|
||||||
Handle<SHVkQueue> queue;
|
Handle<SHVkQueue> queue;
|
||||||
|
Handle<SHVkDescriptorPool> descPool;
|
||||||
//Handle<SHVkRenderpass> renderPass; // Potentially bring out?
|
//Handle<SHVkRenderpass> renderPass; // Potentially bring out?
|
||||||
std::vector<SHScreenSegment> screenSegments;
|
std::vector<SHScreenSegment> screenSegments;
|
||||||
SHRenderContext renderContext;
|
SHRenderContext renderContext;
|
||||||
|
|
Loading…
Reference in New Issue