Packaged project crashes on start after migrating to 4.27

Hi there! The packaged game crashes on startup with this error:

Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Engine/Private/ShaderCompiler/ShaderCompiler.cpp] [Line: 5349] Missing global shader FWriteToSliceVS’s permutation 0, Please make sure cooking was successful.

game_Win64_DebugGame!VerifyGlobalShaders()
game_Win64_DebugGame!CompileGlobalShaderMap()
game_Win64_DebugGame!FEngineLoop::PreInitPreStartupScreen()
game_Win64_DebugGame!GuardedMain()
game_Win64_DebugGame!GuardedMainWrapper()
game_Win64_DebugGame!LaunchWindowsStartup()
game_Win64_DebugGame!WinMain()
game_Win64_DebugGame!__scrt_common_main_seh() [D:\a_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

The debug info when running with visual studio shows that the problem is not a shader missing, but a LOT of mismatched size shaders I assume carried on from the last version of unreal in the migration:

LogShaders: Error: Mismatch size for type FHistogramCS, compiled size is 208, loaded size is 156
LogShaders: Error: Mismatch size for type FHeightFogVS, compiled size is 214, loaded size is 162
LogShaders: Error: Mismatch size for type FGlobalShaderMapContent, compiled size is 104, loaded size is 76
LogShaders: Error: Mismatch size for type FGlobalShaderMapContent, compiled size is 104, loaded size is 76
…etc.

The project was migrated from 4.26 to 4.27 a year ago, and before that it built and ran perfectly. Also, I have built other games in this version of the engine and I had no problems so that is also out of the question. This is on windows 64 bit and the packaging process shows no errors. The only fix I have left is to redo in the old 4.26 project the whole year of progress. I’m desperate, please I need help with this. Thank you in advance.

If the compiled shaders are from an older version then just try deleting the shader cache and have 4.27 rebuild them. This might help with the process

Delete the folders

  • DerivedDataCache
  • Intermediate

if c++

  • Binaries
  • .vs

Then try rebuilding the project. It should build the shaders in line with the newer version of the engine.

(post deleted by author)

Thanks for the reply! Unfortunately I have already tried that, plus recompiling all shaders. Also I am doing a full rebuild everytime and tried packaging in 3 different machines. Also fixed redirections in folder, validated assets and maps and resaved the materials, still nothing. One thing to note is that I’m using ue4 in a portable disk, in case that is something to take into account. Is there anything else I can do?

Here is my old post that fixed a similar problem for another person

It was so long ago I forgot I found a solution for it.

If that doesn’t help then maybe this thread could be a fix. the OP had to turn on an encryption setting for ini files for it to not throw the permutation error on a the shader. It was his own shader but the error message itself seems to mirror what you are getting, so it might work.

The ini setting seems to be in project settings => Crypto

The thread:

I saw that thread while researching the issue, and I do have the ini file encryption turned on and the cook on the fly setting turned off so still no advance :sweat_smile:

Maybe these shader tips for ue4 can help?

Hi! Sorry for the delay. I tried that and still got nothing but I noticed that the shaders that fail are the whole ‘Global’ library, maybe there is a way to regenerate those? Or copy them from another 4.27 native project?

I’ve also seem people mentioning this error if the project is for instance on the desktop. It could be a similar problem with your portable drive. Maybe unreal needs it to be in a normal environment that has the correct write access etc.

A fix on reddit mentions you can try moving the project to a new one. I’m guessing via migrate.

https://www.reddit.com/r/unrealengine/comments/168pi02/trying_to_get_package_a_game_but_getting_shader/

Do you have shader model 6 enabled in your project? (SM6 in project settings). If it’s off then try turning it on and compiling.

I will try tomorrow with a non portable ue4 installation and project, thanks. SM6 is not available in my unreal engine though.

Just finished trying everything. No luck for now: Installing the engine and moving the project into my C: drive did nothing and neither migrating the project into a new 4.27 one. Also tried to delete all materials and do a build without them, still didn’t work. I don’t know if there’s any hope left but thank you for your help anyways :frowning: