vulkan/main.cpp
//-----------------------------------------------------------------------------
// [SECTION] general per-frame function implementations
//-----------------------------------------------------------------------------
[SECTION] general per-frame function implementations
[ SECTION ] general per - frame function implementations
static void
begin_frame()
{
    S_VULKAN(vkWaitForFences(g_logicalDevice, 1, &g_inFlightFences[g_currentFrame], VK_TRUE, UINT64_MAX));
    S_VULKAN(vkAcquireNextImageKHR(g_logicalDevice, g_swapChain, UINT64_MAX, g_imageAvailableSemaphores[g_currentFrame],VK_NULL_HANDLE, &g_currentImageIndex));
    if (g_imagesInFlight[g_currentImageIndex] != VK_NULL_HANDLE)
        S_VULKAN(vkWaitForFences(g_logicalDevice, 1, &g_imagesInFlight[g_currentImageIndex], VK_TRUE, UINT64_MAX));
    g_imagesInFlight[g_currentImageIndex] = g_inFlightFences[g_currentFrame];
}
static void begin_frame ( ) { S_VULKAN ( vkWaitForFences ( g_logicalDevice , 1 , & g_inFlightFences [ g_currentFrame ] , VK_TRUE , UINT64_MAX ) ) ; S_VULKAN ( vkAcquireNextImageKHR ( g_logicalDevice , g_swapChain , UINT64_MAX , g_imageAvailableSemaphores [ g_currentFrame ] , VK_NULL_HANDLE , & g_currentImageIndex ) ) ; if ( g_imagesInFlight [ g_currentImageIndex ] != VK_NULL_HANDLE ) S_VULKAN ( vkWaitForFences ( g_logicalDevice , 1 , & g_imagesInFlight [ g_currentImageIndex ] , VK_TRUE , UINT64_MAX ) ) ; g_imagesInFlight [ g_currentImageIndex ] = g_inFlightFences [ g_currentFrame ] ; }
[SECTION] general per-frame function implementations
[ SECTION ] general per - frame function implementations
// just in case the acquired image is out of order