Translucency dynamic res doesn't update when the overall GPU is over budget

I’ve put up a PR of my fix\changes for better translucency dynamic res support here: https://github.com/EpicGames/UnrealEngine/pull/14201https://github.com/EpicGames/UnrealEngine/pull/14201

I’ve discussed this previously with Alex Peterson. The main issue is that when gpu is over budget, the dynamic res code hits a “gpu over budget panic” code path where it resets the HIstorySize to zero while looping over all the various dynamic res FBudgets. Since the translucency dynamic res is the last one in the loop, and primary dynamic res is first, it means that when the primary goes over budget, all the other FBudgets after it think they have no history, so they don’t recalculate any new percentage.

In addition, i found when locking dynamic res using “r.DynamicRes.TestScreenPercentage” it switches the dynamic res logic to the LegacyScreenPercentageDriver, which doesn’t support translucency dynamic res. I’ve added a separate variable so that primary dynamic res and translucency dynamic res can be locked independently.

There is also another change which tracks how many frames since the last percentage change, but now does it separately for each FBudget instead of tracking them all at the same time, since each one can change on different frames now.

[Attachment Removed]

Steps to Reproduce
I dont remember the exact repro steps but i believe they were something along the lines of:

  • Enable dynamic res in the project. For example:
    • r.DynamicRes.OperationMode=2
    • r.DynamicRes.FrameTimeBudget=16.599999
    • r.DynamicRes.MinScreenPercentage=50
    • r.DynamicRes.MaxScreenPercentage=75
  • Enable translucency dynamic res in the project. For example:
    • r.Translucency.DynamicRes.TimeBudget=1.5
    • r.Translucency.DynamicRes.MinScreenPercentage=50
    • r.Translucency.DynamicRes.MaxScreenPercentage=100
  • Run a scene with expensive translucency, but where the overall GPU time is below r.DynamicRes.FrameTimeBudget, and notice that translucency dynamic res will update to maintain the time budget.
  • Force GPU frame time to be over budget (can be done fairly easily by changing min\max screen percentage, or forcing rendering to a higher res). Notice that as soon as the GPU goes over budget, the translucency dynamic res gets stuck at whatever percentage it was at before going over budget. When the GPU returns back under budget then translucency dynamic res starts updating again.
    [Attachment Removed]

Hi Steve,

Thanks for sending in the PR, we’ve taken a look and I’m passing this ticket to the engineer involved in case there are further questions.

[Attachment Removed]

Hello,

I am sorry but I have not been able to reproduce in our main branch/5.8. The code has changed a bit since the code to integrate has conflits. So I have no clue if the problem is still here or not. Right now I cannot go forward and integrate.

[Attachment Removed]

After additional investigation it appears our dynamic resolution stat display has been broken since 5.6, I’ve created the following Jira to track that fix and then will continue verifying the panic issue https://issues.unrealengine.com/issue/UE\-371217

[Attachment Removed]