DLSS becomes a player toggle: a persisted graphics setting and a live switch

The HORIZON_DLSS env gate becomes the `dlss` entry of horizon-graphics.txt
(default on), still overridable by HORIZON_DLSS=1|0. The renderer opens its
Vulkan device for DLSS at the start only while the choice is on; a failed
DLSS instance/device now keeps Vulkan and falls back to the native TAAU
instead of skipping the backend.

The evaluation itself switches live, like model-instancing: gfx::set_dlss
gates the DLSS branch of Hd::taa, and the #137 separated histories make both
directions clean (a native frame resets NGX on resume; a DLSS frame leaves
the native history unusable). The 2/3 resolution default follows the live
request AND an opened DLSS SDK, so a requested-but-unavailable DLSS never
changes the picture's scale. Off is the native TAAU, bit-identical to the
old fallback.

The `dlss on|off|status` control command and the new mod SDK imports
render.set-dlss / render.dlss-status (API level 33) drive the switch and
persist the choice; an on-switch after a start with DLSS off applies at the
next launch. The UI test guest calls the newest level's functions again
(its level assertion was stale since level 32).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
2026-11-21 14:47:37 +03:00
parent 48eff0fcbb
commit b2cc11c459
14 changed files with 266 additions and 15 deletions
+11
View File
@@ -904,6 +904,15 @@ Where a capture is.
| `file` | `string` | The result: the MP4, or the folder of the PNG sequence when no `ffmpeg` was found. Empty until `done`. |
| `message` | `string` | An error, or a note about the result (no encoder, no audio). |
### record `dlss-state`
The DLSS upscaler's state (AirDef fork, API level 33). `available`: this renderer opened a DLSS device (the `dlss` build feature on a supported Vulkan GPU, started with DLSS on). `enabled`: the player's live request — off evaluates the native TAAU from the next frame.
| Field | Type | |
| --- | --- | --- |
| `available` | `bool` | |
| `enabled` | `bool` | |
| Function | Signature | What it does |
| --- | --- | --- |
| `set-hud` | `func(shapes: list<shape>)` | Replaces the mod's HUD shapes: up to 1024, drawn every frame in order over the HUD (after the hotbar, under chat and screens), hidden with the HUD (F1). An empty list removes them. |
@@ -960,6 +969,8 @@ Where a capture is.
| `capture-stop` | `func(cancel: bool)` | Ends this mod run's capture: finishes the file, or (`cancel`) throws it away. A different mod cannot stop it. World transitions cancel mod-owned captures. |
| `capture-status` | `func() -> capture-state` | The capture's state; `done` and `failed` stay until the next start. |
| `set-film-quality` | `func(on: bool)` | Asks for the best picture the renderer can give (AirDef fork, level 17): the HD world at the full size of the window (no resolution scale, so no upscaling), and the volumetric clouds and fog marched with more steps. Meant for replays and films; false restores the player's settings. A capture turns it on for its duration. |
| `dlss-status` | `func() -> dlss-state` | Whether NVIDIA DLSS upscaling is available and on (AirDef fork, API level 33). Without `available` the renderer draws the native TAAU; an on-request then applies at the next launch, when the device is opened for DLSS. |
| `set-dlss` | `func(on: bool)` | Turns DLSS on or off (AirDef fork, API level 33), from the next frame, and persists the choice in the game's graphics settings (`horizon-graphics.txt`). On renderers without DLSS the request is kept as a graceful no-op, never an error. |
| `world-log-start` | `func() -> u32` | Starts a log of the world's block changes as the game's client sees them (AirDef fork, level 18): each change keeps its position, the state before and after, and the game tick (the number `tick` is called with). It is bounded (about a million changes): the oldest go first. Returns the log's id, which stays the same while it runs (a second call returns it). Only the world open now has it: a new world (leaving, rejoining) loses it. Not kept when the world runs in the game's own frame (`--in-frame`), where `world-log-range` stays none. |
| `world-log-stop` | `func(id: u32)` | Ends the log and forgets what it kept (a different id is ignored). |
| `world-log-range` | `func(id: u32) -> option<tuple<u64, u64>>` | What the log covers, as (the earliest tick whose world it can show, the tick it is at now); none for an unknown id, a log of another world, or one that has not been taken up yet (the tick after `world-log-start`). Asking for a time before the earliest shows the earliest. |