MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Present

Method Present

Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp:448–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448GPUSwapChainVulkan::Status GPUSwapChainVulkan::Present(QueueVulkan* presentQueue, SemaphoreVulkan* backBufferRenderingDoneSemaphore)
449{
450 if (_currentImageIndex == -1)
451 return Status::Ok;
452 PROFILE_CPU_NAMED("vkQueuePresentKHR");
453
454 VkPresentInfoKHR presentInfo;
455 RenderToolsVulkan::ZeroStruct(presentInfo, VK_STRUCTURE_TYPE_PRESENT_INFO_KHR);
456 VkSemaphore semaphore;
457 if (backBufferRenderingDoneSemaphore)
458 {
459 presentInfo.waitSemaphoreCount = 1;
460 semaphore = backBufferRenderingDoneSemaphore->GetHandle();
461 presentInfo.pWaitSemaphores = &semaphore;
462 }
463 presentInfo.swapchainCount = 1;
464 presentInfo.pSwapchains = &_swapChain;
465 presentInfo.pImageIndices = (uint32*)&_currentImageIndex;
466
467 const VkResult presentResult = vkQueuePresentKHR(presentQueue->GetHandle(), &presentInfo);
468 if (presentResult == VK_ERROR_OUT_OF_DATE_KHR)
469 {
470 return Status::Outdated;
471 }
472 if (presentResult == VK_ERROR_SURFACE_LOST_KHR)
473 {
474 return Status::LostSurface;
475 }
476#if GPU_ENABLE_ASSERTION
477 if (presentResult != VK_SUCCESS && presentResult != VK_SUBOPTIMAL_KHR)
478 {
479 VALIDATE_VULKAN_RESULT(presentResult);
480 }
481#endif
482
483 return Status::Ok;
484}
485
486int32 GPUSwapChainVulkan::DoAcquireImageIndex(GPUSwapChainVulkan* viewport, void* customData)
487{

Callers 1

DoPresentMethod · 0.45

Calls 9

AddImageBarrierMethod · 0.80
FlushBarriersMethod · 0.80
GetActiveCmdBufferMethod · 0.80
GetCmdBufferManagerMethod · 0.80
SubmitActiveCmdBufferMethod · 0.80
GetHandleMethod · 0.45
FlushMethod · 0.45
GetMainContextMethod · 0.45
WaitForGPUMethod · 0.45

Tested by

no test coverage detected