| 564 | |
| 565 | template <vkb::BindingType bindingType> |
| 566 | inline void Device<bindingType>::flush_command_buffer_impl( |
| 567 | vk::Device device, vk::CommandBuffer command_buffer, vk::Queue queue, bool free, vk::Semaphore signal_semaphore) const |
| 568 | { |
| 569 | if (command_buffer) |
| 570 | { |
| 571 | command_buffer.end(); |
| 572 | |
| 573 | vk::SubmitInfo submit_info{.commandBufferCount = 1, .pCommandBuffers = &command_buffer}; |
| 574 | if (signal_semaphore) |
| 575 | { |
| 576 | submit_info.setSignalSemaphores(signal_semaphore); |
| 577 | } |
| 578 | |
| 579 | // Create fence to ensure that the command buffer has finished executing |
| 580 | vk::Fence fence = device.createFence({}); |
| 581 | |
| 582 | // Submit to the queue |
| 583 | queue.submit(submit_info, fence); |
| 584 | |
| 585 | // Wait for the fence to signal that command buffer has finished executing |
| 586 | vk::Result result = device.waitForFences(fence, true, DEFAULT_FENCE_TIMEOUT); |
| 587 | if (result != vk::Result::eSuccess) |
| 588 | { |
| 589 | LOGE("Detected Vulkan error: {}", vkb::to_string(result)); |
| 590 | abort(); |
| 591 | } |
| 592 | |
| 593 | device.destroyFence(fence); |
| 594 | |
| 595 | if (command_pool && free) |
| 596 | { |
| 597 | device.freeCommandBuffers(command_pool->get_handle(), command_buffer); |
| 598 | } |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | template <vkb::BindingType bindingType> |
| 603 | vkb::core::HPPQueue const &Device<bindingType>::get_queue_by_flags_impl(vk::QueueFlags required_queue_flags, uint32_t queue_index) const |
nothing calls this directly
no test coverage detected