Graphics queue
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,71 @@
|
||||
/*********************************************************************
|
||||
* \file VulkanQueue.hpp
|
||||
*
|
||||
* \author Romain BOULLARD
|
||||
* \date September 2026
|
||||
*********************************************************************/
|
||||
#ifndef BIGFOOT_GRAPHICSVULKAN_VULKANQUEUE_HPP
|
||||
#define BIGFOOT_GRAPHICSVULKAN_VULKANQUEUE_HPP
|
||||
#include <GraphicsVulkan/VulkanInclude.hpp>
|
||||
|
||||
#include <GraphicsInterface/GraphicsQueue.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
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
|
||||
@@ -0,0 +1,38 @@
|
||||
/*********************************************************************
|
||||
* \file VulkanQueue.cpp
|
||||
*
|
||||
* \author Romain BOULLARD
|
||||
* \date September 2026
|
||||
*********************************************************************/
|
||||
#include <GraphicsVulkan/VulkanQueue.hpp>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user