summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api/lsfgApi.ts1
-rw-r--r--src/components/ConfigurationSection.tsx68
-rw-r--r--src/components/FlatpaksModal.tsx4
-rw-r--r--src/components/FpsMultiplierControl.tsx6
-rw-r--r--src/components/InstallationButton.tsx2
-rw-r--r--src/components/UsageInstructions.tsx2
-rw-r--r--src/config/configSchema.ts4
-rw-r--r--src/config/generatedConfigSchema.ts104
-rw-r--r--src/hooks/useLsfgHooks.ts4
9 files changed, 123 insertions, 72 deletions
diff --git a/src/api/lsfgApi.ts b/src/api/lsfgApi.ts
index 82f37c8..8378a7f 100644
--- a/src/api/lsfgApi.ts
+++ b/src/api/lsfgApi.ts
@@ -11,6 +11,7 @@ export interface InstallationResult {
export interface InstallationStatus {
installed: boolean;
+ legacy_installed?: boolean;
lib_exists: boolean;
json_exists: boolean;
script_exists: boolean;
diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx
index 0734297..7143bb1 100644
--- a/src/components/ConfigurationSection.tsx
+++ b/src/components/ConfigurationSection.tsx
@@ -1,10 +1,10 @@
-import { PanelSectionRow, ToggleField, SliderField, ButtonItem } from "@decky/ui";
+import { PanelSectionRow, ToggleField, SliderField, ButtonItem, TextField } from "@decky/ui";
import { useState, useEffect } from "react";
import { RiArrowDownSFill, RiArrowUpSFill } from "react-icons/ri";
import { ConfigurationData } from "../config/configSchema";
import {
- FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE,
- EXPERIMENTAL_PRESENT_MODE, DXVK_FRAME_RATE, DISABLE_STEAMDECK_MODE,
+ ACTIVE_IN, ALLOW_FP16, DISABLE_LSFGVK, DLL, FLOW_SCALE, GPU,
+ PERFORMANCE_MODE, DXVK_FRAME_RATE, DISABLE_STEAMDECK_MODE,
MANGOHUD_WORKAROUND, DISABLE_VKBASALT, FORCE_ENABLE_VKBASALT, ENABLE_WSI, ENABLE_ZINK
} from "../config/generatedConfigSchema";
@@ -114,6 +114,15 @@ export function ConfigurationSection({
{!configCollapsed && (
<>
<PanelSectionRow>
+ <TextField
+ label="Lossless.dll Path"
+ description="Optional full path to Lossless.dll. Leave blank for lsfg-vk automatic discovery."
+ value={config.dll}
+ onChange={(event) => onConfigChange(DLL, event.currentTarget.value)}
+ />
+ </PanelSectionRow>
+
+ <PanelSectionRow>
<SliderField
label={`Flow Scale (${Math.round(config.flow_scale * 100)}%)`}
description="Lowers internal motion estimation resolution, improving performance slightly"
@@ -126,6 +135,42 @@ export function ConfigurationSection({
</PanelSectionRow>
<PanelSectionRow>
+ <ToggleField
+ label="Disable Frame Generation"
+ description="Disables lsfg-vk on the next game launch. Requires a game restart."
+ checked={config.disable_lsfgvk}
+ onChange={(value) => onConfigChange(DISABLE_LSFGVK, value)}
+ />
+ </PanelSectionRow>
+
+ <PanelSectionRow>
+ <ToggleField
+ label="Allow FP16"
+ description="Improves performance on AMD; disable for older NVIDIA GPUs."
+ checked={config.allow_fp16}
+ onChange={(value) => onConfigChange(ALLOW_FP16, value)}
+ />
+ </PanelSectionRow>
+
+ <PanelSectionRow>
+ <TextField
+ label="GPU"
+ description="Optional GPU name, vendor:device ID, or PCI bus ID."
+ value={config.gpu}
+ onChange={(event) => onConfigChange(GPU, event.currentTarget.value)}
+ />
+ </PanelSectionRow>
+
+ <PanelSectionRow>
+ <TextField
+ label="Active In"
+ description="Executable/process names separated by commas. When set, lsfg-vk matches profiles automatically."
+ value={config.active_in}
+ onChange={(event) => onConfigChange(ACTIVE_IN, event.currentTarget.value)}
+ />
+ </PanelSectionRow>
+
+ <PanelSectionRow>
<SliderField
label={`Base FPS Cap${config.dxvk_frame_rate > 0 ? ` (${config.dxvk_frame_rate} FPS)` : " (Off)"}`}
description="Base framerate cap for DirectX games, before frame multiplier. (Requires game restart to apply)"
@@ -139,15 +184,6 @@ export function ConfigurationSection({
<PanelSectionRow>
<ToggleField
- label={`Present Mode (${(config.experimental_present_mode || "fifo") === "fifo" ? "FIFO - VSync" : "Mailbox"})`}
- description="Toggle between FIFO - VSync (default) and Mailbox presentation modes for better performance or compatibility"
- checked={(config.experimental_present_mode || "fifo") === "fifo"}
- onChange={(value) => onConfigChange(EXPERIMENTAL_PRESENT_MODE, value ? "fifo" : "mailbox")}
- />
- </PanelSectionRow>
-
- <PanelSectionRow>
- <ToggleField
label="Performance Mode"
description="Uses a lighter model for FG (Recommended for most games)"
checked={config.performance_mode}
@@ -155,14 +191,6 @@ export function ConfigurationSection({
/>
</PanelSectionRow>
- <PanelSectionRow>
- <ToggleField
- label="HDR Mode"
- description="Enables HDR mode (only for games that support HDR)"
- checked={config.hdr_mode}
- onChange={(value) => onConfigChange(HDR_MODE, value)}
- />
- </PanelSectionRow>
</>
)}
diff --git a/src/components/FlatpaksModal.tsx b/src/components/FlatpaksModal.tsx
index a80fff0..0ab715a 100644
--- a/src/components/FlatpaksModal.tsx
+++ b/src/components/FlatpaksModal.tsx
@@ -175,7 +175,7 @@ export const FlatpaksModal: FC<FlatpaksModalProps> = ({ closeModal }) => {
<PanelSectionRow>
<Field
label="Runtime 23.08"
- description={extensionStatus.installed_23_08 ? "Installed" : "Not installed"}
+ description={extensionStatus.installed_23_08 ? "Installed (manual)" : "Manual installation only; use runtime 24.08 or 25.08 when possible"}
icon={extensionStatus.installed_23_08 ? <FaCheck style={{color: 'green'}} /> : <FaTimes style={{color: 'red'}} />}
>
<ButtonItem
@@ -194,7 +194,7 @@ export const FlatpaksModal: FC<FlatpaksModalProps> = ({ closeModal }) => {
action();
}
}}
- disabled={operationInProgress === 'install-23.08' || operationInProgress === 'uninstall-23.08'}
+ disabled={!extensionStatus.installed_23_08 || operationInProgress === 'install-23.08' || operationInProgress === 'uninstall-23.08'}
>
{operationInProgress === 'install-23.08' || operationInProgress === 'uninstall-23.08' ? (
<Spinner />
diff --git a/src/components/FpsMultiplierControl.tsx b/src/components/FpsMultiplierControl.tsx
index 5ac31bb..3f559ea 100644
--- a/src/components/FpsMultiplierControl.tsx
+++ b/src/components/FpsMultiplierControl.tsx
@@ -33,8 +33,8 @@ export function FpsMultiplierControl({
padding: "5px 0px 0px 0px",
minWidth: "40px",
}}
- onClick={() => onConfigChange(MULTIPLIER, Math.max(1, config.multiplier - 1))}
- disabled={config.multiplier <= 1}
+ onClick={() => onConfigChange(MULTIPLIER, Math.max(2, config.multiplier - 1))}
+ disabled={config.multiplier <= 2}
>
</DialogButton>
@@ -49,7 +49,7 @@ export function FpsMultiplierControl({
textAlign: "center"
}}
>
- {config.multiplier < 2 ? "OFF" : `${config.multiplier}X`}
+ {`${config.multiplier}X`}
</div>
<DialogButton
style={{
diff --git a/src/components/InstallationButton.tsx b/src/components/InstallationButton.tsx
index d0f2ce5..40ba955 100644
--- a/src/components/InstallationButton.tsx
+++ b/src/components/InstallationButton.tsx
@@ -45,7 +45,7 @@ export function InstallationButton({
return (
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
<FaDownload />
- <div>Install LSFG-VK</div>
+ <div>Install / Update LSFG-VK</div>
</div>
);
};
diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx
index 5f032b8..599d02a 100644
--- a/src/components/UsageInstructions.tsx
+++ b/src/components/UsageInstructions.tsx
@@ -60,7 +60,7 @@ export function UsageInstructions() {
marginTop: "8px"
}}
>
-The configuration is stored in ~/.config/lsfg-vk/conf.toml and hot-reloads while games are running.
+The configuration is stored in ~/.config/lsfg-vk/conf.toml. Multiplier, flow scale, and performance mode hot-reload while games are running.
</div>
</PanelSectionRow>
</>
diff --git a/src/config/configSchema.ts b/src/config/configSchema.ts
index 8b4fc1e..9c4437d 100644
--- a/src/config/configSchema.ts
+++ b/src/config/configSchema.ts
@@ -6,8 +6,8 @@ export {
getFieldNames,
getDefaults,
getFieldTypes,
- DLL, NO_FP16, MULTIPLIER, FLOW_SCALE, PERFORMANCE_MODE, HDR_MODE,
- EXPERIMENTAL_PRESENT_MODE, DXVK_FRAME_RATE, ENABLE_WOW64,
+ DLL, ALLOW_FP16, MULTIPLIER, FLOW_SCALE, PERFORMANCE_MODE, PACING,
+ ACTIVE_IN, GPU, DISABLE_LSFGVK, DXVK_FRAME_RATE, ENABLE_WOW64,
DISABLE_STEAMDECK_MODE, MANGOHUD_WORKAROUND, DISABLE_VKBASALT,
FORCE_ENABLE_VKBASALT, ENABLE_WSI, ENABLE_ZINK
} from './generatedConfigSchema';
diff --git a/src/config/generatedConfigSchema.ts b/src/config/generatedConfigSchema.ts
index 3c5d34e..9b7e6d1 100644
--- a/src/config/generatedConfigSchema.ts
+++ b/src/config/generatedConfigSchema.ts
@@ -9,12 +9,14 @@ export enum ConfigFieldType {
// Field name constants for type-safe access
export const DLL = "dll" as const;
-export const NO_FP16 = "no_fp16" as const;
+export const ALLOW_FP16 = "allow_fp16" as const;
export const MULTIPLIER = "multiplier" as const;
export const FLOW_SCALE = "flow_scale" 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;
+export const PACING = "pacing" as const;
+export const ACTIVE_IN = "active_in" as const;
+export const GPU = "gpu" as const;
+export const DISABLE_LSFGVK = "disable_lsfgvk" as const;
export const DXVK_FRAME_RATE = "dxvk_frame_rate" as const;
export const ENABLE_WOW64 = "enable_wow64" as const;
export const DISABLE_STEAMDECK_MODE = "disable_steamdeck_mode" as const;
@@ -37,44 +39,56 @@ export const CONFIG_SCHEMA: Record<string, ConfigField> = {
dll: {
name: "dll",
fieldType: ConfigFieldType.STRING,
- default: "/games/Lossless Scaling/Lossless.dll",
- description: "specify where Lossless.dll is stored"
+ default: "",
+ description: "optional full path to Lossless.dll; leave blank for automatic discovery"
},
- no_fp16: {
- name: "no_fp16",
+ allow_fp16: {
+ name: "allow_fp16",
fieldType: ConfigFieldType.BOOLEAN,
- default: false,
- description: "force-disable fp16 (use on older nvidia cards)"
+ default: true,
+ description: "allow FP16 acceleration (disable on older NVIDIA GPUs)"
},
multiplier: {
name: "multiplier",
fieldType: ConfigFieldType.INTEGER,
- default: 1,
- description: "change the fps multiplier"
+ default: 2,
+ description: "frame generation multiplier"
},
flow_scale: {
name: "flow_scale",
fieldType: ConfigFieldType.FLOAT,
- default: 0.8,
- description: "change the flow scale"
+ default: 0.9,
+ description: "motion-estimation resolution scale"
},
performance_mode: {
name: "performance_mode",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "use a lighter model for FG (recommended for most games)"
+ description: "use the lighter frame-generation model"
},
- hdr_mode: {
- name: "hdr_mode",
- fieldType: ConfigFieldType.BOOLEAN,
- default: false,
- description: "enable HDR mode (only for games that support HDR)"
+ pacing: {
+ name: "pacing",
+ fieldType: ConfigFieldType.STRING,
+ default: "none",
+ description: "frame pacing mode (currently only none is supported)"
},
- experimental_present_mode: {
- name: "experimental_present_mode",
+ active_in: {
+ name: "active_in",
fieldType: ConfigFieldType.STRING,
- default: "fifo",
- description: "override Vulkan present mode (may cause crashes)"
+ default: "",
+ description: "optional executable or process names, separated by commas"
+ },
+ gpu: {
+ name: "gpu",
+ fieldType: ConfigFieldType.STRING,
+ default: "",
+ description: "optional GPU name, vendor:device ID, or PCI bus ID"
+ },
+ disable_lsfgvk: {
+ name: "disable_lsfgvk",
+ fieldType: ConfigFieldType.BOOLEAN,
+ default: false,
+ description: "disable lsfg-vk on the next game launch"
},
dxvk_frame_rate: {
name: "dxvk_frame_rate",
@@ -86,55 +100,57 @@ export const CONFIG_SCHEMA: Record<string, ConfigField> = {
name: "enable_wow64",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "enable PROTON_USE_WOW64=1 for 32-bit games (use with ProtonGE to fix crashing)"
+ description: "enable PROTON_USE_WOW64=1 for 32-bit games"
},
disable_steamdeck_mode: {
name: "disable_steamdeck_mode",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "disable Steam Deck mode (unlocks hidden settings in some games)"
+ description: "disable Steam Deck mode"
},
mangohud_workaround: {
name: "mangohud_workaround",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "Enables a transparent mangohud overlay, sometimes fixes issues with 2X multiplier in game mode"
+ description: "enable a transparent MangoHud overlay workaround"
},
disable_vkbasalt: {
name: "disable_vkbasalt",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "Disables vkBasalt layer which can conflict with LSFG (Reshade, some Decky plugins)"
+ description: "disable vkBasalt for games where it conflicts with lsfg-vk"
},
force_enable_vkbasalt: {
name: "force_enable_vkbasalt",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "Force vkBasalt to engage to fix framepacing issues in gamemode"
+ description: "force-enable vkBasalt for games that require it"
},
enable_wsi: {
name: "enable_wsi",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "Enable Gamescope WSI Layer, disable if frame generation isn't applying or isn't feeling smooth (use with HDR off)"
+ description: "enable the Gamescope WSI layer"
},
enable_zink: {
name: "enable_zink",
fieldType: ConfigFieldType.BOOLEAN,
default: false,
- description: "Enable Zink (Vulkan-based OpenGL implementation) for OpenGL games"
+ description: "enable Zink for OpenGL games"
},
};
// Type-safe configuration data structure
export interface ConfigurationData {
dll: string;
- no_fp16: boolean;
+ allow_fp16: boolean;
multiplier: number;
flow_scale: number;
performance_mode: boolean;
- hdr_mode: boolean;
- experimental_present_mode: string;
+ pacing: string;
+ active_in: string;
+ gpu: string;
+ disable_lsfgvk: boolean;
dxvk_frame_rate: number;
enable_wow64: boolean;
disable_steamdeck_mode: boolean;
@@ -152,13 +168,15 @@ export function getFieldNames(): string[] {
export function getDefaults(): ConfigurationData {
return {
- dll: "/games/Lossless Scaling/Lossless.dll",
- no_fp16: false,
- multiplier: 1,
- flow_scale: 0.8,
+ dll: "",
+ allow_fp16: true,
+ multiplier: 2,
+ flow_scale: 0.9,
performance_mode: false,
- hdr_mode: false,
- experimental_present_mode: "fifo",
+ pacing: "none",
+ active_in: "",
+ gpu: "",
+ disable_lsfgvk: false,
dxvk_frame_rate: 0,
enable_wow64: false,
disable_steamdeck_mode: false,
@@ -173,12 +191,14 @@ export function getDefaults(): ConfigurationData {
export function getFieldTypes(): Record<string, ConfigFieldType> {
return {
dll: ConfigFieldType.STRING,
- no_fp16: ConfigFieldType.BOOLEAN,
+ allow_fp16: ConfigFieldType.BOOLEAN,
multiplier: ConfigFieldType.INTEGER,
flow_scale: ConfigFieldType.FLOAT,
performance_mode: ConfigFieldType.BOOLEAN,
- hdr_mode: ConfigFieldType.BOOLEAN,
- experimental_present_mode: ConfigFieldType.STRING,
+ pacing: ConfigFieldType.STRING,
+ active_in: ConfigFieldType.STRING,
+ gpu: ConfigFieldType.STRING,
+ disable_lsfgvk: ConfigFieldType.BOOLEAN,
dxvk_frame_rate: ConfigFieldType.INTEGER,
enable_wow64: ConfigFieldType.BOOLEAN,
disable_steamdeck_mode: ConfigFieldType.BOOLEAN,
diff --git a/src/hooks/useLsfgHooks.ts b/src/hooks/useLsfgHooks.ts
index d9bbe3e..d452a9a 100644
--- a/src/hooks/useLsfgHooks.ts
+++ b/src/hooks/useLsfgHooks.ts
@@ -18,7 +18,9 @@ export function useInstallationStatus() {
const status = await checkLsfgVkInstalled();
setIsInstalled(status.installed);
if (status.installed) {
- setInstallationStatus("lsfg-vk Installed");
+ setInstallationStatus("lsfg-vk v2 Installed");
+ } else if (status.legacy_installed) {
+ setInstallationStatus("lsfg-vk v1 detected — update available");
} else {
setInstallationStatus("lsfg-vk Not Installed");
}