Skip to content

Commit

Permalink
Assert in SwapchainBuilder on queue getting failure
Browse files Browse the repository at this point in the history
This resolves the TODO about what to do if the queues couldn't be found.
  • Loading branch information
charles-lunarg committed May 21, 2021
1 parent 84ba7a7 commit 70265d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VkBootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 70265d8

Please sign in to comment.