diff options
| author | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2025-08-07 14:32:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-07 14:32:43 -0400 |
| commit | 6489f2273fc246fcca25e95d913e60ea214e0d31 (patch) | |
| tree | 86f4e4f3f032ea8516a1e1965ab3ef376f83f87d /py_modules/lsfg_vk/config_schema.py | |
| parent | dd8a192075fa89606e2d4fcb96094939735da502 (diff) | |
| parent | bb0382dd2be4a548f79d6cd48b0e87fbee3cd1a2 (diff) | |
| download | decky-lsfg-vk-6489f2273fc246fcca25e95d913e60ea214e0d31.tar.gz decky-lsfg-vk-6489f2273fc246fcca25e95d913e60ea214e0d31.zip | |
Merge pull request #127 from xXJSONDeruloXx/fp16v0.10.1
feat: groundwork for fp16 feature in lsfg-vk
Diffstat (limited to 'py_modules/lsfg_vk/config_schema.py')
| -rw-r--r-- | py_modules/lsfg_vk/config_schema.py | 30 |
1 files changed, 20 insertions, 10 deletions
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: |
