From 3688c8bd07af67a00748c87581c80c5125d9273a Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 5 Aug 2025 12:36:50 -0400 Subject: feat: groundwork for fp16 feature in lsfg-vk --- package.json | 6 ++--- py_modules/lsfg_vk/config_schema.py | 30 ++++++++++++++-------- py_modules/lsfg_vk/config_schema_generated.py | 8 ++++-- .../lsfg_vk/configuration_helpers_generated.py | 2 +- shared_config.py | 8 ++++++ src/components/ConfigurationSection.tsx | 11 +++++++- src/config/configSchema.ts | 2 +- src/config/generatedConfigSchema.ts | 10 ++++++++ 8 files changed, 59 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 504c12c..cadb6fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-lossless-scaling-vk", - "version": "0.8.1", + "version": "0.9.0", "description": "Use Lossless Scaling on the Steam Deck using the lsfg-vk vulkan layer", "type": "module", "scripts": { @@ -46,8 +46,8 @@ "remote_binary": [ { "name": "lsfg-vk_noui.zip", - "url": "https://github.com/PancakeTAS/lsfg-vk/releases/download/v1.0.0/lsfg-vk_noui.zip", - "sha256hash": "af5ee1626d9543349245520689da107c3ebc5ef3755086441fbb854173b8e096" + "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/fp16-test-1/lsfg-vk_noui.zip", + "sha256hash": "8291366916b29ba0c2bae465bde46980dccab52f7beb957f4c2416bb114d15c8" } ], "pnpm": { diff --git a/py_modules/lsfg_vk/config_schema.py b/py_modules/lsfg_vk/config_schema.py index bbace42..33f7b3e 100644 --- a/py_modules/lsfg_vk/config_schema.py +++ b/py_modules/lsfg_vk/config_schema.py @@ -167,14 +167,20 @@ class ConfigurationManager: lines = ["version = 1"] lines.append("") - # Add global section with DLL path only (if specified) + # Add global section with global fields + lines.append("[global]") + + # Add dll field if specified if config.get("dll"): - lines.append("[global]") lines.append(f"# specify where Lossless.dll is stored") - # Generate TOML lines for TOML fields only - USE GENERATED CONSTANTS from .config_schema_generated import DLL lines.append(f'dll = "{config[DLL]}"') - lines.append("") + + # Add no_fp16 field + from .config_schema_generated import NO_FP16 + lines.append(f"# force-disable fp16 (use on older nvidia cards)") + lines.append(f"no_fp16 = {str(config[NO_FP16]).lower()}") + lines.append("") # Add game section with process name for LSFG_PROCESS approach lines.append("[[game]]") @@ -184,8 +190,8 @@ class ConfigurationManager: # Add all configuration fields to the game section for field_name, field_def in CONFIG_SCHEMA.items(): - # Skip dll field - dll goes in global section - if field_name == "dll": + # Skip global fields - they go in global section + if field_name in ("dll", "no_fp16"): continue value = config[field_name] @@ -250,10 +256,14 @@ class ConfigurationManager: elif value.startswith("'") and value.endswith("'"): value = value[1:-1] - # Handle global section (dll only) - USE GENERATED CONSTANTS - if in_global_section and key == "dll": - from .config_schema_generated import DLL - config[DLL] = value + # Handle global section (dll and no_fp16) - USE GENERATED CONSTANTS + if in_global_section: + if key == "dll": + from .config_schema_generated import DLL + config[DLL] = value + elif key == "no_fp16": + from .config_schema_generated import NO_FP16 + config[NO_FP16] = value.lower() in ('true', '1', 'yes', 'on') # Handle game section elif in_game_section: diff --git a/py_modules/lsfg_vk/config_schema_generated.py b/py_modules/lsfg_vk/config_schema_generated.py index 50d2a4f..85aa7d2 100644 --- a/py_modules/lsfg_vk/config_schema_generated.py +++ b/py_modules/lsfg_vk/config_schema_generated.py @@ -14,6 +14,7 @@ from shared_config import CONFIG_SCHEMA_DEF, ConfigFieldType # Field name constants for type-safe access DLL = "dll" +NO_FP16 = "no_fp16" MULTIPLIER = "multiplier" FLOW_SCALE = "flow_scale" PERFORMANCE_MODE = "performance_mode" @@ -31,6 +32,7 @@ ENABLE_WSI = "enable_wsi" class ConfigurationData(TypedDict): """Type-safe configuration data structure - AUTO-GENERATED""" dll: str + no_fp16: bool multiplier: int flow_scale: float performance_mode: bool @@ -108,6 +110,7 @@ def get_script_generation_logic(): def get_function_parameters() -> str: """Return function signature parameters""" return """dll: str = "/games/Lossless Scaling/Lossless.dll", + no_fp16: bool = False, multiplier: int = 1, flow_scale: float = 0.8, performance_mode: bool = True, @@ -126,6 +129,7 @@ def create_config_dict(**kwargs) -> ConfigurationData: """Create configuration dictionary from keyword arguments""" return cast(ConfigurationData, { "dll": kwargs.get("dll"), + "no_fp16": kwargs.get("no_fp16"), "multiplier": kwargs.get("multiplier"), "flow_scale": kwargs.get("flow_scale"), "performance_mode": kwargs.get("performance_mode"), @@ -142,6 +146,6 @@ def create_config_dict(**kwargs) -> ConfigurationData: # Field lists for dynamic operations -TOML_FIELDS = ['dll', 'multiplier', 'flow_scale', 'performance_mode', 'hdr_mode', 'experimental_present_mode'] +TOML_FIELDS = ['dll', 'no_fp16', 'multiplier', 'flow_scale', 'performance_mode', 'hdr_mode', 'experimental_present_mode'] SCRIPT_FIELDS = ['dxvk_frame_rate', 'enable_wow64', 'disable_steamdeck_mode', 'mangohud_workaround', 'disable_vkbasalt', 'force_enable_vkbasalt', 'enable_wsi'] -ALL_FIELDS = ['dll', 'multiplier', 'flow_scale', 'performance_mode', 'hdr_mode', 'experimental_present_mode', 'dxvk_frame_rate', 'enable_wow64', 'disable_steamdeck_mode', 'mangohud_workaround', 'disable_vkbasalt', 'force_enable_vkbasalt', 'enable_wsi'] +ALL_FIELDS = ['dll', 'no_fp16', 'multiplier', 'flow_scale', 'performance_mode', 'hdr_mode', 'experimental_present_mode', 'dxvk_frame_rate', 'enable_wow64', 'disable_steamdeck_mode', 'mangohud_workaround', 'disable_vkbasalt', 'force_enable_vkbasalt', 'enable_wsi'] diff --git a/py_modules/lsfg_vk/configuration_helpers_generated.py b/py_modules/lsfg_vk/configuration_helpers_generated.py index b34865a..f8edd97 100644 --- a/py_modules/lsfg_vk/configuration_helpers_generated.py +++ b/py_modules/lsfg_vk/configuration_helpers_generated.py @@ -9,7 +9,7 @@ from .config_schema_generated import ConfigurationData, ALL_FIELDS def log_configuration_update(logger, config: ConfigurationData) -> None: """Log configuration update with all field values""" - logger.info(f"Updated lsfg TOML configuration: dll={config['dll']}, multiplier={config['multiplier']}, flow_scale={config['flow_scale']}, performance_mode={config['performance_mode']}, hdr_mode={config['hdr_mode']}, experimental_present_mode={config['experimental_present_mode']}, dxvk_frame_rate={config['dxvk_frame_rate']}, enable_wow64={config['enable_wow64']}, disable_steamdeck_mode={config['disable_steamdeck_mode']}, mangohud_workaround={config['mangohud_workaround']}, disable_vkbasalt={config['disable_vkbasalt']}, force_enable_vkbasalt={config['force_enable_vkbasalt']}, enable_wsi={config['enable_wsi']}") + logger.info(f"Updated lsfg TOML configuration: dll={config['dll']}, no_fp16={config['no_fp16']}, multiplier={config['multiplier']}, flow_scale={config['flow_scale']}, performance_mode={config['performance_mode']}, hdr_mode={config['hdr_mode']}, experimental_present_mode={config['experimental_present_mode']}, dxvk_frame_rate={config['dxvk_frame_rate']}, enable_wow64={config['enable_wow64']}, disable_steamdeck_mode={config['disable_steamdeck_mode']}, mangohud_workaround={config['mangohud_workaround']}, disable_vkbasalt={config['disable_vkbasalt']}, force_enable_vkbasalt={config['force_enable_vkbasalt']}, enable_wsi={config['enable_wsi']}") def get_config_field_names() -> list[str]: diff --git a/shared_config.py b/shared_config.py index 09aa596..cd8b3ed 100644 --- a/shared_config.py +++ b/shared_config.py @@ -28,6 +28,14 @@ CONFIG_SCHEMA_DEF = { "location": "toml" # where this field is stored/used }, + "no_fp16": { + "name": "no_fp16", + "fieldType": ConfigFieldType.BOOLEAN, + "default": False, + "description": "force-disable fp16 (use on older nvidia cards)", + "location": "toml" + }, + "multiplier": { "name": "multiplier", "fieldType": ConfigFieldType.INTEGER, diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx index 93d13a3..31ce278 100644 --- a/src/components/ConfigurationSection.tsx +++ b/src/components/ConfigurationSection.tsx @@ -4,7 +4,7 @@ import { RiArrowDownSFill, RiArrowUpSFill } from "react-icons/ri"; import { ConfigurationData } from "../config/configSchema"; import { FpsMultiplierControl } from "./FpsMultiplierControl"; import { - FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, + NO_FP16, FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, EXPERIMENTAL_PRESENT_MODE, DXVK_FRAME_RATE, DISABLE_STEAMDECK_MODE, MANGOHUD_WORKAROUND, DISABLE_VKBASALT, FORCE_ENABLE_VKBASALT, ENABLE_WSI } from "../config/generatedConfigSchema"; @@ -113,6 +113,15 @@ export function ConfigurationSection({ /> + + onConfigChange(NO_FP16, value)} + /> + + = { default: "/games/Lossless Scaling/Lossless.dll", description: "specify where Lossless.dll is stored" }, + no_fp16: { + name: "no_fp16", + fieldType: ConfigFieldType.BOOLEAN, + default: false, + description: "force-disable fp16 (use on older nvidia cards)" + }, multiplier: { name: "multiplier", fieldType: ConfigFieldType.INTEGER, @@ -115,6 +122,7 @@ export const CONFIG_SCHEMA: Record = { // Type-safe configuration data structure export interface ConfigurationData { dll: string; + no_fp16: boolean; multiplier: number; flow_scale: number; performance_mode: boolean; @@ -137,6 +145,7 @@ export function getFieldNames(): string[] { export function getDefaults(): ConfigurationData { return { dll: "/games/Lossless Scaling/Lossless.dll", + no_fp16: false, multiplier: 1, flow_scale: 0.8, performance_mode: true, @@ -155,6 +164,7 @@ export function getDefaults(): ConfigurationData { export function getFieldTypes(): Record { return { dll: ConfigFieldType.STRING, + no_fp16: ConfigFieldType.BOOLEAN, multiplier: ConfigFieldType.INTEGER, flow_scale: ConfigFieldType.FLOAT, performance_mode: ConfigFieldType.BOOLEAN, -- cgit v1.2.3 From 15b4dfdaa78bdce50c8b20332863f89b6e0c7f11 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Thu, 7 Aug 2025 14:28:45 -0400 Subject: bump ver and latest lsfg-vk from pancake action --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cadb6fb..b16186a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-lossless-scaling-vk", - "version": "0.9.0", + "version": "0.9.1", "description": "Use Lossless Scaling on the Steam Deck using the lsfg-vk vulkan layer", "type": "module", "scripts": { @@ -46,8 +46,8 @@ "remote_binary": [ { "name": "lsfg-vk_noui.zip", - "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/fp16-test-1/lsfg-vk_noui.zip", - "sha256hash": "8291366916b29ba0c2bae465bde46980dccab52f7beb957f4c2416bb114d15c8" + "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/fp16-test-2/lsfg-vk_noui.zip", + "sha256hash": "a406b3730144c2011e2c2acd3cf44f3ec6c048ee86099bc9c3ac90aa1515e5ec" } ], "pnpm": { -- cgit v1.2.3 From bb0382dd2be4a548f79d6cd48b0e87fbee3cd1a2 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Thu, 7 Aug 2025 14:31:54 -0400 Subject: default perf mode off, fp16 on --- py_modules/lsfg_vk/config_schema_generated.py | 2 +- shared_config.py | 2 +- src/config/generatedConfigSchema.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/py_modules/lsfg_vk/config_schema_generated.py b/py_modules/lsfg_vk/config_schema_generated.py index 85aa7d2..4e701ac 100644 --- a/py_modules/lsfg_vk/config_schema_generated.py +++ b/py_modules/lsfg_vk/config_schema_generated.py @@ -113,7 +113,7 @@ def get_function_parameters() -> str: no_fp16: bool = False, multiplier: int = 1, flow_scale: float = 0.8, - performance_mode: bool = True, + performance_mode: bool = False, hdr_mode: bool = False, experimental_present_mode: str = "fifo", dxvk_frame_rate: int = 0, diff --git a/shared_config.py b/shared_config.py index cd8b3ed..c9df045 100644 --- a/shared_config.py +++ b/shared_config.py @@ -55,7 +55,7 @@ CONFIG_SCHEMA_DEF = { "performance_mode": { "name": "performance_mode", "fieldType": ConfigFieldType.BOOLEAN, - "default": True, + "default": False, "description": "use a lighter model for FG (recommended for most games)", "location": "toml" }, diff --git a/src/config/generatedConfigSchema.ts b/src/config/generatedConfigSchema.ts index 004d5dd..9e61128 100644 --- a/src/config/generatedConfigSchema.ts +++ b/src/config/generatedConfigSchema.ts @@ -60,7 +60,7 @@ export const CONFIG_SCHEMA: Record = { performance_mode: { name: "performance_mode", fieldType: ConfigFieldType.BOOLEAN, - default: true, + default: false, description: "use a lighter model for FG (recommended for most games)" }, hdr_mode: { @@ -148,7 +148,7 @@ export function getDefaults(): ConfigurationData { no_fp16: false, multiplier: 1, flow_scale: 0.8, - performance_mode: true, + performance_mode: false, hdr_mode: false, experimental_present_mode: "fifo", dxvk_frame_rate: 0, -- cgit v1.2.3