godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.86k stars 21k forks source link

LineEdit makes fps drop when moving cursor on it if you have a ViewportContainer with a Viewport in the same scene. #50675

Open gianlluca opened 3 years ago

gianlluca commented 3 years ago

Godot version

3.3.2.stable.official

System information

Windows 10, GLES 3, Nvidia MX110

Issue description

When you have a ViewportContainer with a Viewport inside and a LineEdit on same scene just like this:

scenetree

The FPS drops if you keep moving the cursor inside of LineEdit.

Steps to reproduce

Just keep moving the cursor inside LineEdit rect having ViewportContainer with a Viewport inside.

Minimal reproduction project

I made a scene with a Label printing the delta on screen to see it better.

LineEdit.zip

Calinou commented 3 years ago

See also https://github.com/godotengine/godot/issues/39608. This is likely because the mouse cursor keeps changing back and forth every frame (or even several times during the same frame). Can you notice the mouse cursor flickering?

gianlluca commented 3 years ago

Yeah the cursor keeps flickering and changing the shape between Arrow and Ibeam, but this doesn't happen without the Viewports behind.

gianlluca commented 3 years ago

I noticed now that is any Control node setted with the Ibeam or Cross cursor shapes make this happen.

issork commented 2 years ago

Also present in 3.4.beta6 on Linux (so probably also still present in 3.4.beta6 for Windows)

Calinou commented 2 years ago

@MennoMax Can you try to run a profiler on a debug build when this happens? This way, we can see what's taking the most CPU time.

issork commented 2 years ago

I'm very sorry, had the wrong tab open. Meant to report this to #48309 ^^

There's no fps drop for me on Linux, but the issues might be related anyway.

gianlluca commented 2 years ago

Meant to report this to #48309

Now I think this issue here is related or even a duplicate of #48309

There's no fps drop for me on Linux

I haven't tested on Linux but on Windows the FPS drops when I keep moving the cursor inside a LineEdit or any Control Node with the Ibeam or Cross shapes setted

This is likely because the mouse cursor keeps changing back and forth every frame

But like Calinou said this is probably the cause of my FPS drop, my workaround was to change the cursor shape from the LineEdit to another instead of the Ibeam or Cross, which are the only ones that make the cursor flicker.