/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* vk_queues.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:01:49 by maldavid #+# #+# */ /* Updated: 2024/01/03 15:26:31 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __MLX_VK_QUEUES__ #define __MLX_VK_QUEUES__ #include #include #include #include namespace mlx { class Queues { public: struct QueueFamilyIndices { std::optional graphicsFamily; std::optional presentFamily; inline bool isComplete() { return graphicsFamily.has_value() && presentFamily.has_value(); } }; QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device, VkSurfaceKHR surface); void init(); inline VkQueue& getGraphic() noexcept { return _graphicsQueue; } inline VkQueue& getPresent() noexcept { return _presentQueue; } inline QueueFamilyIndices getFamilies() noexcept { return *_families; } private: VkQueue _graphicsQueue; VkQueue _presentQueue; std::optional _families; }; } #endif // __MLX_VK_QUEUES__