MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Tools / prepare_init_cmd

Method prepare_init_cmd

cube/cube.cpp:1043–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041}
1042
1043void Demo::prepare_init_cmd() {
1044 vk::CommandPoolCreateFlags cmd_pool_create_flags =
1045 protected_output ? vk::CommandPoolCreateFlagBits::eProtected : vk::CommandPoolCreateFlags{};
1046 cmd_pool_create_flags |= vk::CommandPoolCreateFlagBits::eResetCommandBuffer;
1047 auto cmd_pool_return = device.createCommandPool(
1048 vk::CommandPoolCreateInfo().setQueueFamilyIndex(graphics_queue_family_index).setFlags(cmd_pool_create_flags));
1049 VERIFY(cmd_pool_return.result == vk::Result::eSuccess);
1050 cmd_pool = cmd_pool_return.value;
1051
1052 auto cmd_return = device.allocateCommandBuffers(vk::CommandBufferAllocateInfo()
1053 .setCommandPool(cmd_pool)
1054 .setLevel(vk::CommandBufferLevel::ePrimary)
1055 .setCommandBufferCount(1));
1056 VERIFY(cmd_return.result == vk::Result::eSuccess);
1057 cmd = cmd_return.value[0];
1058
1059 auto result = cmd.begin(vk::CommandBufferBeginInfo());
1060 VERIFY(result == vk::Result::eSuccess);
1061}
1062
1063void Demo::flush_init_cmd() {
1064 auto result = cmd.end();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected