[5.7.4] Editor freezes indefinitely when a Material Function preview compiles with Substrate enabled

Summary

With Substrate enabled, the editor hangs forever as soon as a Material Function’s preview material needs to compile. It happens even with a brand-new Material Function containing only a Constant node. With Substrate disabled, everything works normally.

What Type of Bug are you experiencing?

Editor

Steps to Reproduce

  1. Open a project with Substrate enabled (Project Settings > Engine > Rendering > Substrate Materials = enabled).
  2. In the Content Browser, right-click > Materials > Material Function to create a new Material Function.
  3. Open it in the Material Function editor.
  4. Add a Constant node.
  5. Connect the Constant node to the Function Output.

Expected Result

The preview material compiles and the editor stays responsive.

Observed Result

The editor freezes indefinitely, and CPU usage of UnrealEditor stays near 0%. The editor never recovers and has to be killed from Task Manager.

Affects Versions

5.7

Platform(s)

Windows

Upload an image

For crash reports, include your callstack

FWindowsPlatformProcess::SleepNoStats
FWindowsPlatformProcess::Sleep(float)
FShaderCompilingManager::BlockOnShaderMapCompletion
FShaderCompilingManager::HandlePotentialRetryOnError
FShaderCompilingManager::ProcessAsyncResults
FAssetCompilingManager::ProcessAsyncTasks
FEngineLoop::Tick()
EngineTick()
GuardedMain
LaunchWindowsStartup
WinMain

Additional Notes

  • No freeze when Substrate is disabled (tested on the same project and machine).
  • Regular Materials compile fine with Substrate enabled. Only Material Function previews hang.
  • The same freeze happens when opening an existing Material Function whose output is already connected.
  • No error is printed in the output log or in the debugger output before or during the freeze. The last log lines are only the Material Function editor opening.
  • Shader compilation works normally otherwise: shaders compile fine at editor startup.

Platform: Windows, DX12, SM6
Hardware: NVIDIA RTX 3080, 32 GB RAM

Hello there @k0garashi!

Thanks for the details and repo steps. Looking at your log, the editor appears to be getting stuck while waiting for a shader map to finish compiling, considering the “FShaderCompilingManager::BlockOnShaderMapCompletion” line. Then it retries over and over, resulting in a freeze.

Since it only happens with Substrate enabled, while regular Materials still compile normally, there may be an issue with the Material Function preview compilation path. I also tried reproducing this on my end using UE 5.7.4, but I couldn’t get the editor to freeze with the same setup as yours. So, the issue is most likely tied to your local project. I would test the following:

  • Close the editor, go to your project’s main directory, and delete folders Saved, Intermediate and DerivedDataCache. This will clear up any stale data, and force a shader recompile. The next launch will take a bit longer, but it could solve the problem

  • Still, if the issue persists, open the logs in your new Saved folder, and search the latest entry for “LogShaders” and/or “Error”. Share them here, so we can investigate further