ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.13k stars 211 forks source link

Preemptive Upscaling added in commit 4550dedd appears to cause performance issues on the Steam Deck with Control and possibly other games when using Upscaling methods other than Linear #1535

Open JDGBOLT opened 1 month ago

JDGBOLT commented 1 month ago

It seems the changes that were added in 4550ded have caused the performance at least within the starting area with Control to have wildly inconsistent performance on the Steam Deck. When the upscaling method is set to Linear with the QAM, it seems to perform as expected, but the minute you set it to something other than that the framerate can fluctuate wildly, especially looking outside the window it can drop to as low as 27 fps when using a 40fps/80hz container on the oled. Reverting the commit does cause the performance to be as expected, so something with the new code seems to break something. I also notice that within Mangohud if you switch to FSR, it'll show FSR as on for a split second then show that it's off, with the commit reverted it does not have this issue and shows that it's on correctly. For reference this is on Deck Oled with the Deck OS Main channel 20240917.1000 with the beta client, and running the latest gamescope main branch, and using Proton GE 9-13 but I have tested it with Proton 9.0-2 and it has the same behavior.

Latest Main: 20240919115147_1 20240919115159_1 20240919115136_1 20240919115206_1

Latest Main with 4550ded reverted: 20240919120026_1 20240919120030_1 20240919120033_1 20240919120039_1

I used this patch to revert the commit as there has been changes since it was committed that required some conflict resolution, this also reverts b768e8f7 just due to it being built on top of that commit: patch.txt

matte-schwartz commented 1 month ago

@JDGBOLT If you wouldn't mind checking, in the Steam developer settings there's a toggle labeled Composite Debug. If you enable that option and check Control using FSR again, do QR barcode looking indicators pop up in the top left corner? If they don't appear, what happens if you enable the Force Composite debug toggle next to the Composite Debug toggle and then check the game again, is it still laggy? You can turn both off after testing

JDGBOLT commented 1 month ago

When I turn on Composite Debug, the QR barcode indicators do show up when using upscaling methods other than Linear, with linear they disappear, and of course turning on Force Composite will make them show up all the time, so I think the compositing is working right at least as far as I can tell. Can also notice a visual difference changing between the various upscaling methods, so as far as I can tell that part is actually working right. Also toggling those options on/off has no effect on the poor performance when using the other upscaling methods in the opening area in control.

matte-schwartz commented 1 month ago

Okay I'm able to see the same issue in Control w/ DX11 when set to 40FPS/80Hz

gamescope

gamescope_000

gamescope_002

matte-schwartz commented 1 month ago

unpatched gamescope gpuvis capture: https://drive.filen.io/d/32f756d5-c129-4eef-aa28-7271e4221e68#DkziDH6Y3K3fAG0CCXsKAAuFy62tqIoh

gamescope + aforementioned FSR revert gpuvis capture: https://drive.filen.io/d/9fbb0b82-acd2-4259-ba08-e3e9df360e81#F4FWX70pVSdMcoHFrr36kejIt2madvQL

not entirely clear to me what specifically is causing the issue here @misyltoad, although there's a pretty substantial difference between the two. TDP setting does not really seem to matter here and I kept 40fps/80hz selected throughout testing.

matte-schwartz commented 3 weeks ago

Just checked back in on this today with SteamOS 3.6.18 and while gamescope on jupiter-3.6 has the preemptive upscaling commit, it doesn't have explicit sync active in the DRM backend because of the kernel version only being Linux 6.5 so it seems to avoid this specific issue.