You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to enable time measurements first by calling RenderingServer.viewport_set_measure_render_time(get_tree().root.get_viewport_rid(), true) in _ready(). See https://github.com/godotengine/godot-benchmarks for a working example.
We should probably add a project setting to do this this automatically when you need to use time measurements.
You can then get CPU time spent on rendering the last frame using RenderingServer.viewport_get_measured_render_time_cpu(get_tree().root.get_viewport_rid()) + RenderingServer.get_frame_setup_time_cpu(), and GPU time using RenderingServer.viewport_get_measured_render_time_gpu(get_tree().root.get_viewport_rid()). Both of these calls should be performed in _process() to reflect the last frame's rendering as closely as possible.
Godot version
4.0.1-stable
System information
Kubuntu, Forward+/Mobile, GTX 1050
Issue description
I tried to use the code to measure cpu/gpu time, but these method always return 0.
Steps to reproduce
Download the MRP and run.
Minimal reproduction project
tmp.zip
The text was updated successfully, but these errors were encountered: