working on code refactor

This commit is contained in:
2024-04-23 20:59:50 +02:00
parent 215a0dc2c3
commit ace4c98945
53 changed files with 1378 additions and 1403 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/23 18:32:43 by maldavid #+# #+# */
/* Updated: 2024/03/27 23:00:29 by maldavid ### ########.fr */
/* Updated: 2024/04/23 19:36:03 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,8 +20,9 @@ namespace mlx
public:
DescriptorPool() = default;
void Init(std::size_t n, NonOwningPtr<VkDescriptorPoolSize> size);
void FreeDescriptor(const class DescriptorSet& set);
void Init(std::vector<VkDescriptorPoolSize> sizes);
VkDescriptorSet AllocateDescriptorSet(class DescriptorSetLayout& layout);
void FreeDescriptor(VkDescriptorSet set);
void Destroy() noexcept;
inline VkDescriptorPool& operator()() noexcept { return m_pool; }

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/20 06:26:26 by maldavid #+# #+# */
/* Updated: 2024/03/27 23:00:56 by maldavid ### ########.fr */
/* Updated: 2024/04/23 19:40:22 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,7 +22,7 @@ namespace mlx
public:
DescriptorPoolManager() = default;
DescriptorPool& GetAvailablePool(); // assumes the pool is for only one set allocation, may cause some issues if this is for more than one
DescriptorPool& GetAvailablePool();
void DestroyAllPools();
~DescriptorPoolManager() = default;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/23 18:39:36 by maldavid #+# #+# */
/* Updated: 2024/03/27 23:02:38 by maldavid ### ########.fr */
/* Updated: 2024/04/23 19:49:02 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,6 +14,7 @@
#define __VK_DESCRIPTOR_SET__
#include <Renderer/Core/RenderCore.h>
#include <Renderer/Descriptors/DescriptorSetLayout.h>
namespace mlx
{
@@ -22,7 +23,7 @@ namespace mlx
public:
DescriptorSet() = default;
void Init(class Renderer* renderer, class DescriptorPool* pool, class DescriptorSetLayout* layout);
void Init(NonOwningPtr<class Renderer> renderer, NonOwningPtr<class DescriptorPool> pool, DescriptorSetLayout layout);
void WriteDescriptor(int binding, NonOwningPtr<class UniformBuffer> ubo) const noexcept;
void WriteDescriptor(int binding, const class Image& image) const noexcept;
@@ -41,9 +42,9 @@ namespace mlx
~DescriptorSet() = default;
private:
DescriptorSetLayout p_layout;
std::array<VkDescriptorSet, MAX_FRAMES_IN_FLIGHT> m_desc_set;
NonOwningPtr<class DescriptorPool> p_pool;
NonOwningPtr<class DescriptorSetLayout> p_layout;
NonOwningPtr<class Renderer> p_renderer;
};
}

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/23 18:36:22 by maldavid #+# #+# */
/* Updated: 2024/03/27 23:03:04 by maldavid ### ########.fr */
/* Updated: 2024/04/23 19:50:50 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */