diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-23 23:07:35 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-23 23:07:35 -0400 |
| commit | b37f3c7044209fc6fef3e39be549b97db194db3d (patch) | |
| tree | d9e3fddbc3630b8b4fb872a364130c86ab0ae9e9 | |
| parent | abdceb22f7491d5bb29beee7771dab89ceb910f1 (diff) | |
| download | decky-lsfg-vk-b37f3c7044209fc6fef3e39be549b97db194db3d.tar.gz decky-lsfg-vk-b37f3c7044209fc6fef3e39be549b97db194db3d.zip | |
fps slider for target pacing with UI
| -rw-r--r-- | py_modules/lsfg_vk/config_schema_generated.py | 8 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/configuration_helpers_generated.py | 2 | ||||
| -rw-r--r-- | shared_config.py | 8 | ||||
| -rw-r--r-- | src/components/ConfigurationSection.tsx | 14 | ||||
| -rw-r--r-- | src/config/configSchema.ts | 2 | ||||
| -rw-r--r-- | 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"; @@ -50,6 +50,18 @@ export function ConfigurationSection({ </PanelSectionRow> <PanelSectionRow> + <SliderField + label={`Target Total FPS ${config.target_total_fps === 0 ? '(Default)' : config.target_total_fps.toFixed(0)}`} + description="Specify your post-frame gen target framerate to force specific frame pacing logic. 0 = default pacing" + value={config.target_total_fps} + min={0} + max={144} + step={1} + onChange={(value) => onConfigChange(TARGET_TOTAL_FPS, value)} + /> + </PanelSectionRow> + + <PanelSectionRow> <ToggleField label="Performance Mode" description="Uses a lighter model for FG (Recommended for most games)" diff --git a/src/config/configSchema.ts b/src/config/configSchema.ts index 9568fd8..af36dec 100644 --- a/src/config/configSchema.ts +++ b/src/config/configSchema.ts @@ -20,7 +20,7 @@ export { getDefaults, getFieldTypes, // Field name constants for type-safe access - DLL, MULTIPLIER, FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE, + 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 } from './generatedConfigSchema'; diff --git a/src/config/generatedConfigSchema.ts b/src/config/generatedConfigSchema.ts index 4a301a1..a30474c 100644 --- a/src/config/generatedConfigSchema.ts +++ b/src/config/generatedConfigSchema.ts @@ -11,6 +11,7 @@ export enum ConfigFieldType { export const DLL = "dll" as const; export const MULTIPLIER = "multiplier" as const; export const FLOW_SCALE = "flow_scale" as const; +export const TARGET_TOTAL_FPS = "target_total_fps" as const; export const PERFORMANCE_MODE = "performance_mode" as const; export const HDR_MODE = "hdr_mode" as const; export const EXPERIMENTAL_PRESENT_MODE = "experimental_present_mode" as const; @@ -48,6 +49,12 @@ export const CONFIG_SCHEMA: Record<string, ConfigField> = { 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<string, ConfigFieldType> { 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, |
