Merge pull request #80124 from Calinou/3d-editor-frame-time-initialize-fps

Initialize View Frame Time estimates to match 120 FPS
This commit is contained in:
Rémi Verschelde 2023-08-29 12:42:16 +02:00
commit 1ffc24e19e
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2887,8 +2887,9 @@ void Node3DEditorViewport::_notification(int p_what) {
fps_label->set_visible(show_fps);
RS::get_singleton()->viewport_set_measure_render_time(viewport->get_viewport_rid(), show_fps);
for (int i = 0; i < FRAME_TIME_HISTORY; i++) {
cpu_time_history[i] = 0;
gpu_time_history[i] = 0;
// Initialize to 120 FPS, so that the initial estimation until we get enough data is always reasonable.
cpu_time_history[i] = 8.333333;
gpu_time_history[i] = 8.333333;
}
cpu_time_history_index = 0;
gpu_time_history_index = 0;