Missing global shader crash in Packaged Builds

Starting in Unreal 5.0 (and still present through UE 5.2.1), packaged builds (on Windows) of any project have started crashing when our in-house plugin is enabled. The plugin and app run correctly in the Editor, and there are no cooking or packaging errors, yet when we go to run the application, a dialog appears with the following error message:

[2023.06.28-23.36.33:718][ 0]LogWindows: Error: appError called: Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\ShaderCompiler\ShaderCompiler.cpp] [Line: 7173]
Missing global shader FDisplayMappingPS’s permutation 0, Please make sure cooking was successful.

With our plugin disabled, packaged builds of the app run fine. Can anyone help us pinpoint what aspect of our plugin is tripping up Unreal’s build process? Here are the relevant files:

Cook+Build+Package Logs (110.6 KB)
Launch+Crash Logs (74.3 KB)

Have you fixed it yet, im having a very similar problem

We’ve narrowed the cause of this crash down to having a project which:

  1. Has a module which specifies OpenXRHMD within the PrivateDependencyModuleNames list of its Build.cs file AND
  2. Doesn’t have the OpenXR plugin enabled AND
  3. Uses UE 5.1 or greater

Our plugin includes a module which is dependent on OpenXR, but that module is loaded conditionally; if the plugin starts up and finds that OpenXRHMD is loaded, then it triggers the loading of our OpenXR-dependent module. This way we aren’t forcing developers to include the OpenXR plugin in their project, but if they do, then our OpenXR-specific logic can operate correctly, without any additional work on their part.

It’s still unclear to me why declaring one of our modules as dependent on OpenXR causes OpenXR’s shader to be listed as requiring loading on launch, but doesn’t add it to the list of shaders to cook. I’m having trouble coming up with a clean solution to this - the only workaround I can think of is separating our OpenXR-specific module into a second plugin and having developers import both plugins if they’re building an OpenXR project (much messier than having a single plugin with auto-loaded modules).

Do any Epic Devs have ideas on how to force the shader to be cooked/packaged even if the OpenXR plugin is disabled?

1 Like