D:\Projects\Program\Engine\Engine\Source\Runtime\Landscape\Classes\LandscapeComponent.h
Line:263
/** Pointer to data shared with the render thread, used by the editor tools */
struct FLandscapeEditToolRenderData* EditToolRenderData;
void ULandscapeComponent::BeginDestroy()
{
Super::BeginDestroy();
#if WITH_EDITOR
if (EditToolRenderData != NULL)
{
// Ask render thread to destroy EditToolRenderData
EditToolRenderData->Cleanup();
EditToolRenderData = NULL;
}
if (GIsEditor && !HasAnyFlags(RF_ClassDefaultObject))
{
ALandscapeProxy* Proxy = GetLandscapeProxy();
// Remove any weightmap allocations from the Landscape Actor's map
for (int32 LayerIdx = 0; LayerIdx < WeightmapLayerAllocations.Num(); LayerIdx++)
{
int32 WeightmapIndex = WeightmapLayerAllocations[LayerIdx].WeightmapTextureIndex;
if (WeightmapTextures.IsValidIndex(WeightmapIndex))
{
UTexture2D* WeightmapTexture = WeightmapTextures[WeightmapIndex];
FLandscapeWeightmapUsage* Usage = Proxy->WeightmapUsageMap.Find(WeightmapTexture);
if (Usage != NULL)
{
Usage->ChannelUsage[WeightmapLayerAllocations[LayerIdx].WeightmapTextureChannel] = NULL;
if (Usage->FreeChannelCount() == 4)
{
Proxy->WeightmapUsageMap.Remove(WeightmapTexture);
}
}
}
}
}
#endif
}
并且通过这个结构体来通知渲染线程做一些操作。