Changes needed to support dynamic resolution for Windows (D3D12/Vulkan) on 5.6

Hi there,

I noticed that 5.8 seems to support dynamic resolution on PC for the DX12 and Vulkan RHIs.

We’re shipping on 5.6, but I’d be very interested to enable dynamic resolution for handhelds like SteamDeck where we have a fixed resolution/FPS budget, so was looking at cherry-picking some of those changes.

I tried taking the ‘main’ change I could see, and in a local Windows build with `r.DynamicRes.OperationMode 2` it seemed to be working pretty well!

I also noticed a few other CLs that seem related to dynamic resolution which may be worth taking as well. I wanted to check if there were any other (harder to find) changes in 5.7/5.8 that it depended on, or if it really is as easy to backport as these few CLs.

Cheers,

Geordie

[Attachment Removed]

Steps to Reproduce
None

[Attachment Removed]

Hi Geordie,

helping handhelds is the exact reason we enabled it and yes the Main CL should be all you need to effectively enable the support for dynamic resolution for PC DX12 an Vulkan.

Actually Fortnite has been exposing the dynamic resolution setting on PC skus for quite a bit already bypassing the default engine RHIs configuration.

There are some improvements on how we compute the GPU timing in 5.7 and 5.8 but they are not necessary do having the dynamic resolution system working.

The other CLs you identified related to the dynamic resolution are also not necessary but they are optimization that removes frame hitches for passes that wrongly re-allocated their RT to the dynamic resolution instead of using a view.

If during profiling a PC sku you see spikes in RT allocations on the CPU (CreateCommittedResource API call on DX12) you might want to take those otherwise you should be good shipping with just 48870621.

eg. HZB texture sizes are quantized to power of two sizes, so you will not see much reallocation unless you have significant swings in the dynamic res value.

48871066 instead is just an example in Lyra on how to activate in a game the dynamic resolution setting.

Let me know if you find additional issue or have more question!

Thanks,

Daniele

[Attachment Removed]

Hi Geordie,

yes the HZB change and others fixed RT size apply to all platforms, although PC is the one more susceptible to pay the cost of recreating the resource.

We recently added:

bool FWindowsPlatformMisc::IsDeviceGamingHandheld()that is mostly based on the Windows API that should cover windows handheld, it will return true if detected Steam Deck APUs as well.

My suggestion would be to expose in the settings menu the dynamic resolution toggle on the PC sku (likely asking the user for a target fps) and default to it on when detecting an handheld.

Best,

Daniele

[Attachment Removed]

Hi Daniele,

Ah great to hear, thanks!

I assume the HZB change would apply to other platforms too not just PC?

We’re currently using the `SteamDeck` env variable to detect running on the deck, but I wondered if there were any good ways to detect other handhelds like the ROG Ally X, or if the hardware info is functionally identical to a PC (and if so maybe why DynRes is exposed as a user setting).

Cheers,

Geordie

[Attachment Removed]