Report the actual GPU framerate rather than the main thread submit rate when using the filament renderer.
PiperOrigin-RevId: 838775463 Change-Id: If66644d284a4a9e0263cf31bfbd1785b18e0209b
This commit is contained in:
committed by
Copybara-Service
parent
4896e698f6
commit
448fc0e4d5
@@ -57,17 +57,6 @@ void Renderer::Render(const mjModel* model, mjData* data,
|
||||
|
||||
mjrRect main_viewport = {0, 0, width, height};
|
||||
mjr_render(main_viewport, data ? &scene_ : nullptr, &render_context_);
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
auto delta_time = now - last_fps_update_;
|
||||
const double interval = std::chrono::duration<double>(delta_time).count();
|
||||
|
||||
++frames_;
|
||||
if (interval > 0.2) { // only update FPS stat at most 5 times per second
|
||||
last_fps_update_ = now;
|
||||
fps_ = frames_ / interval;
|
||||
frames_ = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Renderer::SaveScreenshot(const std::string& filename, int width,
|
||||
|
||||
Reference in New Issue
Block a user