Repository: godot
Issue: ATI/AMD Driver Crash while Building Shaders (3.x)
Labels: bug,topic:rendering,crash

### Godot version

v3.6.beta.custom_build [7d87ed371]

### System information

Windows 10, GLES3, AMD RX 6700 XT and other AMD cards driver version 23.9.3 and 23.9.1

### Issue description

In Fist of the Forgotten, I try to pre-build all the shaders, and during this process, the game crashes on pretty much every AMD card players have tested on.  I don't have one myself, so I can't directly test.  Shader compilation mode is set to synchronous.  Appears to be a driver issue.

```
 	ntdll.dll!_NtDelayExecution@8()	Unknown
 	KERNELBASE.dll!SleepEx()	Unknown
 	KERNELBASE.dll!_Sleep@4()	Unknown
>	atioglxx.dll!5d8893a4()	Unknown
 	atioglxx.dll![Frames below may be incorrect and/or missing, no symbols loaded for atioglxx.dll]	Unknown
 	atioglxx.dll!5d889a58()	Unknown
 	atioglxx.dll!5d890b8d()	Unknown
 	FistOfTheForgottenDemo.exe!VisualServerScene::_render_scene(const Transform p_cam_transform, const CameraMatrix & p_cam_projection, const int p_eye, bool p_cam_orthogonal, RID p_force_environment, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass) Line 3325	C++
 	FistOfTheForgottenDemo.exe!VisualServerScene::render_camera(RID p_camera, RID p_scenario, Vector2 p_viewport_size, RID p_shadow_atlas) Line 2896	C++
 	FistOfTheForgottenDemo.exe!VisualServerViewport::_draw_3d(VisualServerViewport::Viewport * p_viewport, ARVRInterface::Eyes p_eye) Line 78	C++
 	FistOfTheForgottenDemo.exe!VisualServerViewport::_draw_viewport(VisualServerViewport::Viewport * p_viewport, ARVRInterface::Eyes p_eye) Line 109	C++
 	FistOfTheForgottenDemo.exe!VisualServerViewport::draw_viewports() Line 344	C++
 	FistOfTheForgottenDemo.exe!VisualServerRaster::draw(bool p_swap_buffers, double frame_step) Line 116	C++
 	FistOfTheForgottenDemo.exe!VisualServerWrapMT::draw(bool p_swap_buffers, double frame_step) Line 85	C++
 	FistOfTheForgottenDemo.exe!Main::iteration() Line 2366	C++
 	FistOfTheForgottenDemo.exe!OS_Windows::run() Line 3591	C++
 	FistOfTheForgottenDemo.exe!widechar_main(int argc, wchar_t * * argv) Line 176	C++
 	[Inline Frame] FistOfTheForgottenDemo.exe!_main() Line 198	C++
 	FistOfTheForgottenDemo.exe!main(int _argc, char * * _argv) Line 198	C++
 	[Inline Frame] FistOfTheForgottenDemo.exe!invoke_main() Line 78	C++
 	FistOfTheForgottenDemo.exe!__scrt_common_main_seh() Line 288	C++
 	kernel32.dll!@BaseThreadInitThunk@12()	Unknown
 	ntdll.dll!__RtlUserThreadStart()	Unknown
 	ntdll.dll!__RtlUserThreadStart@8()	Unknown
```

I made a special build that allows players to build shaders one at a time to identify the problem shader, but the results are inconsistent, making me think it's not one specific shader, but just some bug with shader compilation in general.  I don't think it's specifically a Godot problem, but perhaps somebody here has some connections and could get somebody at ATI/AMD to look into this to either find a workaround or get the drivers fixed.

### Steps to reproduce

Grab the FOTF demo off of Steam: https://store.steampowered.com/app/1105470/Fist_of_the_Forgotten/

You can right click, go to betas, and select the debugging branch for one that gives more info and lets you step through the shaders 1 by 1.

I'm using my own custom engine that has shader includes and other things, on the off chance you want to build from source.  Code available here: https://github.com/jitspoe/godot/tree/3.x.jitspoe

### Minimal reproduction project

Not sure of a minimal way to repro this, especially since I don't have the hardware to repro this on. :(