GPUOpen-Effects / FidelityFX-FSR2

FidelityFX Super Resolution 2
Other
1.96k stars 179 forks source link

FSR2 memory leak in UE5.1 #104

Open bonorumetmalorum opened 1 year ago

bonorumetmalorum commented 1 year ago

Hello!

Having recently integrated FSR2 for UE 5.1 we noticed that our memory usage was slowly climbing over the runtime of our game. Please find attached the various captures we made using Insights and LLM whilst diagnosing this problem. We found a fix to this which was to add the following lines to both, FSR2TemporalUpscalingD3D12.cpp:156 and FSR2TemporalUpscalingVulkan.cpp:113 in the function named ForceUAVTransition:

FRHITransition ConstFreeTransition = const_cast<FRHITransition>(Transition); RHIReleaseTransition(ConstFreeTransition); FConcurrentLinearAllocator::Free(ConstFreeTransition);

It would appear that the issue was this transition was not being deleted properly due to EndTransition not being called and freeing the memory in the linear allocator.

Thanks,

Govind Venkatesh and David Smith :)