godot-extended-libraries / godot-debug-menu

Display in-game FPS/performance/hardware metrics in a Godot 4.x project
https://github.com/godot-extended-libraries/godot-debug-menu-demo
MIT License
428 stars 16 forks source link

Godot (4.3 beta 1): multi-threaded rendering; debug menu (1.2) reports different fps than godots inbuilt monitor. #26

Open LeeWannacott opened 3 months ago

LeeWannacott commented 3 months ago

Hey Calinou,

I'm testing out the multi-threading rendering in Godot 4.3 beta 1. (I know its not considered ready to be a default yet)

debug menu shows around double the fps of Godots built-in monitor. With v-sync on multi-thread I get 165fps (165hz monitor) in Godot's monitor and (debug menu reports) 320-350 with multi-threaded. Without v-sync Godot reports ~500-700fps and debug-menu reports 1200-2000fps with multi.

image

Steps to reproduce: Rendering -> Driver -> Threads -> select multi-threading.

Is this an issue with godot-debug-menu?, or with how Godot monitors fps? (or issues with both).

What I would expect: v-sync on should match the monitors refresh rate when on. When v-sync is off, I would assume multi-rendering is giving the performance boost of double the fps (I'm guessing/hoping debug menu is correcter than godot in this instance?, but wrong when v-sync is on)?

Note: I haven't opened any issue in Godot for this.

Specs: image

LeeWannacott commented 3 months ago

I also notice the game crashes (with no error) if you look at the editors Video RAM tab with multi-threaded on. (I assume they are already aware of this :thinking: )

Calinou commented 3 months ago

This is likely because when using multi-threaded rendering, _process() time can no longer be assumed to match frame rendering time. I'd need a way to query the exact time a frame took to render to be able to give out accurate results when multi-threaded rendering is enabled.