VkCV Framework  0.0.1
CV Vulkan framework
vkcv::QueueManager Class Reference

Public Member Functions

const QueuegetPresentQueue () const
 
const std::vector< Queue > & getGraphicsQueues () const
 
const std::vector< Queue > & getComputeQueues () const
 
const std::vector< Queue > & getTransferQueues () const
 

Static Public Member Functions

static QueueManager create (vk::Device device, std::vector< std::pair< int, int >> &queuePairsGraphics, std::vector< std::pair< int, int >> &queuePairsCompute, std::vector< std::pair< int, int >> &queuePairsTransfer)
 
static void queueCreateInfosQueueHandles (vk::PhysicalDevice &physicalDevice, const std::vector< float > &queuePriorities, const std::vector< vk::QueueFlagBits > &queueFlags, std::vector< vk::DeviceQueueCreateInfo > &queueCreateInfos, std::vector< std::pair< int, int >> &queuePairsGraphics, std::vector< std::pair< int, int >> &queuePairsCompute, std::vector< std::pair< int, int >> &queuePairsTransfer)
 
static uint32_t checkSurfaceSupport (const vk::PhysicalDevice &physicalDevice, vk::SurfaceKHR &surface)
 

Private Member Functions

 QueueManager (std::vector< Queue > &&graphicsQueues, std::vector< Queue > &&computeQueues, std::vector< Queue > &&transferQueues, size_t presentIndex)
 

Private Attributes

std::vector< Queuem_graphicsQueues
 
std::vector< Queuem_computeQueues
 
std::vector< Queuem_transferQueues
 
size_t m_presentIndex
 

Detailed Description

Member Function Documentation

◆ checkSurfaceSupport()

uint32_t vkcv::QueueManager::checkSurfaceSupport ( const vk::PhysicalDevice &  physicalDevice,
vk::SurfaceKHR &  surface 
)
static

checks for surface support in the queues

Parameters
physicalDeviceto get the Queues
surfacethat needs to checked
Returns

Referenced by vkcv::Swapchain::create().

Here is the caller graph for this function:

◆ queueCreateInfosQueueHandles()

void vkcv::QueueManager::queueCreateInfosQueueHandles ( vk::PhysicalDevice &  physicalDevice,
const std::vector< float > &  queuePriorities,
const std::vector< vk::QueueFlagBits > &  queueFlags,
std::vector< vk::DeviceQueueCreateInfo > &  queueCreateInfos,
std::vector< std::pair< int, int >> &  queuePairsGraphics,
std::vector< std::pair< int, int >> &  queuePairsCompute,
std::vector< std::pair< int, int >> &  queuePairsTransfer 
)
static

Given the physicalDevice and the queuePriorities, the queueCreateInfos are computed. First, the requested queues are sorted by priority depending on the availability of queues in the queue families of the given physicalDevice. Then check, if all requested queues are creatable. If so, the queueCreateInfos will be computed. Furthermore, lists of index pairs (queueFamilyIndex, queueIndex) for later referencing of the separate queues will be computed.

Parameters
[in]physicalDeviceThe physical device
[in]queuePrioritiesThe queue priorities used for the computation of queueCreateInfos
[in]queueFlagsThe queue flags requesting the queues
[in,out]queueCreateInfosThe queue create info structures to be created
[in,out]queuePairsGraphicsThe list of index pairs (queueFamilyIndex, queueIndex) of queues of type vk::QueueFlagBits::eGraphics
[in,out]queuePairsComputeThe list of index pairs (queueFamilyIndex, queueIndex) of queues of type vk::QueueFlagBits::eCompute
[in,out]queuePairsTransferThe list of index pairs (queueFamilyIndex, queueIndex) of queues of type vk::QueueFlagBits::eTransfer
Exceptions
std::runtime_errorIf the requested queues from queueFlags are not creatable due to insufficient availability.

The documentation for this class was generated from the following files: