mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-21 00:59:59 -04:00
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:
@@ -1,8 +1,11 @@
|
||||
"""Quality presets preserve the player's frame-generation choice.
|
||||
"""The Insert menu's Frame generation row (Triforce, options_version 7): one row for the renderer's own made frames, AMD FSR 4's
|
||||
and NVIDIA DLSS's, which was a row of its own (gpu/vk/merged_rows.h). Before, this checked that a Quality preset left the
|
||||
row alone; the preset is gone.
|
||||
|
||||
Compile the menu's actual preset and row handlers with small stand-ins.
|
||||
Check that the game FPS cap keeps its saved key when its label changes. No game
|
||||
or GPU is needed.
|
||||
The menu's own set_row, merged_step, merged_store, merged_sync and framegen_row_sync are compiled with small stand-ins and
|
||||
stepped as the arrows step them: the choices offered are those that run here, a DLSS value sets dlss_frame_generation and
|
||||
turns the renderer's own off, and the restart is asked for DLSS's alone. The Frame rate cap keeps its saved key. No game or
|
||||
GPU is needed.
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
@@ -39,23 +42,29 @@ FIXTURE = r"""
|
||||
#include <cctype>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "@ROOT@/gpu/vk/merged_rows.h"
|
||||
#include "@ROOT@/gpu/vk/framegen_rows.h"
|
||||
|
||||
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr, "FAIL %d: %s\n", __LINE__, #x); return 1; } } while (0)
|
||||
namespace mkwvk {
|
||||
/* OPTIONS */
|
||||
Options opts;
|
||||
/* TABS */
|
||||
/* ROW */
|
||||
namespace mr7 = merged_rows;
|
||||
/* MERGED */
|
||||
int saves = 0;
|
||||
void save() { ++saves; }
|
||||
void apply_pad_layout(int) {}
|
||||
void sync_preset_budgets(int) {}
|
||||
bool row_fixed(const int*) { return false; }
|
||||
int upscaler() { return 0; }
|
||||
unsigned upscalers_available() { return 1; }
|
||||
namespace ur {
|
||||
struct Scaling { int upscaler, resolution; };
|
||||
Scaling step_engine(int, int v, int, unsigned) { return {0, v}; }
|
||||
Scaling step_resolution(int, int v, int dir) { return {0, v + dir}; }
|
||||
int snap(int, int value) { return value; }
|
||||
int step(int, int value, int dir) { return value + dir; }
|
||||
int step_upscaler(int, int dir, unsigned) { return dir; }
|
||||
bool full_scale(int) { return false; }
|
||||
}
|
||||
namespace mr { constexpr int kMax = 8; }
|
||||
void restart_values(int*) {}
|
||||
@@ -63,46 +72,66 @@ struct { void note(const int*) {} } restart_state;
|
||||
bool can_mic() { return false; }
|
||||
void mic_chosen() {}
|
||||
int step_output_choice(int id, int dir) { return id + dir; }
|
||||
const char* tx_framegen(int) { return ""; }
|
||||
const char* hn_framegen(int, int) { return ""; }
|
||||
const char* tx_preset(int) { return ""; }
|
||||
const char* hn_preset(int, int) { return ""; }
|
||||
const char* tx_framegen_row(int) { return ""; }
|
||||
const char* hn_framegen_row(int, int) { return ""; }
|
||||
const char* tx_fps_cap(int) { return ""; }
|
||||
/* (what runs here: AMD FSR 4's frame generation, DLSS frame generation, the card's maker for Low latency) */
|
||||
bool fsr4_here = false, dlssg_here = false;
|
||||
namespace fsr4fg { bool offered_known() { return fsr4_here; } }
|
||||
bool dlssg_offered() { return dlssg_here; }
|
||||
bool renodx_built() { return true; }
|
||||
mr7::Vendor latency_vendor() { return mr7::LATENCY_AMD; }
|
||||
/* LISTS */
|
||||
/* SYNC */
|
||||
/* MERGED_FUNCTIONS */
|
||||
/* INI_KEY */
|
||||
/* STOPS */
|
||||
/* PRESET */
|
||||
/* RESTART_VALUE */
|
||||
/* SET_ROW */
|
||||
} // namespace mkwvk
|
||||
using namespace mkwvk;
|
||||
|
||||
int main() {
|
||||
Row framegen = /* FRAMEGEN_ROW */;
|
||||
Row quality = /* QUALITY_ROW */;
|
||||
Row fps_cap = /* FPS_CAP_ROW */;
|
||||
CHECK(std::strcmp(fps_cap.name, "Game frame rate cap") == 0);
|
||||
CHECK(std::strcmp(fps_cap.name, "Frame rate cap") == 0);
|
||||
CHECK(std::strcmp(ini_key(fps_cap), "frame_rate_cap") == 0);
|
||||
CHECK(std::strstr(fps_cap.help, "Generated frames are additional") != nullptr);
|
||||
CHECK(opts.framegen == 0);
|
||||
for (int previous = 0; previous <= 8; ++previous) {
|
||||
for (int preset = 0; preset <= 5; ++preset) {
|
||||
opts = Options{};
|
||||
opts.framegen = previous;
|
||||
set_row(quality, preset, 1);
|
||||
CHECK(opts.preset == preset);
|
||||
CHECK(opts.framegen == previous);
|
||||
}
|
||||
CHECK(std::strstr(fps_cap.help, "made frames come on top") != nullptr);
|
||||
CHECK(framegen.value == &merged.framegen && framegen.restart && !ini_row(framegen));
|
||||
CHECK(opts.framegen == 0 && opts.dlssg == 0);
|
||||
/* without FSR 4's and DLSS's frame generation here: Off, Auto, 2x to 8x, round */
|
||||
framegen_row_sync();
|
||||
merged_sync();
|
||||
for (int want : {1, 2, 3, 4, 5, 6, 7, 8, 0}) {
|
||||
set_row(framegen, *framegen.value + 1, 1);
|
||||
CHECK(opts.framegen == want && opts.dlssg == 0 && merged.framegen == want && restart_value_of(framegen) == 0);
|
||||
}
|
||||
CHECK(framegen.preset_exempt && !framegen.restart);
|
||||
for (int preset = 1; preset <= 5; ++preset) {
|
||||
opts = Options{};
|
||||
opts.preset = preset;
|
||||
set_row(framegen, 2, 1);
|
||||
CHECK(opts.framegen == 2 && opts.preset == preset);
|
||||
set_row(framegen, 0, -1);
|
||||
CHECK(opts.framegen == 0 && opts.preset == preset);
|
||||
/* with both: 8x, AMD FSR 4, NVIDIA DLSS 2x, 3x, 4x, then Off; DLSS's turn the renderer's own off, and take the restart */
|
||||
fsr4_here = dlssg_here = true;
|
||||
framegen_row_sync();
|
||||
opts.framegen = 8, merged_sync();
|
||||
set_row(framegen, *framegen.value + 1, 1);
|
||||
CHECK(opts.framegen == framegen_rows::FSR4 && opts.dlssg == 0);
|
||||
for (int dlss = 1; dlss <= 3; dlss++) {
|
||||
set_row(framegen, *framegen.value + 1, 1);
|
||||
CHECK(opts.dlssg == dlss && opts.framegen == 0 && merged.framegen == mr7::FG_DLSS + dlss - 1 && restart_value_of(framegen) == dlss);
|
||||
}
|
||||
CHECK(std::strstr(quality.help, "Frame generation") != nullptr);
|
||||
CHECK(std::strstr(quality.help, "stay yours") != nullptr);
|
||||
set_row(framegen, *framegen.value + 1, 1);
|
||||
CHECK(opts.dlssg == 0 && opts.framegen == 0);
|
||||
set_row(framegen, *framegen.value - 1, -1); /* (Left from Off: NVIDIA DLSS 4x) */
|
||||
CHECK(opts.dlssg == 3 && opts.framegen == 0);
|
||||
/* a saved AMD FSR 4 where its library does not run: kept until stepped, the steps from it as from 8x */
|
||||
fsr4_here = false;
|
||||
framegen_row_sync();
|
||||
opts.dlssg = 0, opts.framegen = framegen_rows::FSR4, merged_sync();
|
||||
CHECK(merged.framegen == framegen_rows::FSR4);
|
||||
set_row(framegen, *framegen.value + 1, 1);
|
||||
CHECK(opts.dlssg == 1 && opts.framegen == 0);
|
||||
opts.dlssg = 0, opts.framegen = framegen_rows::FSR4, merged_sync();
|
||||
set_row(framegen, *framegen.value - 1, -1);
|
||||
CHECK(opts.framegen == 8 && opts.dlssg == 0);
|
||||
CHECK(saves > 0);
|
||||
std::puts("PASS: quality presets preserve frame generation and its row preserves the preset");
|
||||
std::puts("PASS: the Frame generation row steps through what runs here, DLSS's values its own, and the cap keeps its key");
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -115,20 +144,35 @@ def fixture(source):
|
||||
row = re.search(r"struct Row \{.*?\n\};", menu, re.S)
|
||||
if not options or not tabs or not row:
|
||||
raise SystemExit("the menu's options, tabs, or row definition is missing")
|
||||
fps_cap = re.search(r'\{TAB_GRAPHICS, "[^"]+", &opts\.fps_cap,', menu)
|
||||
fps_cap = re.search(r'\{TAB_GRAPHICS, "Frame rate cap", &opts\.fps_cap,', menu)
|
||||
if not fps_cap:
|
||||
raise SystemExit("missing game frame rate cap row")
|
||||
raise SystemExit("missing Frame rate cap row")
|
||||
merged = menu[menu.index("struct Merged {"):menu.index("bool is_merged(const int* v)")]
|
||||
merged += menu[menu.index("bool is_merged(const int* v)"):].split("\n", 1)[0] + "\n"
|
||||
lists = menu[menu.index("int framegen_list["):menu.index("bool dlssg_offered() {")]
|
||||
# (the saved values' own rows: no tab shows them, and the merged row takes the restart for DLSS's)
|
||||
for hidden in ('{TAB_HIDDEN, "Frame generation", &opts.framegen, 0, framegen_rows::kRowMax, 1, tx_framegen, nullptr},',
|
||||
'{TAB_HIDDEN, "DLSS frame generation", &opts.dlssg, 0, 3, 1, tx_dlssg, nullptr},'):
|
||||
if hidden not in menu:
|
||||
raise SystemExit("vk_menu.cpp does not keep a merged value under its key: " + hidden)
|
||||
if '"DLSS frame generation", &opts.dlssg, 0, 3, 1, tx_dlssg,\n' in menu:
|
||||
raise SystemExit("DLSS frame generation is still a row of its own")
|
||||
replacements = {
|
||||
"/* OPTIONS */": options.group(0),
|
||||
"/* TABS */": tabs.group(0),
|
||||
"/* ROW */": row.group(0),
|
||||
"/* MERGED */": merged,
|
||||
"/* LISTS */": lists,
|
||||
"/* SYNC */": definition(menu, "void framegen_row_sync"),
|
||||
"/* MERGED_FUNCTIONS */": definition(menu, "void merged_sync") + "\n" + definition(menu, "void merged_store") + "\n" +
|
||||
definition(menu, "int merged_step"),
|
||||
"/* STOPS */": definition(menu, "bool stops_at_ends"),
|
||||
"/* INI_KEY */": definition(menu, "const char* ini_key"),
|
||||
"/* INI_KEY */": definition(menu, "const char* ini_key") + "\n" + definition(menu, "bool ini_row"),
|
||||
"/* RESTART_VALUE */": definition(menu, "int restart_value_of"),
|
||||
"/* FPS_CAP_ROW */": block(menu, fps_cap.start()),
|
||||
"/* PRESET */": definition(menu, "void apply_preset"),
|
||||
"/* SET_ROW */": definition(menu, "void set_row"),
|
||||
"/* FRAMEGEN_ROW */": block(menu, menu.index('{TAB_GRAPHICS, "Frame generation"')),
|
||||
"/* QUALITY_ROW */": block(menu, menu.index('{TAB_GRAPHICS, "Quality preset"')),
|
||||
"@ROOT@": source.as_posix(),
|
||||
}
|
||||
result = FIXTURE
|
||||
for marker, value in replacements.items():
|
||||
|
||||
Reference in New Issue
Block a user