diff --git a/lutris/runner_interpreter.py b/lutris/runner_interpreter.py index 341a3aa23..2ad694ddc 100644 --- a/lutris/runner_interpreter.py +++ b/lutris/runner_interpreter.py @@ -88,18 +88,24 @@ def get_launch_parameters(runner, gameplay_info): has_gamescope = system_config.get("gamescope") and system.can_find_executable("gamescope") if has_gamescope: launch_arguments = get_gamescope_args(launch_arguments, system_config) + if system_config.get("gamescope_hdr"): + env["ENABLE_HDR_WSI"] = "1" return launch_arguments, env def get_gamescope_args(launch_arguments, system_config): """Insert gamescope at the start of the launch arguments""" + if system_config.get("gamescope_hdr"): + launch_arguments.insert(0, "DISABLE_HDR_WSI=1") + launch_arguments.insert(0, "DXVK_HDR=1") + launch_arguments.insert(0, "ENABLE_GAMESCOPE_WSI=1") + launch_arguments.insert(0, "env") launch_arguments.insert(0, "--") if system_config.get("gamescope_force_grab_cursor"): launch_arguments.insert(0, "--force-grab-cursor") if system_config.get("gamescope_fsr_sharpness"): - gamescope_fsr_sharpness = system_config["gamescope_fsr_sharpness"] - launch_arguments.insert(0, gamescope_fsr_sharpness) + launch_arguments.insert(0, system_config["gamescope_fsr_sharpness"]) launch_arguments.insert(0, "--fsr-sharpness") launch_arguments[0:0] = _get_gamescope_fsr_option() if system_config.get("gamescope_flags"): @@ -128,6 +134,9 @@ def get_gamescope_args(launch_arguments, system_config): gpu = GPUS[system_config["gpu"]] launch_arguments.insert(0, gpu.pci_id) launch_arguments.insert(0, "--prefer-vk-device") + if system_config.get("gamescope_hdr"): + launch_arguments.insert(0, "--hdr-debug-force-output") + launch_arguments.insert(0, "--hdr-enabled") launch_arguments.insert(0, "gamescope") return launch_arguments diff --git a/lutris/sysoptions.py b/lutris/sysoptions.py index b0d90ca9d..45925ea16 100644 --- a/lutris/sysoptions.py +++ b/lutris/sysoptions.py @@ -209,6 +209,16 @@ system_options = [ # pylint: disable=invalid-name "condition": system.can_find_executable("gamescope") and linux.LINUX_SYSTEM.nvidia_gamescope_support(), "help": _("Use gamescope to draw the game window isolated from your desktop.\n" "Toggle fullscreen: Super + F"), }, + { + "section": _("Gamescope"), + "option": "gamescope_hdr", + "type": "bool", + "label": _("Enable HDR (Experimental)"), + "advanced": True, + "default": False, + "condition": bool(system.can_find_executable("gamescope")), + "help": _("Enable HDR for games that support it.\bn" "Requires Plasma 6 and VK_hdr_layer."), + }, { "section": _("Gamescope"), "option": "gamescope_force_grab_cursor",