godotengine / godot

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

Shader compile error and subsequent crash on Radeon 3000 #98398

Open Gromph opened 2 weeks ago

Gromph commented 2 weeks ago

Tested versions

Reproducible in Godot 4.3 stable Not Reproducible Godot 3.6 stable

System information

Windows 10 - Godot 4.3 stable - OpenGL Compatibility - Athlon II 260 with integrated ATI Radeon 3000

Issue description

Just running Godot 4.3 logs shader compile errors then crashes: Ran from cmd prompt and copy and pasted output to godot_cmd.log: godot_cmd.log

At the very least it would be nice for the user to get the error message that says to try updating drivers. I submitted that as a Godot Proposal: https://github.com/godotengine/godot-proposals/issues/11008

Steps to reproduce

  1. Download Godot x86_64 4.3 for Windows
  2. Run in cmd prompt
  3. A black window briefly shows and then disappears

Minimal reproduction project (MRP)

No project needed, just try to run Godot 4.3

darksylinc commented 2 weeks ago

The driver is so old it's not compliant.

It is complaining that this is not a number because of the u (unsigned) prefix:

#define MAX_FORWARD_LIGHTS 8u

Other drivers will complain if the u is missing (which is the proper behavior). You might be able to run Godot on Linux though, since the driver is more recent.

Alternatively, ANGLE is your best shot.

You're right that Godot could have better error reporting; but this is hard to do because it's crashing because in this particular case the driver is faulty; which is indistinguishable from a bug in Godot.

Update: @clayjohn is it possible to force ANGLE even if the GPU claims to support the minimum OpenGL version?

clayjohn commented 2 weeks ago

@darksylinc Yes, we maintain a blocklist of GPUs that should be forced to fallback to ANGLE despite claiming OpenGL support. I can't tell if this GPU will get caught by the list or not, but it appears we list many GPUs with similar names.

https://github.com/godotengine/godot/blob/b3bcb2dc14691f7729984128dca26a844f662fa1/main/main.cpp#L2064

Gromph commented 2 weeks ago

The name of this gpu comes up as: "ATI Radeon 3000 Graphics" So it doesn't match: "Radeon HD 3"

I added it to the list, and got the same problem, an empty window briefly shows and exits with no error message. This is what's in the log now:

Godot Engine v4.3.1.rc.custom_build.5bc9ed052 (2024-10-14 23:17:48 UTC) - https://godotengine.org
USER ERROR: Can't create an EGL context. Error code: 12297
   at: EGLManager::_gldisplay_create_context (drivers\egl\egl_manager.cpp:196)
USER ERROR: Method/function failed. Returning: -1
   at: EGLManager::_get_gldisplay_id (drivers\egl\egl_manager.cpp:104)
USER ERROR: Condition "gldisplay_id < 0" is true. Returning: ERR_CANT_CREATE
   at: EGLManager::window_create (drivers\egl\egl_manager.cpp:227)
USER ERROR: Failed to create an OpenGL window.
   at: DisplayServerWindows::_create_window (platform\windows\display_server_windows.cpp:5514)
USER ERROR: Failed to create main window.
   at: DisplayServerWindows::DisplayServerWindows (platform\windows\display_server_windows.cpp:6192)
USER ERROR: Error initializing GLAD.
   at: RasterizerGLES3::RasterizerGLES3 (drivers\gles3\rasterizer_gles3.cpp:270)

I'm assuming it doesn't support a new enough version of DirectX either.

I noticed that in DisplayServerWindows::DisplayServerWindows after calling _create_window it wasn't setting r_error if main_window == INVALID_WINDOW_ID. I fixed that and now at least get the upgrade your drivers error message. We added on to this message to instruct users to download an older version of our games for their older hardware.

I'm fine with not supporting such old hardware, just want to get that message to users.

Gromph commented 2 weeks ago

I submitted a pull request to at least show error message when _create_window fails: https://github.com/godotengine/godot/pull/98405