Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDScript 2.0: Profiling does not seems to be working #44252

Closed
KaruroChori opened this issue Dec 10, 2020 · 11 comments · Fixed by #65490
Closed

GDScript 2.0: Profiling does not seems to be working #44252

KaruroChori opened this issue Dec 10, 2020 · 11 comments · Fixed by #65490

Comments

@KaruroChori
Copy link

Godot version:
Godot 4.0 bc30df8

OS/device including version:

Linux 80x86 64bit, GTX 1660 super and RTX 2060 (main one). Drivers 450.80

Issue description:
I am working in single window mode.
When I try to profile my scene the number of objects is extremely high even with an empty one (I guess this is justr the rest of the editor showing up) an draw calls are set to zero no matter how many objects with different materials I add.

Steps to reproduce:
Open any project. Run the scene and open the profiler. Add some meshes and material. Run the scene and open the profiler. Compare the results.

Minimal reproduction project:
No need for a specific project.

@KaruroChori KaruroChori changed the title Profiling does not seems to work Profiling does not seems to be working Dec 10, 2020
@Calinou Calinou added this to the 4.0 milestone Dec 10, 2020
@Calinou
Copy link
Member

Calinou commented Nov 8, 2021

@KaruroChori Can you (or anyone else) still reproduce this bug in the latest master branch? You can download a nightly build here.

Also, are you referring to the GDScript profiler or the visual profiler (new in 4.0)?

@KaruroChori
Copy link
Author

Hi, it would be hard for me to test this. In the last few months I changed graphic cards as well as drivers, so I would not be able to reproduce the exact circumstances.
Your link is not working, could you provide an updated one?
If I recall correctly it should be the one shown here: https://docs.godotengine.org/en/latest/tutorials/scripting/debug/the_profiler.html

@Calinou
Copy link
Member

Calinou commented Nov 13, 2021

@KaruroChori I fixed the link in my comment, it should work now.

@KaruroChori
Copy link
Author

KaruroChori commented Nov 14, 2021

Well, I guess it is worse than last time, now I cannot even run it :(.
#54962

@Calinou Calinou changed the title Profiling does not seems to be working GDScript 2.0: Profiling does not seems to be working Jan 27, 2022
@Zireael07
Copy link
Contributor

Note: as of alpha 1, graphics profiling seems to be working, script profiling is NOT.

@tavurth
Copy link
Contributor

tavurth commented Mar 15, 2022

Damn, this was the dealbreaker for me about moving to Godot 4 already.

Is there any timeline for when this will be implemented?

@Calinou
Copy link
Member

Calinou commented Mar 15, 2022

Damn, this was the dealbreaker for me about moving to Godot 4 already.

Is there any timeline for when this will be implemented?

We don't know why it's broken in the first place, so there is no ETA for fixing this.

@tavurth
Copy link
Contributor

tavurth commented Mar 26, 2022

Screenshot 2022-03-26 at 04 07 13

Actually seems to be working if you open the debug panel before the game starts.

Seems this issue is mostly that the start button is getting greyed out incorrectly, as you can see here I also cannot stop the debugger.

@Zireael07
Copy link
Contributor

@tavurth What alpha version/master hash is that?

@tavurth
Copy link
Contributor

tavurth commented Mar 26, 2022

@Zireael07 That's on Alpha 4

@tavurth
Copy link
Contributor

tavurth commented Mar 28, 2022

After digging some more, it appears that when entering the pause state, the proflier buttons Start and Stop become greyed out, and do not properly reset their state when the game is restarted or resumed.

So entry here:

void EditorProfiler::set_enabled(bool p_enable) {
activate->set_disabled(!p_enable);
}

And issue may lie here:

void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_data) {
emit_signal(SNAME("debug_data"), p_msg, p_data);
if (p_msg == "debug_enter") {
_put_msg("get_stack_dump", Array());
ERR_FAIL_COND(p_data.size() != 3);
bool can_continue = p_data[0];
String error = p_data[1];
bool has_stackdump = p_data[2];
breaked = true;
can_debug = can_continue;
_update_buttons_state();
_set_reason_text(error, MESSAGE_ERROR);
emit_signal(SNAME("breaked"), true, can_continue, error, has_stackdump);
if (is_move_to_foreground()) {
DisplayServer::get_singleton()->window_move_to_foreground();
}
if (!error.is_empty()) {
tabs->set_current_tab(0);
}
profiler->set_enabled(false);
inspector->clear_cache(); // Take a chance to force remote objects update.
} else if (p_msg == "debug_exit") {
breaked = false;
can_debug = false;
_clear_execution();
_update_buttons_state();
_set_reason_text(TTR("Execution resumed."), MESSAGE_SUCCESS);
emit_signal(SNAME("breaked"), false, false, "", false);
profiler->set_enabled(true);
profiler->disable_seeking();

More specifically this bug occurs when:

  1. The game is paused with the pause button (or clicking inside profiler)
  2. The game is then restarted
  • Pausing and unpausing the game does not cause this issue.
  • Clicking inside the profiler (pausing) and then resuming the game does not cause this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment