godotengine / godot

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

Deleting the Epic Games folder completely shatters Vulkan #89305

Closed TheNetherPug closed 6 months ago

TheNetherPug commented 6 months ago

Tested versions

In all the versions tested so far, the error persists.

System information

Windows 11 - Vulkan Forward+ - GTX 1650 - Intel i5 9300H - 8Gb of ram

Issue description

I don't quite know how to properly describe this. I had only a few gb of space left on my C: Drive, and so whilst cleaning it, I decided to delete the Epic Games folder that was on my D: Drive.

Somehow, in some way, this singular action managed to break Godot's vulkan in almost every way. I fixed most of them by simply installing the Vulkan SDK, but the below errors persisted:

  :55 - Tokenizer: Unknown character #35: '#'
  Shader compilation failed.
  :55 - Tokenizer: Unknown character #35: '#'
  Shader compilation failed.
  :55 - Tokenizer: Unknown character #35: '#'
  Shader compilation failed.
  ./servers/rendering/renderer_rd/shader_rd.h:165 - Parameter "version" is null.
  ./servers/rendering/renderer_rd/shader_rd.h:165 - Parameter "version" is null.
  modules/multiplayer/scene_replication_config.cpp:59 - Condition "p_value.get_type() != Variant::BOOL" is true. Returning: false
  modules/multiplayer/scene_replication_config.cpp:59 - Condition "p_value.get_type() != Variant::BOOL" is true. Returning: false
  modules/multiplayer/scene_replication_config.cpp:59 - Condition "p_value.get_type() != Variant::BOOL" is true. Returning: false
  modules/multiplayer/scene_replication_config.cpp:59 - Condition "p_value.get_type() != Variant::BOOL" is true. Returning: false
  res://assets/characters/player/shaders/post_processing/SSOUTLINE.gdshader:55 - Tokenizer: Unknown character #35: '#'
  Shader compilation failed.
  editor/plugins/text_shader_editor.cpp:64 - Condition "p_region.y < 0" is true.
  editor/plugins/text_shader_editor.cpp:64 - Condition "p_region.y < 0" is true.
  ./servers/rendering/renderer_rd/shader_rd.h:165 - Parameter "version" is null.
  ./servers/rendering/renderer_rd/shader_rd.h:165 - Parameter "version" is null.`

No code was changed at all. Suddenly, godot's GDShaders stopped recognizing directives, among other things I quite don't understand. After many attempts over many hours to fix this, including consulting with the discord server, I have not been able to fix these. So I have made this github issue.

I apologize greatly if this was not the appropriate course of action, but I'm not quite sure of any other options I could've done.

Steps to reproduce

If you are testing this, I recommend you first use a VM since I don't know of any fix.

Steps:

  1. Install Epic Games
  2. Install Godot
  3. Create a forward+ project in godot with all the typical 3D elements in it and play it. It will work as normal
  4. Find the Epic Games folder, and delete it.
  5. Suddenly Godot's vulkan breaks. This can be resolved by either reinstalling epic games or installing the Vulkan SDK. However, this results in shaders being broken in a multitude of ways.

Minimal reproduction project (MRP)

Since this is an issue not related to code directly, or project files directly, a MRP wouldn't suffice.

edit

This appears to be an error more associated with Tokenizer

TheNetherPug commented 6 months ago

Side note: This appears to greatly affect this shader in general: https://godotshaders.com/shader/high-quality-post-process-outline/

akien-mga commented 6 months ago

Godot has no link to the Epic Games folder, so the only likely explanation is that the Epic Games install included a Vulkan layer registered in the Windows registry, and its dependencies can no longer be found.

To uninstall software on Windows, you should always go through an uninstaller, not delete folders directly. This leaves things unclean which can cause such issues.

If you run Godot from a terminal, the top lines of the log likely refer to a broken/missing Epic related Vulkan layer. You should delete references to it from the registry.

TheNetherPug commented 6 months ago

Godot has no link to the Epic Games folder, so the only likely explanation is that the Epic Games install included a Vulkan layer registered in the Windows registry, and its dependencies can no longer be found.

To uninstall software on Windows, you should always go through an uninstaller, not delete folders directly. This leaves things unclean which can cause such issues.

If you run Godot from a terminal, the top lines of the log likely refer to a broken/missing Epic related Vulkan layer. You should delete references to it from the registry.

@akien-mga I'm not too sure which registry keys it would be in this particular case. When playing the game, the top lines do not reference a missing epic related vulkan layer, since I reinstalled epic games and installed the Vulkan SDK.

darksylinc commented 6 months ago

According to this layer guide on Windows the layers' installation lies in HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan thus you can use regedit to get that location and delete all entries referencing Epic Games or Unreal.

Another thing you can try is set VK_LOADER_LAYERS_DISABLE=~implicit~ according to Loader Debugging and selectively re-enable them until you find the troublesome one.

TheNetherPug commented 6 months ago

According to this layer guide on Windows the layers' installation lies in HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan thus you can use regedit to get that location and delete all entries referencing Epic Games or Unreal.

Another thing you can try is set VK_LOADER_LAYERS_DISABLE=~implicit~ according to Loader Debugging and selectively re-enable them until you find the troublesome one.

@darksylinc

Oddly enough, there are no references to epic games or unreal in the registry area. I'm not quite sure how to use the loader debugging, however I will give it a try and see what happens

TheNetherPug commented 6 months ago

Quick note: I sent a message in regards to this on the RocketChat, to see if any engine contributors may be able to help further on there. Though no response yet.

TheNetherPug commented 6 months ago

image

Probably didn't do this correctly, but I ran this command in the Terminal and reopened godot. Issue still persists, @darksylinc

darksylinc commented 6 months ago

Hi!

Godot needs to be opened from the same terminal session that run the set command.

Thus you'd need something like:

cd C:\Path\to\Project
set VK_LOADER_LAYERS_DISABLE=~implicit~
godot.exe
bruvzg commented 6 months ago

Windows the layers' installation lies in HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan

Check it HKEY_CURRENT_USER\SOFTWARE\Khronos\ as well.

Also check for following files:

%HOME%\AppData\Local\LunarG\vkconfig\override\*.*

And if any of the following environment variables VK_LAYER_PATH, VK_ADD_LAYER_PATH, VK_INSTANCE_LAYERS, VK_LOADER_LAYERS_ENABLE is set.

darksylinc commented 6 months ago

If that doesn't solve the problem then another explanation I can think of is that Epic is running a service that injects its code into other executables.

If that's the case then it's probably setup to start at launch. You may notice something opening msconfig.exe and inspecting all the services.

TheNetherPug commented 6 months ago

from @darksylinc:

Hi!

Godot needs to be opened from the same terminal session that run the set command.

Thus you'd need something like:

cd C:\Path\to\Project
set VK_LOADER_LAYERS_DISABLE=~implicit~
godot.exe

Oh sorry, didn't know that. I just tried that but unfortunately it didn't work.

from @bruvzg:

Windows the layers' installation lies in HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan

Check it HKEY_CURRENT_USER\SOFTWARE\Khronos\ as well.

Also check for following files:

%HOME%\AppData\Local\LunarG\vkconfig\override\*.*

And if any of the following environment variables VK_LAYER_PATH, VK_ADD_LAYER_PATH, VK_INSTANCE_LAYERS, VK_LOADER_LAYERS_ENABLE is set.

In HKEY_LOCAL_MACINE\SOFTWARE\Khronos\Vulkan Oddly enough, the only registry keys present are from the Vulkan SDK:

image

Similarly, there is also no files present in vkconfig\override\: image

And the environment variables are not set: image

This is extremely odd to be quite honest. I will never delete that Epic Games folder ever again after this :(

TheNetherPug commented 6 months ago

from @darksylinc:

If that doesn't solve the problem then another explanation I can think of is that Epic is running a service that injects its code into other executables.

If that's the case then it's probably setup to start at launch. You may notice something opening msconfig.exe and inspecting all the services.

I have epic games disabled from startup. It appears to have been running still so I have now closed it. Issue still persists.

image

TheNetherPug commented 6 months ago

Is there a way to delete Godot's Tokenizer and completely reinstall it somehow? That's really the only issue I have, since it's preventing the outline shader I use to be compiled properly (which is half of the artstyle of the game).

akien-mga commented 6 months ago

I wonder if it's Godot's Vulkan pipeline or shader caches which are now invalid after the removal of some layer code that Epic used to inject in the driver.

I don't recall the exact paths but check for Godot caches in %APPDATA% or %TEMP%, as well as the shader cache in the project's .godot folder.

TheNetherPug commented 6 months ago

from @akien-mga

I wonder if it's Godot's Vulkan pipeline or shader caches which are now invalid after the removal of some layer code that Epic used to inject in the driver.

I don't recall the exact paths but check for Godot caches in %APPDATA% or %TEMP%, as well as the shader cache in the projects .godot folder.

Alrighty. I've deleted the caches I found in %APPDATA% and project folder, and I have deleted everything that was not in-use in the %TEMP% folder. Will test and send updates

TheNetherPug commented 6 months ago

Issue persisted.

It appears as if these errors in particular are the culprits: :55 - Tokenizer: Unknown character #35: '#' Shader compilation failed. ./servers/rendering/renderer_rd/shader_rd.h:166 - Parameter "version" is null. ./servers/rendering/renderer_rd/shader_rd.h:166 - Parameter "version" is null.

@akien-mga

TheNetherPug commented 6 months ago

@akien-mga, @darksylinc

Thank you guys for helping out so much, turns out it was kind of my fault so I apologize greatly for that 😓

At some point during the chaos while I was trying to desperately fix epic games, I managed to somehow accidentally remove half of the outline shader I use. I repasted the code and it works fine now! I'll be closing this thread as well. Once again I'm really sorry and thank you guys so much for taking the time to help me out