diff --git a/Bigfoot/Libs/Graphics/GraphicsInterface/Include/GraphicsInterface/GraphicsQueue.hpp b/Bigfoot/Libs/Graphics/GraphicsInterface/Include/GraphicsInterface/GraphicsQueue.hpp new file mode 100644 index 0000000..1d6775f --- /dev/null +++ b/Bigfoot/Libs/Graphics/GraphicsInterface/Include/GraphicsInterface/GraphicsQueue.hpp @@ -0,0 +1,47 @@ +/********************************************************************* + * \file GraphicsQueue.hpp + * + * \author Romain BOULLARD + * \date September 2026 + *********************************************************************/ +#ifndef BIGFOOT_GRAPHICSINTERFACE_GRAPHICSQUEUE_HPP +#define BIGFOOT_GRAPHICSINTERFACE_GRAPHICSQUEUE_HPP + +namespace Bigfoot +{ +/** + * The kind of work a GraphicsQueue submit + */ +enum class GraphicsQueueType +{ + Graphics, + Compute, + Transfer, + Present +}; + +class GraphicsQueue +{ + public: + virtual ~GraphicsQueue() = default; + + /** + * Get the kind of work this queue can be submitted + * + * \return The queue type + */ + [[nodiscard]] + virtual GraphicsQueueType GetType() const = 0; + + GraphicsQueue(const GraphicsQueue& p_queue) = delete; + GraphicsQueue(GraphicsQueue&& p_queue) = delete; + + GraphicsQueue& operator=(const GraphicsQueue& p_queue) = delete; + GraphicsQueue& operator=(GraphicsQueue&& p_queue) = delete; + + protected: + GraphicsQueue() = default; +}; +} // namespace Bigfoot + +#endif diff --git a/Bigfoot/Libs/Graphics/GraphicsVulkan/Include/GraphicsVulkan/VulkanQueue.hpp b/Bigfoot/Libs/Graphics/GraphicsVulkan/Include/GraphicsVulkan/VulkanQueue.hpp new file mode 100644 index 0000000..37f5ec4 --- /dev/null +++ b/Bigfoot/Libs/Graphics/GraphicsVulkan/Include/GraphicsVulkan/VulkanQueue.hpp @@ -0,0 +1,71 @@ +/********************************************************************* + * \file VulkanQueue.hpp + * + * \author Romain BOULLARD + * \date September 2026 + *********************************************************************/ +#ifndef BIGFOOT_GRAPHICSVULKAN_VULKANQUEUE_HPP +#define BIGFOOT_GRAPHICSVULKAN_VULKANQUEUE_HPP +#include + +#include + +#include + +namespace Bigfoot::Vulkan +{ +class VulkanQueue final: public GraphicsQueue +{ + public: + /** + * Constructor + * + * \param p_queue The underlying Vulkan queue handle + * \param p_familyIndex The queue family index this queue was retrieved from + * \param p_type The kind of work this queue can submit + */ + VulkanQueue(vk::Queue p_queue, std::uint32_t p_familyIndex, GraphicsQueueType p_type); + + /** + * Get the kind of work this queue can be submitted + * + * \return The queue type + */ + [[nodiscard]] + GraphicsQueueType GetType() const override; + + /** + * Get the underlying Vulkan queue handle + * + * \return The vk::Queue handle + */ + [[nodiscard]] + vk::Queue GetHandle() const; + + /** + * Get the index of the queue family this queue was retrieved from + * + * \return The queue family index + */ + [[nodiscard]] + std::uint32_t GetFamilyIndex() const; + + private: + /** + * The vulkn queue + */ + vk::Queue m_queue; + + /** + * The index of the queue family this queue was retrieved from + */ + std::uint32_t m_familyIndex; + + /** + * The kind of work this queue can submit + */ + GraphicsQueueType m_type; +}; +} // namespace Bigfoot::Vulkan + +#endif diff --git a/Bigfoot/Libs/Graphics/GraphicsVulkan/VulkanQueue.cpp b/Bigfoot/Libs/Graphics/GraphicsVulkan/VulkanQueue.cpp new file mode 100644 index 0000000..649d03a --- /dev/null +++ b/Bigfoot/Libs/Graphics/GraphicsVulkan/VulkanQueue.cpp @@ -0,0 +1,38 @@ +/********************************************************************* + * \file VulkanQueue.cpp + * + * \author Romain BOULLARD + * \date September 2026 + *********************************************************************/ +#include + +namespace Bigfoot::Vulkan +{ +VulkanQueue::VulkanQueue(const vk::Queue p_queue, const std::uint32_t p_familyIndex, const GraphicsQueueType p_type): + m_queue(p_queue), + m_familyIndex(p_familyIndex), + m_type(p_type) +{ +} + +/****************************************************************************************/ + +GraphicsQueueType VulkanQueue::GetType() const +{ + return m_type; +} + +/****************************************************************************************/ + +vk::Queue VulkanQueue::GetHandle() const +{ + return m_queue; +} + +/****************************************************************************************/ + +std::uint32_t VulkanQueue::GetFamilyIndex() const +{ + return m_familyIndex; +} +} // namespace Bigfoot::Vulkan