@@ -25,6 +25,9 @@ using namespace video;
25
25
26
26
#include " nbl/video/surface/CSurfaceVulkan.h"
27
27
#include " nbl/ext/FullScreenTriangle/FullScreenTriangle.h"
28
+ #include < chrono>
29
+
30
+ #define BENCHMARK_TILL_FIRST_FRAME
28
31
29
32
static constexpr bool DebugMode = false ;
30
33
static constexpr bool DebugRotatingViewProj = false ;
@@ -836,6 +839,16 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
836
839
addObjects (intendedNextSubmit);
837
840
838
841
endFrameRender (intendedNextSubmit);
842
+
843
+ #ifdef BENCHMARK_TILL_FIRST_FRAME
844
+ if (!stopBenchamrkFlag)
845
+ {
846
+ const std::chrono::steady_clock::time_point stopBenchmark = std::chrono::high_resolution_clock::now ();
847
+ auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stopBenchmark - startBenchmark);
848
+ std::cout << " Time taken till first render pass: " << duration.count () << " milliseconds" << std::endl;
849
+ stopBenchamrkFlag = true ;
850
+ }
851
+ #endif
839
852
}
840
853
841
854
bool beginFrameRender ()
@@ -2555,6 +2568,11 @@ class ComputerAidedDesign final : public examples::SimpleWindowedApplication, pu
2555
2568
smart_refctd_ptr<IWindow> m_window;
2556
2569
smart_refctd_ptr<CSimpleResizeSurface<CSwapchainResources>> m_surface;
2557
2570
smart_refctd_ptr<IGPUImageView> pseudoStencilImageView;
2571
+
2572
+ #ifdef BENCHMARK_TILL_FIRST_FRAME
2573
+ const std::chrono::steady_clock::time_point startBenchmark = std::chrono::high_resolution_clock::now();
2574
+ bool stopBenchamrkFlag = false ;
2575
+ #endif
2558
2576
};
2559
2577
2560
2578
NBL_MAIN_FUNC (ComputerAidedDesign)
0 commit comments