| 1373 | // <- |
| 1374 | |
| 1375 | void RenderSystem::endFrame() |
| 1376 | { |
| 1377 | _INTR_PROFILE_CPU("Render System", "End Frame"); |
| 1378 | |
| 1379 | { |
| 1380 | // Wait for any remaining tasks |
| 1381 | Application::_scheduler.WaitforAll(); |
| 1382 | |
| 1383 | // Insert pre-present barrier and end primary command buffer |
| 1384 | insertPrePresentBarrier(); |
| 1385 | endPrimaryCommandBuffer(); |
| 1386 | } |
| 1387 | |
| 1388 | { |
| 1389 | _INTR_PROFILE_CPU("Render System", "Queue Submit"); |
| 1390 | |
| 1391 | VkPipelineStageFlags pipeStageFlags = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; |
| 1392 | VkSubmitInfo submitInfo = {}; |
| 1393 | { |
| 1394 | submitInfo.pNext = nullptr; |
| 1395 | submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; |
| 1396 | submitInfo.waitSemaphoreCount = 1u; |
| 1397 | submitInfo.pWaitSemaphores = &_vkImageAcquiredSemaphore; |
| 1398 | submitInfo.pWaitDstStageMask = &pipeStageFlags; |
| 1399 | submitInfo.commandBufferCount = 1u; |
| 1400 | submitInfo.pCommandBuffers = &_vkCommandBuffers[_backbufferIndex]; |
| 1401 | submitInfo.signalSemaphoreCount = 0u; |
| 1402 | submitInfo.pSignalSemaphores = nullptr; |
| 1403 | } |
| 1404 | |
| 1405 | VkResult result = vkQueueSubmit(_vkQueue, 1u, &submitInfo, |
| 1406 | _vkDrawFences[_backbufferIndex]); |
| 1407 | _INTR_VK_CHECK_RESULT(result); |
| 1408 | |
| 1409 | _activeBackbufferMask |= 1u << _backbufferIndex; |
| 1410 | } |
| 1411 | |
| 1412 | { |
| 1413 | _INTR_PROFILE_CPU("Render System", "Queue Present"); |
| 1414 | |
| 1415 | VkPresentInfoKHR present = {}; |
| 1416 | { |
| 1417 | present.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; |
| 1418 | present.pNext = nullptr; |
| 1419 | present.swapchainCount = 1u; |
| 1420 | present.pSwapchains = &_vkSwapchain; |
| 1421 | present.pImageIndices = &_backbufferIndex; |
| 1422 | present.pWaitSemaphores = nullptr; |
| 1423 | present.waitSemaphoreCount = 0u; |
| 1424 | present.pResults = nullptr; |
| 1425 | } |
| 1426 | |
| 1427 | VkResult result = vkQueuePresentKHR(_vkQueue, &present); |
| 1428 | _INTR_VK_CHECK_RESULT(result); |
| 1429 | } |
| 1430 | |
| 1431 | GpuMemoryManager::updateMemoryStats(); |
| 1432 | } |
nothing calls this directly
no outgoing calls
no test coverage detected