MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / createCommandBuffers

Method createCommandBuffers

code/25_sampler.cpp:1080–1092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078 }
1079
1080 void createCommandBuffers() {
1081 commandBuffers.resize(MAX_FRAMES_IN_FLIGHT);
1082
1083 VkCommandBufferAllocateInfo allocInfo{};
1084 allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
1085 allocInfo.commandPool = commandPool;
1086 allocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
1087 allocInfo.commandBufferCount = (uint32_t) commandBuffers.size();
1088
1089 if (vkAllocateCommandBuffers(device, &allocInfo, commandBuffers.data()) != VK_SUCCESS) {
1090 throw std::runtime_error("failed to allocate command buffers!");
1091 }
1092 }
1093
1094 void recordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) {
1095 VkCommandBufferBeginInfo beginInfo{};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected