Hi. We’ve been working on our 5.8 engine upgrade and ran into issues where several of our shaders stopped loading on device. We have a change to fix the issue but we’re not completely sure if this is the best way to resolve the issue.
Below is a summary of the issue and what happened. Full disclosure: This was written by Claude but reviewed by a human. Our investigation was focused on Android but the same issue was also present on iOS. We tried building Android on Windows and everything worked as expected.
---
On Linux and Mac hosts, UE 5.8 staging packs every cooked package into pakchunk0 when chunk generation is on. The cook still writes one shader library per chunk, so the packaged game opens only the chunk 0 library. Every material assigned to another chunk then falls back to the default material. Windows hosts are not affected, and the same project staged correctly on 5.7.4.
## Observed behavior
Setup: UE 5.8.3, Android\_MultiClient, `bGenerateChunks=True`, IoStore, `-zenstore`, staged on a Linux build agent.
- The cook writes 16 chunk manifests and 15 per-chunk shader libraries (`ShaderArchive-<Project>_Chunk<N>-…`).
- UnrealPak and IoStore write one container, `pakchunk0`, holding all 5,761 packages.
- On device the log shows `Missing shader resource for hash ‘…’ for shader platform ‘VULKAN_ES3_1_ANDROID’ in the shader library while serializing asset M_UI_Basic`, followed by `Tried to access an uncooked shader map ID in a cooked application`.
## Root cause
A change to `FileSystemReference.CombineStrings` in EpicGames.Core stopped splitting paths on backslashes on Linux and Mac, but the chunk manifests are still written with backslashes.
1. `AssetRegistryGenerator.cpp` writes each manifest line relative to the root directory and replaces `/` with `\` on every host, for example `..\..\Project\Saved\Cooked\Android_MultiClient\…`.
2. `ReadPakChunkManifest` in `CopyBuildToStagingDirectory.Automation.cs` resolves each line with `FileReference.Combine(SC.LocalRoot, Line)`.
3. Commit e200891440 (CL 45500365, “Changed FileSystemReference.CombineStrings to use StackStringBuffer”) made `CombineStrings` split only on `Path.DirectorySeparatorChar` and `Path.AltDirectorySeparatorChar`. In 5.7 it split on both `\` and `/` on every host. On Linux and Mac both separators are `/`, so a backslash line stays one segment and its `..` parts are never resolved.
4. No staged file matches a manifest entry, so staging assigns every file to the default chunk, pakchunk0.
The manifest writer and reader are unchanged between 5.7.4 and 5.8.3. Only the path handling underneath them changed.
---
The change we’ve made to resolve is to change references of “FileReference.Combine(SC.LocalRoot, Line).FullName” to “FileReference.Combine(SC.LocalRoot, Line.Replace(‘’\\‘’, Path.DirectorySeparatorChar)).FullName” which works in making the shaders load on device when built from Linux/Mac.
Is this the correct diagnosis and approach?
[Attachment Removed]