Skip to content

Port KLBF Lab's shader preparation, presets and memory saver - #73

Merged
dazacode merged 2 commits into
mainfrom
feat/klbf-inspired-presets
Nov 29, 2026
Merged

dazacode merged 2 commits into
mainfrom
feat/klbf-inspired-presets

Conversation

@dazacode

Copy link
Copy Markdown
Owner

Ideas from KLBF Lab, rebuilt in VILauncher's own form.

What changes

Shaders prepared before Play. On builds that offer the commands, Play first runs victory shaders <shaders.rpf> once per shader translator (keyed on victory shader-fingerprint, else the program's size and time). It then runs victory warm when earlier runs recorded new pipelines. A failed step is logged and Play goes on; Stop stops it.

KLBF_ switches. KLBF_* lines in Launch options and launch scripts now reach the game, are translated as paths through the macOS/Linux runner, and are listed in problem reports. KLBF_LAUNCHER is never set or passed on: KLBF Lab v26.11.9 refuses to start from other launchers by its author's choice, and VILauncher respects that. The log now names that refusal and the launcher to use.

play.ps1 defaults fixed. A project's scripts/play.ps1 is read along its default path only: if / elseif / else are followed with every [switch] at its default. Before, both sides of if ($Safe) {…} else {…} were applied, and VICTORY_GAME_DIR = $Game was passed on as the text $Game, replacing the game folder.

Graphics presets as whole setups. Fast, Balanced and Best quality now each set the profile, scale, output and memory saver:

Preset Profile Scale Output Memory saver
Fast Series S 50% Fit screen Light
Balanced Series S 75% Fit screen Normal
Best quality Series X 100% Fit screen Normal
  • Recommended for this PC: Fast at 8 GB of VRAM or 16 GB of RAM and under, else Balanced.
  • Fit screen (16:9): a new output option, the main display's height at 16:9. Windows reads the display; macOS and Linux use 1920x1080.
  • Memory saver (Normal / Light / Very light): VIctory-LITE's low-memory switches (vix0e0e, GPL-3.0), set under both their VICTORY_ and KLBF_ names. LITE's POOL_BLOCK_MB=4 is left out, because KLBF found it crashing an RX 9070 XT. Fix and verify turns the saver on after an out-of-memory crash.
  • Existing saved settings no longer light up a preset until one is clicked, because a preset now includes the output and memory saver.

Session frame-rate report in the log after each Play: average, median, 5% and 1% lows, and the share of time in each band (60+, 30-60, 20-30, 10-20, 5-10, under 5). The first two minutes are left out.

Not ported

  • Graphics-card picker, frame-rate cap, benchmark: they exist only as KLBF_* switches, and VILauncher can't start KLBF builds.
  • Frame-rate cap through VICTORY_FRAME_INTERVAL_MS: it's experimental and changes the game's own timing.

Testing

  • pnpm ci:check passes (typecheck, translations, UI tests, vite build, cargo fmt, clippy, cargo test). New tests cover the play.ps1 reader, KLBF_ switch names, the pipeline warm decision, the 16:9 screen size, the memory saver lines, the session report, the presets and the recommendation.
  • Not tried against a real KLBF Lab or VIctory-LITE build, which needs the game files. The new Graphics rows were not checked by eye.

🤖 Generated with Claude Code

dazacode and others added 2 commits November 28, 2026 20:16
- Before Play, translate the game's shaders once per shader translator
  (`victory shaders`, keyed on `victory shader-fingerprint`) and make the
  pipelines earlier runs recorded (`victory warm`), as KLBF Lab's play.ps1 does.
- Pass KLBF_* switches from Launch options and launch scripts; never set or
  pass KLBF_LAUNCHER. Name KLBF Lab's own-launcher refusal in the log.
- Read a project's play.ps1 along its default path only: no more both sides of
  if/else, and no variable values such as `VICTORY_GAME_DIR = $Game`.
- Graphics presets set a whole setup (profile, scale, output, memory saver),
  with a recommendation for the PC, a "Fit screen (16:9)" output and a memory
  saver from VIctory-LITE (GPL-3.0). Fix and verify turns it on after an
  out-of-memory crash.
- Log a frame-rate report after each session: average, median, 5 % and 1 %
  lows and time in each band, leaving out the first two minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Play checked the game program only after the warm-up and the shader
preparation, so a damaged install spent minutes on shaders before it
said what was wrong. The check now runs right after the quick fixes.

"Fit screen" read the display with GetSystemMetrics, which gives a
scaled size in a process that is not DPI aware (--fix has no window).
It now reads the primary display's mode, which is in real pixels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dazacode
dazacode merged commit 0970109 into main Nov 29, 2026
4 checks passed
@dazacode dazacode mentioned this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant