(The following is a translation of a [Content removed] originally written in Japanese by Hirakawa Shoichi.)
Thank you for your continued support.,
I am trying to achieve specialized mesh rendering for one of our internal titles. For that purpose, I have forked the NaniteBuilder module and customized the build process so that it can generate Nanite meshes (Nanite::FResources) with Assembly Parts being instantiated across multiple Root Meshes.
I also have confirmed that the Nanite meshes can be loaded, streamed, and rendered successfully via our own custom assets and components, which are similar to UStaticMesh / UStaticMeshComponent.
Though I have customized the Nanite mesh build process, I have not modified Nanite streaming or the renderer. I am using the standard UE implementations for both.
The issue is, however, that when streaming some of the custom Nanite meshes with a large number of Mip Levels (and a high polygon count), the engine freezes.
Investigating the issue, I found that recursive calls to FStreamingManager::ApplyFixups continue for an extremely long time and appear to effectively never terminate.
Looking into the implementation of FStreamingManager::ApplyFixups, I found that the bAllowReconsider parameter does not appear to be referenced within the function as of UE 5.8.1. So, as a test, I made the following change so that the Reconsider other pages processing is performed only when bAllowReconsider is true. With this change, the freeze no longer occurs.
void FStreamingManager::ApplyFixups( const FFixupChunk& FixupChunk, const FResources& Resources, const TSet<uint32>* NoWriteGPUPages, uint32 NumStreamingPages, uint32 PageToExclude, uint32 VirtualPageRangeStart, bool bUninstall, bool bAllowReconsider, bool bAllowReinstall )
{
// ...
// Reconsider other pages
#if 1 // EDIT_BEGIN
if (bAllowReconsider)
#endif // EDIT_END
for (uint32 i = 0; i < FixupChunk.Header.NumReconsiderPages; i++)
{
const uint32 ReconsiderPageIndex = ResidentVirtualPages[VirtualPageRangeStart + FixupChunk.GetReconsiderPageIndex(i)].ResidentPageIndex;
if (ReconsiderPageIndex != INVALID_RESIDENT_PAGE_INDEX)
{
ApplyFixups(*ResidentPageFixupChunks[ReconsiderPageIndex], Resources, NoWriteGPUPages, NumStreamingPages, PageToExclude, VirtualPageRangeStart, bUninstall, false, false);
}
}
}
So, could you clarify the following points, please?
(1) Was bAllowReconsider originally intended to be used to control whether ApplyFixups is recursively called for Reconsider Pages, as in the change above?
(2) If the above usage is correct, we are considering applying the same change as an engine patch on the project side. Are there any cases where this could cause issues with the consistency or correctness of Nanite Streaming?
(3) If checking bAllowReconsider alone is not sufficient as a condition for preventing recursive calls to ApplyFixups, is there a recommended way to keep ApplyFixups recursion to the minimum necessary while preserving the correctness of Nanite Streaming?
I would appreciate it if you could take a look at this issue.
[Attachment Removed]