MCPcopy Create free account
hub / github.com/RenderKit/embree / renderBenchFunc

Function renderBenchFunc

tutorials/common/tutorial/benchmark_render.h:26–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25template<class Tutorial>
26static void renderBenchFunc(BenchState& state, BenchParams& params ,int argc, char** argv)
27{
28#ifdef USE_GOOGLE_BENCHMARK
29 if (params.legacy) {
30 renderBenchmarkLegacy<Tutorial>(state, params, argc, argv);
31 return;
32 }
33
34 Tutorial tutorial;
35 tutorial.interactive = false;
36 tutorial.main(argc,argv);
37
38 tutorial.resize(tutorial.width, tutorial.height);
39 ISPCCamera ispccamera = tutorial.camera.getISPCCamera(tutorial.width, tutorial.height);
40
41 for (size_t i = 0; i < params.skipIterations; i++)
42 {
43 tutorial.initRayStats();
44 tutorial.render(tutorial.pixels,tutorial.width,tutorial.height,0.0f,ispccamera);
45 }
46
47 size_t numRays = 0;
48 for (auto _ : *state.state)
49 {
50 tutorial.initRayStats();
51 tutorial.render(tutorial.pixels,tutorial.width,tutorial.height,0.0f,ispccamera);
52 numRays += tutorial.getNumRays();
53 }
54
55 state.state->SetItemsProcessed(state.state->iterations());
56 state.state->counters["Rays/s"] = benchmark::Counter(numRays, benchmark::Counter::kIsRate);
57#else
58 renderBenchmarkLegacy<Tutorial>(state, params, argc, argv);
59#endif
60}
61
62template<class Tutorial>
63static void renderBenchmarkLegacy(BenchState& state, BenchParams& params ,int argc, char** argv)

Callers

nothing calls this directly

Calls 6

getISPCCameraMethod · 0.80
initRayStatsMethod · 0.80
renderMethod · 0.80
getNumRaysMethod · 0.80
mainMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected