main: Add FSR command line option and shortcut.
This commit is contained in:
parent
6cfe2fe09c
commit
ead46a2db0
4 changed files with 14 additions and 0 deletions
|
@ -37,6 +37,7 @@ const struct option *gamescope_options = (struct option[]){
|
||||||
{ "output-width", required_argument, nullptr, 'W' },
|
{ "output-width", required_argument, nullptr, 'W' },
|
||||||
{ "output-height", required_argument, nullptr, 'H' },
|
{ "output-height", required_argument, nullptr, 'H' },
|
||||||
{ "nearest-neighbor-filter", no_argument, nullptr, 'n' },
|
{ "nearest-neighbor-filter", no_argument, nullptr, 'n' },
|
||||||
|
{ "fsr-upscaling", no_argument, nullptr, 'U' },
|
||||||
|
|
||||||
// nested mode options
|
// nested mode options
|
||||||
{ "nested-unfocused-refresh", required_argument, nullptr, 'o' },
|
{ "nested-unfocused-refresh", required_argument, nullptr, 'o' },
|
||||||
|
@ -85,6 +86,7 @@ const char usage[] =
|
||||||
" -W, --output-width output width\n"
|
" -W, --output-width output width\n"
|
||||||
" -H, --output-height output height\n"
|
" -H, --output-height output height\n"
|
||||||
" -n, --nearest-neighbor-filter use nearest neighbor filtering\n"
|
" -n, --nearest-neighbor-filter use nearest neighbor filtering\n"
|
||||||
|
" -U --fsr-upscaling use AMD FidelityFX™ Super Resolution 1.0 for upscaling"
|
||||||
" --cursor path to default cursor image\n"
|
" --cursor path to default cursor image\n"
|
||||||
" -R, --ready-fd notify FD when ready\n"
|
" -R, --ready-fd notify FD when ready\n"
|
||||||
" -T, --stats-path write statistics to path\n"
|
" -T, --stats-path write statistics to path\n"
|
||||||
|
@ -116,6 +118,7 @@ const char usage[] =
|
||||||
"Keyboard shortcuts:\n"
|
"Keyboard shortcuts:\n"
|
||||||
" Super + F toggle fullscreen\n"
|
" Super + F toggle fullscreen\n"
|
||||||
" Super + N toggle nearest neighbour filtering\n"
|
" Super + N toggle nearest neighbour filtering\n"
|
||||||
|
" Super + U toggle FSR upscaling\n"
|
||||||
" Super + S take a screenshot\n"
|
" Super + S take a screenshot\n"
|
||||||
"";
|
"";
|
||||||
|
|
||||||
|
@ -135,6 +138,7 @@ bool g_bFullscreen = false;
|
||||||
bool g_bIsNested = false;
|
bool g_bIsNested = false;
|
||||||
|
|
||||||
bool g_bFilterGameWindow = true;
|
bool g_bFilterGameWindow = true;
|
||||||
|
bool g_fsrUpscale = false;
|
||||||
|
|
||||||
bool g_bBorderlessOutputWindow = false;
|
bool g_bBorderlessOutputWindow = false;
|
||||||
|
|
||||||
|
@ -253,6 +257,9 @@ int main(int argc, char **argv)
|
||||||
case 'O':
|
case 'O':
|
||||||
g_sOutputName = optarg;
|
g_sOutputName = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'U':
|
||||||
|
g_fsrUpscale = true;
|
||||||
|
break;
|
||||||
case 0: // long options without a short option
|
case 0: // long options without a short option
|
||||||
opt_name = gamescope_options[opt_index].name;
|
opt_name = gamescope_options[opt_index].name;
|
||||||
if (strcmp(opt_name, "help") == 0) {
|
if (strcmp(opt_name, "help") == 0) {
|
||||||
|
|
|
@ -22,6 +22,8 @@ extern bool g_bFullscreen;
|
||||||
|
|
||||||
extern bool g_bFilterGameWindow;
|
extern bool g_bFilterGameWindow;
|
||||||
|
|
||||||
|
extern bool g_fsrUpscale;
|
||||||
|
|
||||||
extern bool g_bBorderlessOutputWindow;
|
extern bool g_bBorderlessOutputWindow;
|
||||||
|
|
||||||
extern bool g_bNiceCap;
|
extern bool g_bNiceCap;
|
||||||
|
|
|
@ -152,6 +152,9 @@ void inputSDLThreadRun( void )
|
||||||
case KEY_N:
|
case KEY_N:
|
||||||
g_bFilterGameWindow = !g_bFilterGameWindow;
|
g_bFilterGameWindow = !g_bFilterGameWindow;
|
||||||
break;
|
break;
|
||||||
|
case KEY_U:
|
||||||
|
g_fsrUpscale = !g_fsrUpscale;
|
||||||
|
break;
|
||||||
case KEY_S:
|
case KEY_S:
|
||||||
take_screenshot();
|
take_screenshot();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1506,6 +1506,8 @@ paint_all()
|
||||||
}
|
}
|
||||||
// Just draw focused window as normal, be it Steam or the game
|
// Just draw focused window as normal, be it Steam or the game
|
||||||
paint_window(w, w, &composite, &pipeline, global_focus.cursor, PaintWindowFlag::BasePlane | PaintWindowFlag::DrawBorders, 1.0f);
|
paint_window(w, w, &composite, &pipeline, global_focus.cursor, PaintWindowFlag::BasePlane | PaintWindowFlag::DrawBorders, 1.0f);
|
||||||
|
|
||||||
|
composite.useFSRLayer0 = g_fsrUpscale;
|
||||||
}
|
}
|
||||||
update_touch_scaling( &composite );
|
update_touch_scaling( &composite );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue