Godot version:
3.0.2
OS/device including version:
X11/linux
Issue description:
While drawing some complex scenes and using the profiler to measure hiccups I noticed idle time spikes which seemed weird. After looking at the code the idle time seems to include the visual server draw time and audio server processing time. This seems incorrect.
The relevant code: this line in main.cpp
Steps to reproduce:
Create a relatively complex shader and add the object at runtime. The game will hiccup as the shader is compiled and the profiler will show an idle time spike.
Idle time in general is a very opaque thing in Godot's profiler: we don't even know how much of the time rendering takes, and this is something that would be very helpful.
Also the spike is the shader compilation, as mentioned in #18265.
Yeah, looking at the code some more idle seems to include almost everything except physics time.
It would be better if this idle time could be split into process, graphics and audio time or something.
Even better would be a fully featured profiler which would allow scripts to define their own timed sections of code which would then automatically be added as a child of the process time or physics_process time
I'm not sure the 'timed sections of code' part is doable, but splitting into process, rendering, audio would be very welcome!
I believe this is a duplicate of #18265.
I don't think so, this is about idle time being not clearly defined and containing rendering and processing time.
Idle is usually time spent doing nothing, while in godot idle seems to refer to everything except physics processing.
That shader compilation causes a hiccup is completely separate.
Can anyone still reproduce this bug in Godot 3.2.1 or any later release (e.g. 3.2.2-rc3)?
If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.
Godot 4.0 introduces a much better profiler setup that makes the difference between CPU and GPU profiling clearer. The new profiler is enough to close this bug report.
That being said. This isnt a bug. Idle time is time the CPU spends idle. The reason audio and graphics contribute somkuch to this is that the CPU ends up waiting for data to be transferred from the audio card or the GPU. If the GPU is maxed out while processing a function that the CPU is relying on, the CPU will remain idle until the GPU is finished.
_edit:_ for more info see the discussion on the PR that was made to solve this issue. https://github.com/godotengine/godot/pull/19593#issuecomment-398041766
Most helpful comment
Godot 4.0 introduces a much better profiler setup that makes the difference between CPU and GPU profiling clearer. The new profiler is enough to close this bug report.
That being said. This isnt a bug. Idle time is time the CPU spends idle. The reason audio and graphics contribute somkuch to this is that the CPU ends up waiting for data to be transferred from the audio card or the GPU. If the GPU is maxed out while processing a function that the CPU is relying on, the CPU will remain idle until the GPU is finished.
_edit:_ for more info see the discussion on the PR that was made to solve this issue. https://github.com/godotengine/godot/pull/19593#issuecomment-398041766