5.7 crash when GGrassMapUseAsyncFetch / grass.GrassMap.UseAsyncFetch is enabled

I’m seeing a crash in all our maps with landscape in 5.7 due to a flag we had set earlier in the project (grass.GrassMap.UseAsyncFetch). There was a change to UMaterialInstanceConstant::ComputeAllStateCRC() which now attempts to query the Material’s StateId to CRC but then immediately triggers the check inside MaterialInstance::GetMaterial:

check(IsInGameThread() || IsInParallelGameThread() || IsAsyncLoading());

I’ve disabled that option locally to make progress with the engine update. Should the GetMaterial function now account for the additional context it can be called in?

[Attachment Removed]

Steps to Reproduce

Set grass.GrassMap.UseAsyncFetch to 1 in DefaultEngine.ini

Open map with landscape with a material instance and grass

Observe crash

[Attachment Removed]

Hi Aleksey,

Thanks for the report, I have been able to reproduce the issue and created a ticket for tracking. In practice, we have found that grass.GrassMap.UseAsyncFetch 1 does not make a huge difference, which is why we haven’t enabled it yet and it wasn’t thoroughly tested yet. I’m curious : if you remove that check locally, do you see a significant performance improvement on your project? If so, on which platform and by how much?

Cheers,

Jonathan

[Attachment Removed]

The project we’re on _now_ was branched from an older project that had a lot more going on in the grass department. So it was more of a legacy setting that we inherited and not something we’re actively using. Just wanted to make sure y’all knew about the regression. Thanks for the reply and the ticket!

[Attachment Removed]