Set up the fences we use to synchronize frames among each other
| 2361 | |
| 2362 | // Set up the fences we use to synchronize frames among each other |
| 2363 | void setupFences() |
| 2364 | { |
| 2365 | // Create the fences in the signaled state |
| 2366 | VkFenceCreateInfo fenceCreateInfo = VkFenceCreateInfo(); |
| 2367 | fenceCreateInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; |
| 2368 | fenceCreateInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT; |
| 2369 | |
| 2370 | // Create a fence to track when queue submission is complete for each frame in flight |
| 2371 | for (std::size_t i = 0; i < maxFramesInFlight; ++i) |
| 2372 | { |
| 2373 | fences.push_back({}); |
| 2374 | |
| 2375 | if (vkCreateFence(device, &fenceCreateInfo, nullptr, &fences[i]) != VK_SUCCESS) |
| 2376 | { |
| 2377 | fences.pop_back(); |
| 2378 | vulkanAvailable = false; |
| 2379 | return; |
| 2380 | } |
| 2381 | } |
| 2382 | } |
| 2383 | |
| 2384 | // Update the matrices in our uniform buffer every frame |
| 2385 | void updateUniformBuffer(float elapsed) |
nothing calls this directly
no test coverage detected