STAT_VolumetricLightmapBuildData isn't counted correctly.
It seems that the root cause is Volume.IndirectionTexture.DataSize is set to 0 before STAT_VolumetricLightmapBuildData is decreased.

// PrecomputedVolumetricLightmap.cpp
	if (!bTransient)
		const SIZE_T VolumeBytes = GetAllocatedBytes(); // <---- GetAllocatedBytes() returns 0
		DEC_DWORD_STAT_BY(STAT_VolumetricLightmapBuildData, VolumeBytes);

In the following code, DataSize is cleared.

ENGINE_API void FPrecomputedVolumetricLightmapData::AddToSceneData(FPrecomputedVolumetricLightmapData* SceneData)
			if (!GIsEditor)
				// Steal the indirection texture. When the sublevels are unloaded the values will be restored.
				IndirectionTexture = SceneData->IndirectionTexture;			
Steps to Reproduce
  1. Download the attached project on the UDN thread:
  2. Play a standalone game
  3. type "stat MapBuildData" on a console window
  4. You can see STAT_VolumetricLightmapBuildData is 0
  5. type 1, to load a level
  6. type 3, to unload the level loaded before
  7. you can see STAT_VolumetricLightmapBuildData is 9MB
  8. type 1, to load a level
  9. type 3, to unload the level loaded before
  10. you can see STAT_VolumetricLightmapBuildData is 18MB...

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-172465 in the post.

Login to Vote

ComponentUE - Rendering
Affects Versions5.1
Target Fix5.3
CreatedDec 9, 2022
UpdatedFeb 8, 2023