Triforce v0.6.0 "Sage Of Power"

Faster frames (the replay's memory work, held submits, helper threads, collection and capture cuts), the game letting old areas go (QueryMemoryInfo), the 0.5.2 stutter fixed, AMD RX 5000/6000 and integrated-GPU fixes, the GPU device chosen by name, the in-game menus and launcher reworked, controller, Linux and benchmark fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-20 17:06:21 -06:00
parent b0e46adb48
commit 6c7117635c
265 changed files with 26893 additions and 2549 deletions

View File

@@ -9,9 +9,11 @@
// read back here from the camera's uniform buffer as vk_temporal.cpp reads it;
// - the camera: the same uniform buffer and the same checks as vk_temporal.cpp's temporal_note_scene_draw; the near plane and the
// field of view are read from its projection (fsr3_math.h), so nothing in the game is hooked for them;
// - the motion: the camera's, from the scene depth with dlss_prep.comp's math (shaders/fsr3_prep.comp). #841's actor motion
// (the skinned draws drawn again with last frame's bones) is in vk_temporal.cpp, in every build since #1008; FSR 3.1
// gets it when these inputs move onto that chain.
// - the motion: the camera's, from the scene depth with dlss_prep.comp's math (shaders/fsr3_prep.comp); then, while FSR 3.1
// upscales, ((Triforce) FSR3-03) what moves by itself drawn over it with its own motion by the chain's redraws
// (vk_temporal.cpp temporal_fsr3_motion: every plain draw from the positions its vertex stage stored, or the skinned
// draws from their bones), into this file's motion image, from the camera in Frame::own. Its frame interpolation and
// the other frame generations that take this motion get it with it.
#pragma once
#include <cstdint>
@@ -29,11 +31,15 @@ namespace fsr3_inputs {
struct Frame {
VkImageView color = VK_NULL_HANDLE; ///< RGBA16F: the network's input as it samples it, 0..1
VkImageView depth = VK_NULL_HANDLE; ///< R32F, reversed (fsr3_math.h Camera::flip_depth)
VkImageView motion = VK_NULL_HANDLE; ///< RG16F, render pixels toward the frame before, x right and y down, no jitter
/// RG16F, render pixels toward the frame before, x right and y down, no jitter. ((Triforce) a colour attachment too: the
/// chain's redraws of what moves by itself draw into it, vk_temporal.cpp temporal_fsr3_motion)
VkImageView motion = VK_NULL_HANDLE;
uint32_t width = 0, height = 0;
float jitter[2]{}; ///< this frame's, in render pixels as FSR takes it (x right, y down)
fsr3_math::Camera camera;
bool reset = false; ///< no history: the first frame, a new size, or a gap of more than two frames
/// No history: the first frame, a gap of more than two frames, the frame after a present that held its frame, or a camera
/// cut (framegen_rows.h kUpscalerCut). Not another render size: the game's dynamic resolution keeps FSR's history
bool reset = false;
float frame_ms = 16.667f; ///< since the frame before's
uint64_t frame = 0; ///< texture_frame_no() when prepared
// (Triforce, for NVIDIA DLSS frame generation, vk_dlssg.cpp: the depth's and the motion's images themselves, and the
@@ -42,6 +48,22 @@ struct Frame {
float projection[16]{}; ///< view space to clip space
float clip_to_prev[16]{}; ///< this frame's clip space to the frame before's; the identity on a reset
float view[12]{}; ///< the view matrix's three rows: the camera's axes and its translation
/// ((Triforce, FSR3-03) what the chain's redraws of what moves by itself take, vk_temporal.cpp temporal_fsr3_motion: the
/// scene's camera as the game drew with it, the jitter in it, the frame before's, the reprojection fsr3_prep.comp drew the
/// camera's motion with, and the depth texture the scene was drawn with (the draws that are the scene's are told by it))
struct Own {
float current[16]{}; ///< this frame's view-projection, jittered (row major, clip = M * position)
float projection[16]{}; ///< its projection, jittered
float jitter[2]{}; ///< its jitter in clip space (nx2/oot_jitter.py)
float before[16]{}; ///< the frame before's view-projection without its jitter
float jitter_before[2]{}; ///< the frame before's jitter in clip space
float reproject[16]{}; ///< this frame's jittered clip space to the frame before's without its jitter
Texture* depth = nullptr; ///< the scene's depth texture (checked there still when prepared)
uint64_t last = 0; ///< the frame these inputs were made before this one (0: none): the history's
bool history = false; ///< the motion is from the frame before (no reset): the redraws have something to go by
} own;
/// ((Triforce, FG-4) the motion is the upscaler chain's (DLSS, FSR 4), what moves by itself drawn in it: chain_motion
bool chain_motion = false;
};
/// FSR 3.1 is asked for at all: its upscaler (the Upscaler row) or its frame interpolation (the Frame generation row). The
@@ -53,6 +75,12 @@ bool wanted();
void note_scene_draw(const Texture* color0, uint32_t width, uint32_t height, Texture* depth, uint64_t camera,
uint64_t camera_size);
/// The gameplay upscale's output size, as vk_fsr3.cpp's fsr3_upscale sees its dispatch (scene_size)
void note_output(uint32_t width, uint32_t height);
/// Whether a target of width x height can be the scene: 640x360 or more, or 1 to 3 times smaller than the output as last
/// noted (dlss_checks.h scene_size_fits, vk_temporal.cpp's temporal_scene_size rule)
bool scene_size(uint32_t width, uint32_t height);
/// The texture is this frame's scene colour (the size of the scene's camera this frame): for a network of the gameplay
/// upscale's shape that is not one of the known ones, as vk_temporal.cpp's temporal_upscale tells them apart
bool is_scene(const Texture* in);
@@ -67,13 +95,33 @@ bool prepare(VkCommandBuffer cmd, Texture* in, VkImageView in_view, Frame& out,
/// (or it is older than the frame before), so a present never interpolates with another frame's depth and motion
bool take(Frame& out);
/// ((Triforce, FG-4) prepare made this frame's inputs already (texture_frame_no), not yet taken: the upscaler chain made them
/// before the bloom, and the gameplay upscale's dispatch after it makes none again (vk_fsr3.cpp fsr3_upscale)
bool made_this_frame();
/// ((Triforce, FG-4) While NVIDIA DLSS or AMD FSR 4 upscale (vk_temporal.cpp's chain), frame generation's motion is the
/// chain's own: the camera's with what moves by itself drawn over it (the redraws from the stored positions, or the bones),
/// width x height of motion (RG16F, GENERAL, the same convention as this file's: render pixels toward the frame before, x
/// right and y down, no jitter: shaders/dlss_prep.comp and fsr3_prep.comp share the math), copied over this frame's inputs'
/// motion. Before, frame generation had the camera's alone whatever the upscaler, and Link and what moves by itself were
/// made as if they stood still. False when this frame's inputs are not there or not of that size, or RX_VK_FG_OWN_MOTION=0
bool chain_motion(VkCommandBuffer cmd, VkImage motion, uint32_t width, uint32_t height);
/// FSR 3.1's upscaler drew this frame, rw x rh into dw x dh: the host's jitter follows FSR (jitter_size)
void upscaled(uint32_t rw, uint32_t rh, uint32_t dw, uint32_t dh);
/// The scene's width (axis 0) or height (1) for the host's camera jitter while FSR 3.1's upscaler draws, 0 otherwise or
/// with RX_VK_FSR_JITTER=0; axis 2: the jitter sequence's length (dlss_jitter_phases). vk_replay.cpp's rx_option gives
/// the host this or vk_temporal.cpp's temporal_jitter_size, whichever upscaler draws
/// FSR 3.1's upscaler was to draw this frame and did not (vk_fsr3.cpp fail; the inputs' own failures but a frame without the
/// scene's camera): once that went on for more than 3 frames, jitter_size is 0 until it draws again
void missed();
/// The scene's width (axis 0) or height (1) for the host's camera jitter while FSR 3.1's upscaler draws, 0 otherwise, with
/// RX_VK_FSR_JITTER=0, 30 frames after it last drew, or after more than 3 frames it failed to draw (missed); axis 2: the
/// jitter sequence's length (fsr3_math.h jitter_phases, AMD's rule). vk_replay.cpp's rx_option gives the host this or
/// vk_temporal.cpp's temporal_jitter_size, whichever upscaler draws
uint32_t jitter_size(int axis);
/// Once a frame (vk_fsr3.cpp fsr3_idle): the colour, depth and motion images and the depth views let go once nothing has
/// asked for these inputs (wanted) for 120 frames, and what was let go earlier destroyed when no frame in flight can use it
void release_idle();
} // namespace fsr3_inputs
} // namespace mkwvk