VirtualHeightfieldMesh crashes editor and game in FVirtualTextureFeedback::TransferGPUToCPU

Same here. After digging into the matter, this issues related to 5.5 new RDG async task code.

In 5.5, FVirtualTextureFeedback::TransferGPUToCPU could be called from two separate source in different WorkerThread, one for VT system and other is VHM, in which case causes data racing.

In 5.4 two sources are calling from RenderThread. If you set r.RDG.ParallelExecute 0, the crash would not longer happen.

One easy fix is to duplicate the global GVirtualTextureFeedback to use new GVirtualTextureFeedbackVHM for the only VHM API in FVirtualTextureFeedback::TransferGPUToCPU.

TGlobalResource< FVirtualTextureFeedback > GVirtualTextureFeedback;
TGlobalResource< FVirtualTextureFeedback > GVirtualTextureFeedbackVHM; // Fix VHM crash when r.RDG.ParallelExecute > 0

0001-VirtualHeightMesh-Fix-VHM-crash-when-r.RDG.ParallelE.patch (2.6 KB)
0002-VirtualHeightMesh-Fix-VHM-crash-when-there-are-more-.patch (2.0 KB)

2 Likes