Can we rarefy the use of PostLoadDeferredObjects?

Hello,

We are currently working on a game where we use intensively level and texture streaming.
We have already significantly optimized the asynchronous loading scheme in Unreal Engine 4, but there is now a bottleneck that becomes more and more relevant, the PostLoadDeferredObjects stage.

I know that this stage runs on Game Thread mainly because textures must be committed to Render Thread from there.

But currently, all objects are using this stage because by default IsPostLoadThreadSafe() returns false in UObject class although it is overridden to return false in UTexture as well.

Are there other kinds of objects that really need to be post-loaded in Game Thread?

Hi Xavier,

We generally assume that we can’t guarantee PostLoad being thread safe due to the fact people sometimes use it to do game logic stuff. You can experiment with overriding IsPostLoadThreadSafe with your game classes though.

Beside the possible addition of game logic stuff, is there any other engine-related constraint, such as the rendering commands posted from UE4 Game Thread that would be also posted from FAsyncLoadingThread in this case? Or any other conflict?

I guess this is one of the reasons it’s on game thread by default - it’s really hard to tell. Having said that, materials could cause issues too. Anything really that has a PostLoad override hasn’t been checked for thread safety yet.

Is Epic planning to review adding this for the most frequently serialized engine classes in the near future? From some quick tests/profiles this seems like one of the single biggest speed improvements for streaming.

Hi Ben, yes, we’re going to be looking at load time optimizations in the next three months.