The way LODData.CachedMeshCommandFlags.CachedMeshCommandHashis calculated in CacheRayTracingMeshBatch will cause assert

reason(cause) of the bug: the way LODData.CachedMeshCommandFlags.CachedMeshCommandHashis calculated in CacheRayTracingMeshBatch is too naive, if a mesh got a lot of material slots, the hash contribution of slot0 will gradually be diminished by right shifts out of the uint64 hash. Then 2 instances with different material settings will use the same shader binding table range, and CBV binding will conflict.

重现步骤

  1. create a mesh with more than 32 material slots
  2. enable raytracing
  3. put 2 instances of that static mesh into the scene
  4. change slot0 material of 1 instance to a new material instance with different parameter but same parent material
  5. an assert will be cause in SetRootCBV

Hi,

I could reproduce the issue and have created a Jira UE-348449 for tracing.​ Please wait a few days and follow the case from https://issues.unrealengine.com/, it will be made public in a few days.