MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / SetupPresentInfo

Method SetupPresentInfo

layers/sync/sync_validation.cpp:2351–2368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2349}
2350
2351uint32_t SyncValidator::SetupPresentInfo(const VkPresentInfoKHR& present_info, BatchContextPtr& batch,
2352 PresentedImages& presented_images) {
2353 const VkSwapchainKHR* swapchains = present_info.pSwapchains;
2354 const uint32_t* image_indices = present_info.pImageIndices;
2355 const uint32_t swapchain_count = present_info.swapchainCount;
2356
2357 presented_images.reserve(swapchain_count);
2358 for (uint32_t present_index = 0; present_index < swapchain_count; present_index++) {
2359 // Note: Given the "EraseIf" implementation for acquire fence waits, each presentation needs a unique tag.
2360 const ResourceUsageTag tag = presented_images.size();
2361 presented_images.emplace_back(*this, batch, swapchains[present_index], image_indices[present_index], present_index, tag);
2362 if (presented_images.back().Invalid()) {
2363 presented_images.pop_back();
2364 }
2365 }
2366 // Present is tagged for each swapchain.
2367 return static_cast<uint32_t>(presented_images.size());
2368}
2369
2370void SyncValidator::PostCallRecordAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
2371 VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex,

Callers

nothing calls this directly

Calls 6

emplace_backMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
InvalidMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected