FMaterialLayersFunctions::GetLayerVisibility check assert hitting when reparenting a material instance to new parent material sometimes

Hello,

We have some users hitting a low frequency crash when reparenting materials.

From my testing this seems like a race condition. Some users are hitting it in Development builds, but I was not able to reproduce it attached in a debug build. I was wondering if this crash stack looks familiar to you and if there is a fix available. If not, I could try to get some more info on the crash.

Thanks

Steps to Reproduce

  1. Duplicate a Material Instance
  2. Change Parent Material to new material
  3. Observe crash sometimes

Hi, we do have a small number of reported crashes with very similar call stacks in 5.4 and 5.5. Can you provide more information about the materials being duplicated? In the past (UE 5.2)we’ve seen crashes in these areas related to material parameter collisions.

CL#23675742 Added check that reports errors if a parameter is added in a Material bound to different values. This should not be allowed.

Code now checks for this occurrences and reprorts an error message instead of siliently trying to compile the material anyway.

This was causing a crash when two material functions containing the same parameter bound to different values (e.g. different textures) are used in the same material.