/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* vk_descriptor_pool.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/23 18:34:23 by maldavid #+# #+# */ /* Updated: 2024/01/18 10:19:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include "vk_descriptor_pool.h" #include namespace mlx { void DescriptorPool::init(std::size_t n, VkDescriptorPoolSize* size) { VkDescriptorPoolCreateInfo poolInfo{}; poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; poolInfo.poolSizeCount = n; poolInfo.pPoolSizes = size; poolInfo.maxSets = 8192; poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; VkResult res = vkCreateDescriptorPool(Render_Core::get().getDevice().get(), &poolInfo, nullptr, &_pool); if(res != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create descriptor pool, %s", RCore::verbaliseResultVk(res)); } void DescriptorPool::destroy() noexcept { vkDestroyDescriptorPool(Render_Core::get().getDevice().get(), _pool, nullptr); _pool = VK_NULL_HANDLE; } }