diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-15 13:11:06 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-15 13:11:06 -0400 |
| commit | ec4541dd78f4e2a58b679b20740f323d8ce76698 (patch) | |
| tree | e86b7bbafc74c68683617904bf77092fc6361c05 /py_modules | |
| parent | 192c6ece06e1a400ca3a559f47001324150a96ea (diff) | |
| download | decky-lsfg-vk-ec4541dd78f4e2a58b679b20740f323d8ce76698.tar.gz decky-lsfg-vk-ec4541dd78f4e2a58b679b20740f323d8ce76698.zip | |
add disable_vkbasalt=1 defaulted, hidden ui to expose to users later if desired
Diffstat (limited to 'py_modules')
| -rw-r--r-- | py_modules/lsfg_vk/configuration.py | 21 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/constants.py | 2 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/installation.py | 5 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/plugin.py | 5 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/types.py | 1 |
5 files changed, 24 insertions, 10 deletions
diff --git a/py_modules/lsfg_vk/configuration.py b/py_modules/lsfg_vk/configuration.py index f5e2981..cf3c9a3 100644 --- a/py_modules/lsfg_vk/configuration.py +++ b/py_modules/lsfg_vk/configuration.py @@ -66,7 +66,8 @@ class ConfigurationService(BaseService): "flow_scale": 1.0, "hdr": False, "perf_mode": False, - "immediate_mode": False + "immediate_mode": False, + "disable_vkbasalt": False } lines = content.split('\n') @@ -102,11 +103,15 @@ class ConfigurationService(BaseService): # Parse MESA_VK_WSI_PRESENT_MODE elif match := re.match(r'^(#\s*)?export\s+MESA_VK_WSI_PRESENT_MODE=([^\s#]+)', line): config["immediate_mode"] = not bool(match.group(1)) and match.group(2) == 'immediate' + + # Parse DISABLE_VKBASALT + elif match := re.match(r'^(#\s*)?export\s+DISABLE_VKBASALT=(\d+)', line): + config["disable_vkbasalt"] = not bool(match.group(1)) and match.group(2) == '1' return config def update_config(self, enable_lsfg: bool, multiplier: int, flow_scale: float, - hdr: bool, perf_mode: bool, immediate_mode: bool) -> ConfigurationResponse: + hdr: bool, perf_mode: bool, immediate_mode: bool, disable_vkbasalt: bool) -> ConfigurationResponse: """Update lsfg script configuration Args: @@ -116,6 +121,7 @@ class ConfigurationService(BaseService): hdr: Whether to enable HDR perf_mode: Whether to enable performance mode immediate_mode: Whether to enable immediate present mode (disable vsync) + disable_vkbasalt: Whether to disable vkbasalt layer Returns: ConfigurationResponse with success status @@ -123,7 +129,7 @@ class ConfigurationService(BaseService): try: # Generate script content using template script_content = self._generate_script_content( - enable_lsfg, multiplier, flow_scale, hdr, perf_mode, immediate_mode + enable_lsfg, multiplier, flow_scale, hdr, perf_mode, immediate_mode, disable_vkbasalt ) # Write the updated script atomically @@ -131,7 +137,8 @@ class ConfigurationService(BaseService): self.log.info(f"Updated lsfg script configuration: enable={enable_lsfg}, " f"multiplier={multiplier}, flow_scale={flow_scale}, hdr={hdr}, " - f"perf_mode={perf_mode}, immediate_mode={immediate_mode}") + f"perf_mode={perf_mode}, immediate_mode={immediate_mode}, " + f"disable_vkbasalt={disable_vkbasalt}") return { "success": True, @@ -151,7 +158,7 @@ class ConfigurationService(BaseService): } def _generate_script_content(self, enable_lsfg: bool, multiplier: int, flow_scale: float, - hdr: bool, perf_mode: bool, immediate_mode: bool) -> str: + hdr: bool, perf_mode: bool, immediate_mode: bool, disable_vkbasalt: bool) -> str: """Generate script content from configuration parameters Args: @@ -161,6 +168,7 @@ class ConfigurationService(BaseService): hdr: Whether to enable HDR perf_mode: Whether to enable performance mode immediate_mode: Whether to enable immediate present mode + disable_vkbasalt: Whether to disable vkbasalt layer Returns: Generated script content @@ -171,5 +179,6 @@ class ConfigurationService(BaseService): flow_scale=flow_scale, hdr="export LSFG_HDR=1" if hdr else "# export LSFG_HDR=1", perf_mode="export LSFG_PERF_MODE=1" if perf_mode else "# export LSFG_PERF_MODE=1", - immediate_mode="export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" if immediate_mode else "# export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" + immediate_mode="export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" if immediate_mode else "# export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync", + disable_vkbasalt="export DISABLE_VKBASALT=1" if disable_vkbasalt else "# export DISABLE_VKBASALT=1" ) diff --git a/py_modules/lsfg_vk/constants.py b/py_modules/lsfg_vk/constants.py index ceaf12b..2440d9d 100644 --- a/py_modules/lsfg_vk/constants.py +++ b/py_modules/lsfg_vk/constants.py @@ -35,6 +35,7 @@ export LSFG_FLOW_SCALE={flow_scale} {hdr} {perf_mode} {immediate_mode} +{disable_vkbasalt} # Execute the passed command with the environment variables set exec "$@" @@ -52,3 +53,4 @@ DEFAULT_ENABLE_LSFG = True DEFAULT_HDR = False DEFAULT_PERF_MODE = True DEFAULT_IMMEDIATE_MODE = False +DEFAULT_DISABLE_VKBASALT = True diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py index 1d0e96f..4e02091 100644 --- a/py_modules/lsfg_vk/installation.py +++ b/py_modules/lsfg_vk/installation.py @@ -14,7 +14,7 @@ from .constants import ( LIB_FILENAME, JSON_FILENAME, ZIP_FILENAME, BIN_DIR, SO_EXT, JSON_EXT, LSFG_SCRIPT_TEMPLATE, DEFAULT_MULTIPLIER, DEFAULT_FLOW_SCALE, DEFAULT_ENABLE_LSFG, - DEFAULT_HDR, DEFAULT_PERF_MODE, DEFAULT_IMMEDIATE_MODE + DEFAULT_HDR, DEFAULT_PERF_MODE, DEFAULT_IMMEDIATE_MODE, DEFAULT_DISABLE_VKBASALT ) from .types import InstallationResponse, UninstallationResponse, InstallationCheckResponse @@ -111,7 +111,8 @@ class InstallationService(BaseService): flow_scale=DEFAULT_FLOW_SCALE, hdr="export LSFG_HDR=1" if DEFAULT_HDR else "# export LSFG_HDR=1", perf_mode="export LSFG_PERF_MODE=1" if DEFAULT_PERF_MODE else "# export LSFG_PERF_MODE=1", - immediate_mode="export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" if DEFAULT_IMMEDIATE_MODE else "# export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" + immediate_mode="export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync" if DEFAULT_IMMEDIATE_MODE else "# export MESA_VK_WSI_PRESENT_MODE=immediate # - disable vsync", + disable_vkbasalt="export DISABLE_VKBASALT=1" if DEFAULT_DISABLE_VKBASALT else "# export DISABLE_VKBASALT=1" ) # Use atomic write to prevent corruption diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py index 000830f..5fb6c8f 100644 --- a/py_modules/lsfg_vk/plugin.py +++ b/py_modules/lsfg_vk/plugin.py @@ -73,7 +73,7 @@ class Plugin: return self.configuration_service.get_config() async def update_lsfg_config(self, enable_lsfg: bool, multiplier: int, flow_scale: float, - hdr: bool, perf_mode: bool, immediate_mode: bool) -> Dict[str, Any]: + hdr: bool, perf_mode: bool, immediate_mode: bool, disable_vkbasalt: bool) -> Dict[str, Any]: """Update lsfg script configuration Args: @@ -83,12 +83,13 @@ class Plugin: hdr: Whether to enable HDR perf_mode: Whether to enable performance mode immediate_mode: Whether to enable immediate present mode (disable vsync) + disable_vkbasalt: Whether to disable vkbasalt layer Returns: ConfigurationResponse dict with success status """ return self.configuration_service.update_config( - enable_lsfg, multiplier, flow_scale, hdr, perf_mode, immediate_mode + enable_lsfg, multiplier, flow_scale, hdr, perf_mode, immediate_mode, disable_vkbasalt ) # Plugin lifecycle methods diff --git a/py_modules/lsfg_vk/types.py b/py_modules/lsfg_vk/types.py index f0ec892..07dd768 100644 --- a/py_modules/lsfg_vk/types.py +++ b/py_modules/lsfg_vk/types.py @@ -62,6 +62,7 @@ class ConfigurationData(TypedDict): hdr: bool perf_mode: bool immediate_mode: bool + disable_vkbasalt: bool class ConfigurationResponse(BaseResponse): |
