mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-25 14:05:57 +00:00
frame_gen names the frame generator, off or fsr3 (default off), instead of 0 or 1, so later generators (FSR 4 through AMD's DLL, DLSS) become values of the same setting
vk_fg.cpp vk_fg_engine is the one place that reads the string and maps it to VkFgEngine; an unknown value is off and logged once. The setting was never released, so 0 and 1 are not kept as aliases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ea8838da9
commit
a7275e6644
4 files changed
+20
-6
No files matched your search
+1
-1
@@ -143,7 +143,7 @@ Many rows below are developer tools that only act together with another setting
|
||||
| `dyn_delta` (default `1`) | Records only the pipeline dynamic states (cull mode, depth and stencil tests, vertex input, blend enables, equations and write masks, ...) whose values changed since the last draw in the command buffer, also across pipeline changes; `0` records the full set at every change of pipeline state, as before; `ab` alternates with the `ab` blocks. | Fewer commands per pipeline change on the render and recorder threads; a driver that loses dynamic state across pipeline binds would draw with stale state. `TOTK_TRACE=perf` prints the calls and commands per submission. | Caution |
|
||||
| `feedback` | `0` samples a target that an earlier draw of the same pass wrote with no barrier; `restart` ends and restarts the pass behind a full barrier; otherwise the feedback-loop layout is used when the GPU supports it. | `0` brings back the old behaviour that the barrier fixed, so the picture can break in passes that read a target they draw into; `restart` costs extra passes. | Risky |
|
||||
| `flush_span` (default `0`) | `1` copies one span from the lowest to the highest flushed address of a pool, as an older version did. | Copies far more data to the GPU in crowded towns: an estimated 30-50 ms of GPU time per large copy over PCIe 3.0 x8. | Caution |
|
||||
| `frame_gen` (default `0`) | `1` brings up AMD FSR 3 frame interpolation and optical flow (FidelityFX SDK 1.1.4) at start; with DLSS off the replay follows the scene and records the camera motion vectors, the picture before the HUD and the interpolation of a frame between each two the game draws (`runtime/vk_fg.cpp`). Off with DLSS, `replay_workers` above 0, `sync_ahead = 1` or HDR output, and while a menu background or a loading or event fade is open. Read at start. | Work in progress: the generated frames are made but not shown (`fg_test` shows them for checks). Costs about 1.5 ms of GPU and 0.55 ms of the replay thread per frame at 1080p (RX 9070, 7900X). | Caution |
|
||||
| `frame_gen` (default `off`) | The frame generator: `off`, or `fsr3`, which brings up AMD FSR 3 frame interpolation and optical flow (FidelityFX SDK 1.1.4) at start; with DLSS off the replay follows the scene and records the camera motion vectors, the picture before the HUD and the interpolation of a frame between each two the game draws (`runtime/vk_fg.cpp`). Off with DLSS, `replay_workers` above 0, `sync_ahead = 1` or HDR output, and while a menu background or a loading or event fade is open. Read at start. | Work in progress: the generated frames are made but not shown (`fg_test` shows them for checks). Costs about 1.5 ms of GPU and 0.55 ms of the replay thread per frame at 1080p (RX 9070, 7900X). | Caution |
|
||||
| `fg_test` | Frame generation checks: `1` presents the generated frame in place of the game's, `2` the picture before the HUD. Read at start. | Shows the frames out of their order: for checks only. | Caution |
|
||||
| `fg_debug` | `1`: the generated frames hold the SDK's debug view (motion fields, optical flow, disocclusion). Read at start. | For checks only. | Caution |
|
||||
| `fg_shot` | Frame generation shots: a present number, or `w<seconds>` of world time; the window texture, the generated frame and the picture before the HUD of three frames from there go to `fg_shot_dir` as `fg_<present>_<real\|gen\|hudless>.png`. | Writes PNGs. | Safe |
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ static const CfgMeta metas[] = {
|
||||
{"PCSS", "0", "0..200", RESTART},
|
||||
// Game
|
||||
{"FPS_LIMIT", "60", "30|40|45|60|90|120|144|display", LIVE}, {"FPS60", "1", "0|1", LIVE}, {"FRAME_QUEUE", "0", "0|1", LIVE},
|
||||
{"FRAME_GEN", "0", "0|1", RESTART}, // vk_fg.cpp vk_fg_init
|
||||
{"FRAME_GEN", "off", "off|fsr3", RESTART}, // the generator; vk_fg.cpp vk_fg_engine maps it
|
||||
{"REALTIME", "1", "0|1", RESTART}, {"CLOTH_REALTIME", "1", "0|1", RESTART},
|
||||
{"MODS_REBUILD", "auto", "auto|off", RESTART},
|
||||
{"MODS_WITHOUT_CODE", "0", "0|1", RESTART}, // 1: a mod is used without the code module it cannot run (mods.c)
|
||||
|
||||
+12
-2
@@ -1,4 +1,4 @@
|
||||
// AMD FSR 3 frame generation (frame_gen = 1): the FidelityFX SDK 1.1.4's frame interpolation and optical flow
|
||||
// AMD FSR 3 frame generation (frame_gen = fsr3): the FidelityFX SDK 1.1.4's frame interpolation and optical flow
|
||||
// (third_party/FidelityFX, MIT) on its Vulkan backend, driven directly instead of through the SDK's frame
|
||||
// interpolation swapchain (Windows only, and it would own the present).
|
||||
//
|
||||
@@ -249,8 +249,18 @@ static int knob_int(const char *key) {
|
||||
return v && *v ? atoi(v) : 0;
|
||||
}
|
||||
|
||||
extern "C" VkFgEngine vk_fg_engine(void) {
|
||||
static int e = -1;
|
||||
if (e < 0) {
|
||||
const char *v = cfg_value("TOTK_FRAME_GEN");
|
||||
e = !strcmp(v, "fsr3") ? VK_FG_FSR3 : VK_FG_OFF;
|
||||
if (e == VK_FG_OFF && strcmp(v, "off")) rt_log("fg: frame_gen = %s is not off or fsr3: off", v);
|
||||
}
|
||||
return (VkFgEngine)e;
|
||||
}
|
||||
|
||||
extern "C" void vk_fg_init(void) {
|
||||
if (!cfg_bool("TOTK_FRAME_GEN")) return;
|
||||
if (vk_fg_engine() != VK_FG_FSR3) return;
|
||||
VkCtx *c = vk_ctx();
|
||||
if (!c) return;
|
||||
// The first contexts at the output size from the settings; vk_fg_prepare makes them again for the real scene
|
||||
|
||||
+6
-2
@@ -14,8 +14,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// vk_device.c, after the device exists: with TOTK_FRAME_GEN=1 (totk.ini frame_gen = 1) makes the shared backend, the
|
||||
// optical flow and the frame interpolation contexts and logs one line; otherwise does nothing.
|
||||
// The frame generator frame_gen names (TOTK_FRAME_GEN, read at start): off, or AMD FSR 3 on the FidelityFX SDK. The
|
||||
// one place that reads the string; an unknown value is off.
|
||||
typedef enum { VK_FG_OFF, VK_FG_FSR3 } VkFgEngine;
|
||||
VkFgEngine vk_fg_engine(void);
|
||||
// vk_device.c, after the device exists: with frame_gen = fsr3 makes the shared backend, the optical flow and the
|
||||
// frame interpolation contexts and logs one line; otherwise does nothing.
|
||||
void vk_fg_init(void);
|
||||
// 1 while the contexts exist.
|
||||
int vk_fg_active(void);
|
||||
|
||||
Reference in new issue
Block a user