15 device._device = VK_NULL_HANDLE;
16 device._physicalDeviceInfo =
nullptr;
24 device._device = VK_NULL_HANDLE;
25 device._physicalDeviceInfo =
nullptr;
38 if ((queueFamily.getFlags() & flags) == flags && (!supportPresentation || queueFamily.supportsPresentation())) {
39 if (returnQueue ==
nullptr || queueFamily.
getFlags() == flags || (supportPresentation && flags == 0 && queueFamily.getFlags() & VK_QUEUE_GRAPHICS_BIT)) {
40 returnQueue = &queueFamily;
45 if (!returnQueue && flags & VK_QUEUE_TRANSFER_BIT) {
46 return getQueueFamily((flags & ~VK_QUEUE_TRANSFER_BIT) | VK_QUEUE_GRAPHICS_BIT, supportPresentation);
56 if ((queueFamily.getFlags() & flags) == flags && (!supportPresentation || queueFamily.supportsPresentation())) {
57 if (returnQueue ==
nullptr || queueFamily.
getFlags() == flags || (supportPresentation && flags == 0 && queueFamily.getFlags() & VK_QUEUE_GRAPHICS_BIT)) {
58 returnQueue = &queueFamily;
63 if (!returnQueue && flags & VK_QUEUE_TRANSFER_BIT) {
64 return getQueueFamily((flags & ~VK_QUEUE_TRANSFER_BIT) | VK_QUEUE_GRAPHICS_BIT, supportPresentation);
72 const API::Queue* queue = queueFamily.getQueue(queueName);
83 VkResult result = vkDeviceWaitIdle(
_device);
85 if (result != VK_SUCCESS) {
86 LUG_LOG.error(
"Device::waitIdle: Can't wait for queue work: {}", result);
96 if (
_device != VK_NULL_HANDLE) {
98 vkDestroyDevice(
_device,
nullptr);
const API::QueueFamily * getQueueFamily(VkQueueFlags flags, bool supportPresentation=false) const
VkQueueFlags getFlags() const
const API::Queue * getQueue(const std::string &queueName) const
const PhysicalDeviceInfo * _physicalDeviceInfo
std::vector< QueueFamily > _queueFamilies
Device & operator=(const Device &)=delete