Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcut for cycling scalers and filters / Output in MangoApp #895

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Root-Core
Copy link

As discussed in #893, I have implemented key bindings to cycle through the upscalers and filters.
I have not removed the existing shortcuts yet, as you can not determine which scaler is active for now.

I added the current scaler settings to the mango message protocol, as it supports FSR only atm.
The PR to show it in MangoHud: flightlessmango/MangoHud#1042

The new shortcuts are Super + X (scalers) and Super + Z (filters).

This keys are one of the last ones that do not trigger something in my DE (KDE Plasma) and they are neighbors.
They are placeholders though. If there is a better idea, we should change them before they are merged.

@@ -19,12 +19,15 @@ struct mangoapp_msg_v1 {

uint32_t pid;
uint64_t visible_frametime_ns;
uint8_t fsrUpscale;
uint8_t fsrSharpness;
uint8_t fsrUpscale; // deprecated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually showed whether FSR was doing anything not whether it was selected.

it 1280x800 game on 1280x800 output would show disabled here even if FSR was disabled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I understand. With a quick look at the sources it seems to be only activated if upscaling is necessary.

gamescope/src/steamcompmgr.cpp

Lines 2263 to 2265 in 7a1fe2d

bool needsScaling = frameInfo.layers[0].scale.x < 0.999f && frameInfo.layers[0].scale.y < 0.999f;
frameInfo.useFSRLayer0 = g_upscaleFilter == GamescopeUpscaleFilter::FSR && needsScaling;
frameInfo.useNISLayer0 = g_upscaleFilter == GamescopeUpscaleFilter::NIS && needsScaling;

Off-topic: While I'm not knowledgeable in this matter, it might also be beneficial to filter / sharpen images that aren't (up-)scaled. #702


To be technology agnostic: The same behavior applies to NIS.

There isn't any feedback currently, as the g_bFSRActive flag and GAMESCOPE_FSR_FEEDBACK atom explicitly reference FSR and only get triggered if FSR is used. I know nothing about Xlib and how this atom is used, but we should consider refactoring these technology specific bits. I can't find any other tool / program online, that references this specific atom though.


Nevertheless, if there is a reason to only use the filters on upscaled frames and keep the flag, it might be better to add a scaler_filter_active and keep fsrUpscale deprecated.

BTW: fsrUpscale still gets populated at the moment, so we are able to check / show this in MangoApp.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be okay to repurprose this and the atom for a generic 'upscaling active'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding MangoApp, repurposing / renaming is denied (flightlessmango/MangoHud#1042 (comment)), adding fields would be the way to go for the IPC.

I can refactor the internal variables / logic though, so that it is generic.
You should decide if it is okay to rename the atom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants