From 16e6429c269c2aec19ea5a566dc421110bdb4f73 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Fri, 23 Apr 2021 15:41:10 -0600 Subject: [PATCH] Assert in SwapchainBuilder on queue getting failure This resolves the TODO about what to do if the queues couldn't be found. --- src/VkBootstrap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index bbd87f3..16e3c54 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -1607,7 +1607,7 @@ SwapchainBuilder::SwapchainBuilder(Device const& device) { info.surface = device.surface; auto present = device.get_queue_index(QueueType::present); auto graphics = device.get_queue_index(QueueType::graphics); - // TODO: handle error of queue's not available + assert(graphics.has_value() && present.has_value() && "Graphics and Present queue indexes must be valid"); info.graphics_queue_index = present.value(); info.present_queue_index = graphics.value(); info.allocation_callbacks = device.allocation_callbacks; @@ -1620,7 +1620,7 @@ SwapchainBuilder::SwapchainBuilder(Device const& device, VkSurfaceKHR const surf temp_device.surface = surface; auto present = temp_device.get_queue_index(QueueType::present); auto graphics = temp_device.get_queue_index(QueueType::graphics); - // TODO: handle error of queue's not available + assert(graphics.has_value() && present.has_value() && "Graphics and Present queue indexes must be valid"); info.graphics_queue_index = present.value(); info.present_queue_index = graphics.value(); info.allocation_callbacks = device.allocation_callbacks;