Hi! While migrating over to UE5.3 we are experiencing a crash on load of any level that contains a Landscape component (ULandscapeComponent). The root cause is that we create a MeshBatch in the editor only during the Landscape Proxy’s CreateRenderThreadResources, when we do this we need to give the elements a Uniform Buffer with the batch elements, and we want to use the Landscape Proxy’s Uniform Buffer. The issue is initialization order, when we create the Landscape it puts a request to create some of the render resources into a queue that will be processed in the next graphics frame, but it also sends a delegate to the render thread directly which sets the transform on the Landscape and calls CreateRenderThreadResources, which doesn’t create all render thread resources (such as the vertex uniform buffer on all SceneProxies). This delegate is being called before the init of the uniform buffer, so the MeshBatch we create in CreateRenderThreadResources is guaranteed to get passed nullptr as its UniformBuffer, which triggers a crash.
We have a workaround which is to make sure the UniformBuffer has at least been allocated (doesn’t need to be filled out, we just need the pointer to point the MeshBatch to) inside the Landscape’s CreateRenderThreadResources if we are going to be using it inside that function so this isn’t blocking us, but we were curious if there was something else that might be going on, because this would repro in any UE5 build and not just our project if this was the case.
Have you seen similar issues with the GrassMeshBatch on the Landscape Component? Have you seen what we’re seeing with the initialization order of the PrimitiveSceneProxy’s UniformBuffer vs a child’s CreateRenderThreadResources? It seems caching a MeshBatch like this is somewhat uncommon.