Godot: Editor is redrawing constantly after recent commits

Created on 29 Aug 2019  路  24Comments  路  Source: godotengine/godot

Godot version:

Git hash: 208dd5b4a

OS/device including version:

MacBook Air (13-inch, Mid 2012)
MacOS 10.14
Intel HD Graphics 4000

Issue description:

Godot is redrawing constantly regardless what is showing, be it the scene view (even empty), script view etc.. The "spinning-when-redrawing"-icon is constantly spinning and Godot is using a lot of CPU.
Even in the background it's using a lot of CPU: image

This didn't use to be the case on my machine. I'm not sure when this changed, but it worked fine a few weeks ago.

I'm getting the follow shader error every frame, which may be (part of) the issue:

ERROR: _display_error_with_code: SceneShaderGLES2: Vertex shader compilation failed:
ERROR: 0:31: '' : syntax error: #define of reserved name
ERROR: 0:32: '' : syntax error: #define of reserved name

   At: drivers/gles2/shader_gles2.cpp:129.
ERROR: get_current_version: Method/Function Failed, returning: __null
   At: drivers/gles2/shader_gles2.cpp:284.
ERROR: bind: Condition ' !version ' is true. returned: false
   At: drivers/gles2/shader_gles2.cpp:88.

Steps to reproduce:
On my machine, this issue occurs whenever I open a project no matter which project it is. The issue occurs on both OpenGL ES 2 & OpenGL ES 3.

bug regression editor rendering

Most helpful comment

@lawnjelly This might hint at a lower-level issue; surely set_modulate should check for the current value before requesting a redraw?

All 24 comments

Do you know what the most recent commit is where you did not have the issue?

I've noticed the same issue also on a Mac and it started between https://github.com/godotengine/godot/commit/0985d5fa991d14f5393ced5783b69b967a69f4f5 and https://github.com/godotengine/godot/commit/b9fa78bd8c77e5f33b0a21cbd5b193eea07947b9 (I'm using iFire's nightly builds and those are the only 2 builds available between those two commits)

EDIT: I'm not seeing that output in my tests so it may not be related
EDIT2: Seeing the same issue on windows (same commits using iFire's nightly builds) so it doesn't look to be a macOS only issue.

Possible culprit in that time frame for the shader issue: #31556 (cc @Chaosus)

The issue occurs on both OpenGL ES 2 & OpenGL ES 3.

Do you get the shader error on OpenGL ES 3 too, or only the constant redraw?

Hmm.. maybe this function must be within USE_GLES_OVER_GL block

Unfortunately I cannot reproduce it on Windows, but I can create a PR and push inverse to that block - and you can check if the issue will still happens.

Update: Arr I see it now, just enabled that wheel

Hmm.. maybe this function must be within USE_GLES_OVER_GL block

That's weird though, given:
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/inverse.xhtml
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/inverse.xhtml
https://en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions

Apparently inverse was added in GLSL 1.40 (GL 3.1) and GLSL ES 3.00 (GL ES 3.0), so it should be needed for both GL 2.1 and GL ES 2.0.
Maybe some drivers implement it nevertheless as an extension for GL 2.1?

Hm.. the editor still updates constantly even if I push it to that block, so the problem is not here..

@akien-mga Ok, I found the commit which makes the editor constantly redrawing - 1cea44de19215578e1fc54eb3d78d789032eb462

Or not..

image

I can confirm what @Chaosus wrote; that the redrawing issue is NOT present in d3c879fe1bbba83aa7c365441422b0dcb22b82f4 but IS present in 1cea44d. Both SHA's have the vertex shader issue however (which only appears when using OpenGL ES 2).

I don't see why this commit would cause the editor to redraw constantly. Any ideas? :slightly_smiling_face:

Did you do an actual git bisect or try commits manually? The actual chronological order of commits is not necessarily what you see in git log due to merge commits. Git bisect handles that well but a manual approach may pinpoint the wrong commit (as seems to be the case here, as I don't see any logic change in 1cea44d).

Ah, yeah its a different branches, I just found the point where the intersection happens, need to go deeply into this to found the source )

image

Meh, I forgot how to use that _gib bisect_.. last time I used it in past year

git bisect start
git bisect good <a known good commit hash>
git bisect bad <a known bad commit hash>
// then it checks out a new commit, build it and test, and give the result
git bisect good // or bad if the commit has the bug
// and so on until you find the first bad commit

I think, I've finally found the incorrect commit - f524dc5da613b4da66c2a950b51f0d3d52eac66c

image

I've revert this commit and rebase on master - and the constant refreshing has been stopped

image

When I changed editor/plugins/asset_library_editor_plugin.cpp

void EditorAssetLibrary::_notification(int p_what) line 600 from:

            if (loading) {
                library_scroll->set_modulate(Color(1, 1, 1, 0.5));
            } else {
                library_scroll->set_modulate(Color(1, 1, 1, 1));
            }

to

            if (loading) {
                Color col = Color(1, 1, 1, 0.5);
                if (library_scroll->get_modulate() != col)
                    library_scroll->set_modulate(col);
            } else {
                Color col = Color(1, 1, 1, 1);
                if (library_scroll->get_modulate() != col)
                    library_scroll->set_modulate(col);
            }

It cured the constant refreshing. I'd leave for @Calinou to fix though there might be a better way.

@lawnjelly This might hint at a lower-level issue; surely set_modulate should check for the current value before requesting a redraw?

Godot is back to only spinning my fans when compiling, not running! 馃槃

Thanks a lot to everybody involved in fixing the bug 馃憤

Godot 3.2 as prebuilt binary in "Downloads" section on homepage still has this issue. Is someone capable of rebuilding them?

@dreamsComeTrue Godot 3.2 binaries aren't available yet, only 3.1.1 binaries are :slightly_smiling_face:

The regression above was introduced after 3.1.1's release (and is now fixed in the master branch), so it shouldn't affect it.

@Calinou - they are :)
https://downloads.tuxfamily.org/godotengine/3.2/

of course it's dev build - but still - users can grab them. Please, check it out.

@dreamsComeTrue That's a developer build that isn't meant to be used in production. It was never advertised to users; I also don't have control over them.

Since we don't have official daily builds, if you want up-to-date builds, check out this page: https://hugo.pro/projects/godot-builds/

Was this page helpful?
0 / 5 - 0 ratings