| 675 | #endif |
| 676 | |
| 677 | void Demo::build_image_ownership_cmd(const SubmissionResources &submission_resource, |
| 678 | const SwapchainImageResources &swapchain_image_resource) { |
| 679 | auto result = submission_resource.graphics_to_present_cmd.reset(); |
| 680 | VERIFY(result == vk::Result::eSuccess); |
| 681 | |
| 682 | result = submission_resource.graphics_to_present_cmd.begin( |
| 683 | vk::CommandBufferBeginInfo().setFlags(vk::CommandBufferUsageFlagBits::eSimultaneousUse)); |
| 684 | VERIFY(result == vk::Result::eSuccess); |
| 685 | |
| 686 | auto const image_ownership_barrier = |
| 687 | vk::ImageMemoryBarrier() |
| 688 | .setSrcAccessMask(vk::AccessFlags()) |
| 689 | .setDstAccessMask(vk::AccessFlags()) |
| 690 | .setOldLayout(vk::ImageLayout::ePresentSrcKHR) |
| 691 | .setNewLayout(vk::ImageLayout::ePresentSrcKHR) |
| 692 | .setSrcQueueFamilyIndex(graphics_queue_family_index) |
| 693 | .setDstQueueFamilyIndex(present_queue_family_index) |
| 694 | .setImage(swapchain_image_resource.image) |
| 695 | .setSubresourceRange(vk::ImageSubresourceRange(vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1)); |
| 696 | |
| 697 | submission_resource.graphics_to_present_cmd.pipelineBarrier(vk::PipelineStageFlagBits::eBottomOfPipe, |
| 698 | vk::PipelineStageFlagBits::eBottomOfPipe, vk::DependencyFlagBits(), |
| 699 | {}, {}, image_ownership_barrier); |
| 700 | |
| 701 | result = submission_resource.graphics_to_present_cmd.end(); |
| 702 | VERIFY(result == vk::Result::eSuccess); |
| 703 | } |
| 704 | |
| 705 | vk::Bool32 Demo::check_layers(const std::vector<const char *> &check_names, const std::vector<vk::LayerProperties> &layers) { |
| 706 | for (const auto &name : check_names) { |
nothing calls this directly
no outgoing calls
no test coverage detected