From b37f3c7044209fc6fef3e39be549b97db194db3d Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Wed, 23 Jul 2025 23:07:35 -0400 Subject: fps slider for target pacing with UI --- py_modules/lsfg_vk/config_schema_generated.py | 8 ++++++-- py_modules/lsfg_vk/configuration_helpers_generated.py | 2 +- shared_config.py | 8 ++++++++ src/components/ConfigurationSection.tsx | 14 +++++++++++++- src/config/configSchema.ts | 2 +- src/config/generatedConfigSchema.ts | 10 ++++++++++ 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/py_modules/lsfg_vk/config_schema_generated.py b/py_modules/lsfg_vk/config_schema_generated.py index cc90207..a406efd 100644 --- a/py_modules/lsfg_vk/config_schema_generated.py +++ b/py_modules/lsfg_vk/config_schema_generated.py @@ -16,6 +16,7 @@ from shared_config import CONFIG_SCHEMA_DEF, ConfigFieldType DLL = "dll" MULTIPLIER = "multiplier" FLOW_SCALE = "flow_scale" +TARGET_TOTAL_FPS = "target_total_fps" PERFORMANCE_MODE = "performance_mode" HDR_MODE = "hdr_mode" EXPERIMENTAL_PRESENT_MODE = "experimental_present_mode" @@ -31,6 +32,7 @@ class ConfigurationData(TypedDict): dll: str multiplier: int flow_scale: float + target_total_fps: float performance_mode: bool hdr_mode: bool experimental_present_mode: str @@ -98,6 +100,7 @@ def get_function_parameters() -> str: return """dll: str = "/games/Lossless Scaling/Lossless.dll", multiplier: int = 1, flow_scale: float = 0.8, + target_total_fps: float = 0.0, performance_mode: bool = True, hdr_mode: bool = False, experimental_present_mode: str = "fifo", @@ -114,6 +117,7 @@ def create_config_dict(**kwargs) -> ConfigurationData: "dll": kwargs.get("dll"), "multiplier": kwargs.get("multiplier"), "flow_scale": kwargs.get("flow_scale"), + "target_total_fps": kwargs.get("target_total_fps"), "performance_mode": kwargs.get("performance_mode"), "hdr_mode": kwargs.get("hdr_mode"), "experimental_present_mode": kwargs.get("experimental_present_mode"), @@ -126,6 +130,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', 'multiplier', 'flow_scale', 'target_total_fps', 'performance_mode', 'hdr_mode', 'experimental_present_mode'] SCRIPT_FIELDS = ['dxvk_frame_rate', 'enable_wow64', 'disable_steamdeck_mode', 'mangohud_workaround', 'disable_vkbasalt'] -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'] +ALL_FIELDS = ['dll', 'multiplier', 'flow_scale', 'target_total_fps', 'performance_mode', 'hdr_mode', 'experimental_present_mode', 'dxvk_frame_rate', 'enable_wow64', 'disable_steamdeck_mode', 'mangohud_workaround', 'disable_vkbasalt'] diff --git a/py_modules/lsfg_vk/configuration_helpers_generated.py b/py_modules/lsfg_vk/configuration_helpers_generated.py index f9f4a65..bf44b36 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']}") + logger.info(f"Updated lsfg TOML configuration: dll={config['dll']}, multiplier={config['multiplier']}, flow_scale={config['flow_scale']}, target_total_fps={config['target_total_fps']}, 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']}") def get_config_field_names() -> list[str]: diff --git a/shared_config.py b/shared_config.py index 68c7b82..72dcf11 100644 --- a/shared_config.py +++ b/shared_config.py @@ -44,6 +44,14 @@ CONFIG_SCHEMA_DEF = { "location": "toml" }, + "target_total_fps": { + "name": "target_total_fps", + "fieldType": ConfigFieldType.FLOAT, + "default": 0.0, + "description": "specify your post-frame gen target framerate to force specific frame pacing logic. 0 = default pacing", + "location": "toml" + }, + "performance_mode": { "name": "performance_mode", "fieldType": ConfigFieldType.BOOLEAN, diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx index 778ebc8..7c5d9ca 100644 --- a/src/components/ConfigurationSection.tsx +++ b/src/components/ConfigurationSection.tsx @@ -2,7 +2,7 @@ import { PanelSectionRow, ToggleField, SliderField, DropdownItem } from "@decky/ import { ConfigurationData } from "../config/configSchema"; import { FpsMultiplierControl } from "./FpsMultiplierControl"; import { - FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, + FLOW_SCALE, TARGET_TOTAL_FPS, PERFORMANCE_MODE, HDR_MODE, EXPERIMENTAL_PRESENT_MODE, DXVK_FRAME_RATE, DISABLE_STEAMDECK_MODE, MANGOHUD_WORKAROUND, DISABLE_VKBASALT } from "../config/generatedConfigSchema"; @@ -49,6 +49,18 @@ export function ConfigurationSection({ /> + + onConfigChange(TARGET_TOTAL_FPS, value)} + /> + + = { default: 0.8, description: "change the flow scale" }, + target_total_fps: { + name: "target_total_fps", + fieldType: ConfigFieldType.FLOAT, + default: 0.0, + description: "specify your post-frame gen target framerate to force specific frame pacing logic. 0 = default pacing" + }, performance_mode: { name: "performance_mode", fieldType: ConfigFieldType.BOOLEAN, @@ -103,6 +110,7 @@ export interface ConfigurationData { dll: string; multiplier: number; flow_scale: number; + target_total_fps: number; performance_mode: boolean; hdr_mode: boolean; experimental_present_mode: string; @@ -123,6 +131,7 @@ export function getDefaults(): ConfigurationData { dll: "/games/Lossless Scaling/Lossless.dll", multiplier: 1, flow_scale: 0.8, + target_total_fps: 0.0, performance_mode: true, hdr_mode: false, experimental_present_mode: "fifo", @@ -139,6 +148,7 @@ export function getFieldTypes(): Record { dll: ConfigFieldType.STRING, multiplier: ConfigFieldType.INTEGER, flow_scale: ConfigFieldType.FLOAT, + target_total_fps: ConfigFieldType.FLOAT, performance_mode: ConfigFieldType.BOOLEAN, hdr_mode: ConfigFieldType.BOOLEAN, experimental_present_mode: ConfigFieldType.STRING, -- cgit v1.2.3