FlushExtendedLifetimeResourceDeletes异常耗时问题咨询

[Image Removed]

你好,我们现在在移动端游戏中,偶尔会出现FlushExtendedLifetimeResourceDeletes耗时将近0.5s的情况,但是因为是偶现问题且在RHI线程,我们不太好确定是什么资源导致的这个情况,想请问下这种问题有没有什么办法能够协助定位到是什么资源的销毁导致的耗时异常或者是其他的原因?

Hi,

你好,UE5.5的版本里对RHI做了大量的重构,其中一个改动是CL#28031549,部分注释如下(主要看第四条),避免删除资源的时候Flush RHI Thread。这个改动是在内部的一个分支里开发的,主分支没有单独的Changlist,所以git上看不到。不知道你们能否考虑升级引擎,因为我担心即便单独把这个改动给你们,他可能还依赖其他改动,以及后续还有很多相关改动。

不过如果你们需要,我可以单独发给你们这条改动尝试一下。

`Fix lifetime issues with RHI resources and the validation layer

  • RHI validation ops must be submitted before RHI resources are deleted, since those ops contain RHI resource references. This wasn’t possible given how the RHI deletion queue relied on an EnqueueLambda.
  • Resource deletion is now part of the submission pipeline. Contexts are finalize and submitted first, then any resources in the delete queue are destroyed. Finally RHIProcessDeleteQueue is called to allow platform RHIs to process GPU memory / resource deletion.
  • Deletion is also decoupled from flushing. It is now possible to enqueue resource deletion without having to flush the RHI thread.
  • Nested RHI resources are now deleted immediately when their parent is deleted (i.e. an outer resource holding the only reference to an inner resource). Previously, the inner resource would be placed back on the deletion queue.`