| 1041 | } |
| 1042 | |
| 1043 | void 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 | |
| 1063 | void Demo::flush_init_cmd() { |
| 1064 | auto result = cmd.end(); |
nothing calls this directly
no outgoing calls
no test coverage detected