MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / SetPresentImageLayout

Method SetPresentImageLayout

tests/framework/render.cpp:1023–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021}
1022
1023void VkRenderFramework::SetPresentImageLayout(VkImage image) {
1024 VkImageMemoryBarrier layout_transition = vku::InitStructHelper();
1025 layout_transition.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
1026 layout_transition.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
1027 layout_transition.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
1028 layout_transition.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
1029 layout_transition.image = image;
1030 layout_transition.subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1};
1031
1032 vkt::CommandBuffer cmdbuf(*m_device, m_command_pool);
1033 cmdbuf.Begin();
1034 vk::CmdPipelineBarrier(cmdbuf, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0,
1035 nullptr, 1, &layout_transition);
1036 cmdbuf.End();
1037 m_default_queue->SubmitAndWait(cmdbuf);
1038}
1039
1040void VkRenderFramework::InitRenderTarget() { InitRenderTarget(1); }
1041

Callers

nothing calls this directly

Calls 4

CmdPipelineBarrierFunction · 0.85
SubmitAndWaitMethod · 0.80
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected