Set up the command buffers we use for drawing each frame
| 2223 | |
| 2224 | // Set up the command buffers we use for drawing each frame |
| 2225 | void setupCommandBuffers() |
| 2226 | { |
| 2227 | // We need a command buffer for every frame in flight |
| 2228 | commandBuffers.resize(swapchainFramebuffers.size()); |
| 2229 | |
| 2230 | // These are primary command buffers |
| 2231 | VkCommandBufferAllocateInfo commandBufferAllocateInfo = VkCommandBufferAllocateInfo(); |
| 2232 | commandBufferAllocateInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; |
| 2233 | commandBufferAllocateInfo.commandPool = commandPool; |
| 2234 | commandBufferAllocateInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; |
| 2235 | commandBufferAllocateInfo.commandBufferCount = static_cast<std::uint32_t>(commandBuffers.size()); |
| 2236 | |
| 2237 | // Allocate the command buffers from our command pool |
| 2238 | if (vkAllocateCommandBuffers(device, &commandBufferAllocateInfo, commandBuffers.data()) != VK_SUCCESS) |
| 2239 | { |
| 2240 | commandBuffers.clear(); |
| 2241 | vulkanAvailable = false; |
| 2242 | return; |
| 2243 | } |
| 2244 | } |
| 2245 | |
| 2246 | // Set up the commands we need to issue to draw a frame |
| 2247 | void setupDraw() |
nothing calls this directly
no test coverage detected