godotengine / godot

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

Shader errors freeze Godot Editor. #76181

Closed Angular-Angel closed 1 year ago

Angular-Angel commented 1 year ago

Godot version

Godot_v4.0.2-stable_linux.x86_64

System information

           `-/osyhddddhyso/-`              angle@Sager 
        .+yddddddddddddddddddy+.           ----------- 
      :yddddddddddddddddddddddddy:         OS: Xubuntu 22.10 x86_64 
    -yddddddddddddddddddddhdddddddy-       Kernel: 5.19.0-1021-lowlatency 
   odddddddddddyshdddddddh`dddd+ydddo      Uptime: 56 mins 
 `yddddddhshdd-   ydddddd+`ddh.:dddddy`    Packages: 5478 (dpkg), 11 (brew), 38 (flatpak), 40 (snap) 
 sddddddy   /d.   :dddddd-:dy`-ddddddds    Shell: bash 5.2.2 
:ddddddds    /+   .dddddd`yy`:ddddddddd:   Resolution: 1920x1080 
sdddddddd`    .    .-:/+ssdyodddddddddds   DE: Xfce 4.16 
ddddddddy                  `:ohddddddddd   WM: Xfwm4 
dddddddd.                      +dddddddd   WM Theme: Default 
sddddddy                        ydddddds   Theme: Greybird [GTK2/3] 
:dddddd+                      .oddddddd:   Icons: elementary-xfce-darker [GTK2/3] 
 sdddddo                   ./ydddddddds    Terminal: xfce4-terminal 
 `yddddd.              `:ohddddddddddy`    Terminal Font: Monospace 12 
   oddddh/`      `.:+shdddddddddddddo      CPU: Intel i5-6500 (4) @ 3.600GHz 
    -ydddddhyssyhdddddddddddddddddy-       GPU: NVIDIA GeForce GTX 1050 Ti 
      :yddddddddddddddddddddddddy:         Memory: 3945MiB / 24000MiB 

Issue description

Shaders, specifically those with matrix multiplcation using the view matrics in the light function, will have lots of errors, and if you view these errors they can freeze the entire Godot editor.

Steps to reproduce

Download this project: https://gitlab.com/AngularAngel/godot-shader-problem-example

Load it in Godot, run it, then examine the errors in the debugger. Your Godot Editor should freeze after viewing a few of the errors. I suggest killing the editor soon after, or it may freeze your entire desktop environment and force a computer restart.

Minimal reproduction project

https://gitlab.com/AngularAngel/godot-shader-problem-example

Contact

I am available on Discord at: Angle#9413 if you need to ask me questions!

clayjohn commented 1 year ago

This issue was fixed once before, but the fix caused a bunch of other issues with text layouts and was eventually reverted. https://github.com/godotengine/godot/pull/73736

I have encountered this freeze as well, it can be caused by an error with our internal shaders (i.e. any shader compiler error not caught in the shader editor). However, I have never had it freeze my desktop, only the Godot application.

Cc @RandomShaper

Angular-Angel commented 1 year ago

Good to know. What about the underlying shader error I encountered? The one where a matrix multiplication in the light function causes a billion shader errors? Is that new?

Angular-Angel commented 1 year ago

For those wondering about my underlying shader bug, it should be fixed by this PR: https://github.com/godotengine/godot/pull/76290