Why glBlitFramebuffer in RasterizerGLES3::blit_render_target_to_screen spend 16.66 ms

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rabienrose

I am wondering which code contribute to the basic delay between frames. The delay between each iteration (Main::iteration()) is fixed at 16.66 ms. Then I tracked down the code, and find that it is the glBlitFramebuffer spend the 16.66 ms.
And I also found the more time that _physics_process took, the less time glBlitFramebuffer spend.
Does anyone know what’s going on here?

This may be caused by the engine waiting for vertical sync. This time is not wasted, it’s used to save GPU resources (and therefore power/heat/noise).

Can you reproduce this after disabling V-Sync in the Project Settings and ensuring it is not forced on the target platform (like Android and iOS would do)?

Calinou | 2022-01-20 21:39