Description

When executing "ShowFlag.Rendering 0", it occur the memory leak because it can't run RHICmdList.ImmediateFlush().

 

The following code is a workaround. DEC_MEMORY_STAT_BY() is ImmediateFlush. Without this code, only INC_MEMORY_STAT_BY() is executed.

void FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate& RHICmdList)
{
...
if (!ViewFamily.EngineShowFlags.Rendering)
{
+ if (GRHINeedsExtraDeletionLatency || !GRHICommandList.Bypass())
+ {
+ RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThreadFlushResources);
+ }
return;
}
...
}
void FMobileSceneRenderer::Render(FRHICommandListImmediate& RHICmdList)
{
...
if(!ViewFamily.EngineShowFlags.Rendering)
{
+ if (GRHINeedsExtraDeletionLatency || !GRHICommandList.Bypass())
+ {
+ RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThreadFlushResources);
+ }
return;
}
...
}
Steps to Reproduce

1. Launch standalone game with "-d3d12" argument from editor
2. Exec "ShowFlag.Rendering 0"
3. Exec "Stat MemoryPlatform"

Then, it can see increasing Used Physical memory.

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-79676 in the post.

1
Login to Vote

Unresolved
ComponentRendering
Affects Versions4.214.22
Target Fix4.25
CreatedSep 2, 2019
UpdatedOct 24, 2019