mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-21 00:59:59 -04:00
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.
917 lines
57 KiB
Python
917 lines
57 KiB
Python
"""(Triforce) The Frame generation row's AMD FSR 4 and AMD's frame generation library behind it. No game, no GPU, none
|
|
of AMD's files: AMD's library is a stand-in that notes every call it gets.
|
|
|
|
1. gpu/vk/framegen_rows.h, compiled and run: the row's last value by what a build and a card support, the values from before
|
|
(0 Off, 1 Auto, 2 to 8) meaning what they did, the version taken from AMD's list (FSR 4's where listed, else FSR 3.1's, as
|
|
an RX 7900 XT has alone; FSR 4's alone with RX_VK_FSR4_FG=4) and the row's name for it, RX_VK_FRAMEGEN_MULT's range, the
|
|
game's frame alone without a picture without the HUD and where that picture is cut, the camera cut, when a context still
|
|
fits and when it is let go, and the order it is taken down in.
|
|
2. gpu/vk/vk_menu.cpp's own tx_framegen and hn_framegen_fsr4, cut out and run: the names an options file's values show,
|
|
a saved AMD FSR 4 where it cannot run, and that the row's table, its end and the menu's opening are wired to them.
|
|
3. gpu/vk/vk_fsr4.cpp's frame generation section (fsr4fg), cut out and run against the stand-in library (Windows, with
|
|
the Vulkan headers): where it is offered (AMD's file beside the loader, an FSR 4 frame generation in AMD's list, the
|
|
switches, not beside NVIDIA's), the context's descriptions (the API's version, the device, the version asked for by
|
|
its id), each frame's calls in AMD's order for a frame id that goes up by one, the first frame, a gap and a camera cut
|
|
as a new history without a made frame, another size, a failure, the row left for a while, and the exit: what is
|
|
destroyed, in which order, and that nothing of AMD's is called after the exit or a failure.
|
|
4. The source: vk_framegen.cpp hands the frame over and falls back, the inputs are gathered for it, the present's tick and
|
|
the exit reach it, the build has the stubs, the rows are documented.
|
|
|
|
python -I -B tests/test_framegen_fsr4.py [--cxx g++] [--headers path/to/Vulkan-Headers/include]
|
|
"""
|
|
import argparse
|
|
import os
|
|
import re
|
|
import subprocess
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
RUN_ALL_ARGS = ["--cxx", "{cxx}", "--headers", "{vulkan_headers}"]
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
VK = ROOT / "gpu" / "vk"
|
|
|
|
|
|
def function(source, start):
|
|
"""A definition from its first line to its closing brace at the start of a line"""
|
|
at = source.find(start)
|
|
if at < 0:
|
|
raise SystemExit("%s is missing" % start.rstrip(" {("))
|
|
body = source[at:]
|
|
return body[:body.index("\n}\n") + 3]
|
|
|
|
|
|
def between(source, start, end):
|
|
a = source.find(start)
|
|
b = source.find(end, a + 1)
|
|
if a < 0 or b < 0:
|
|
raise SystemExit("not found: %r ... %r" % (start[:50], end[:50]))
|
|
return source[a:b]
|
|
|
|
|
|
def build_and_run(cxx, tmp, name, text, flags=(), runs=((),), env=None):
|
|
cpp, exe = Path(tmp) / (name + ".cpp"), Path(tmp) / (name + (".exe" if os.name == "nt" else ""))
|
|
cpp.write_text(text, encoding="utf-8")
|
|
subprocess.run([cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", "-Wno-missing-field-initializers", *flags, str(cpp),
|
|
"-o", str(exe)], check=True)
|
|
for args in runs:
|
|
subprocess.run([str(exe), *args], check=True, timeout=60, env=env)
|
|
|
|
|
|
CHECK = r'''
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr, "FAIL:%d %s\n", __LINE__, #x); std::exit(1); } } while (0)
|
|
'''
|
|
|
|
ROWS = CHECK + r'''
|
|
#include <algorithm>
|
|
#include <cstring>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "framegen_rows.h"
|
|
using namespace mkwvk::framegen_rows;
|
|
|
|
struct Ops {
|
|
std::vector<std::string> did;
|
|
void stop() { did.push_back("stop"); }
|
|
void wait_gpu() { did.push_back("wait_gpu"); }
|
|
void destroy_context() { did.push_back("destroy_context"); }
|
|
void destroy_images() { did.push_back("destroy_images"); }
|
|
};
|
|
|
|
int main() {
|
|
// the row: AMD FSR 4 is its last value where it is offered, 8x where it is not (the row as it was)
|
|
CHECK(FSR4 == 9 && kRowMax == 9 && OFF == 0 && AUTO == 1 && kMaxMult == 8);
|
|
CHECK(row_hi(true) == 9 && row_hi(false) == 8);
|
|
// an options file from before: 0 to 8 show and run as they did, whatever the card
|
|
for (int v = 0; v <= 8; v++)
|
|
for (int ok = 0; ok < 2; ok++) {
|
|
CHECK(shown(v, ok != 0) == v);
|
|
for (int cap = 2; cap <= 4; cap++) CHECK(multiplier(v, cap) == (v == 1 ? cap : std::clamp(v, 1, 8))); // (vk_framegen.cpp's rule from before)
|
|
for (int w = 0; w < FG_WHY_COUNT; w++) CHECK(!fsr4_asked(v, (Why)w, false));
|
|
}
|
|
// the new value: itself where AMD's library can make the frames, 2x by the renderer's own where it cannot
|
|
CHECK(shown(9, true) == 9 && shown(9, false) == 2);
|
|
CHECK(multiplier(9, 2) == 2 && multiplier(9, 4) == 2);
|
|
CHECK(fsr4_asked(9, FG_OK, false));
|
|
CHECK(!fsr4_asked(9, FG_OK, true)); // (not beside NVIDIA DLSS frame generation)
|
|
for (int w = 1; w < FG_WHY_COUNT; w++) CHECK(!fsr4_asked(9, (Why)w, false));
|
|
CHECK(multiplier(-3, 2) == 1 && multiplier(12, 2) == 8); // (a value outside the row)
|
|
|
|
// AMD's list: the newest, the first of equal ones: FSR 4's where it is listed, else ((Triforce, FG-1)) FSR 3.1's, which
|
|
// RX 6000 and 7000 have alone (3.1.6 on the owner's RX 7900 XT); only_fsr4 (RX_VK_FSR4_FG=4): 4.x or nothing, as before
|
|
unsigned v[3];
|
|
CHECK(parse_version("4.0.2", v) && v[0] == 4 && v[1] == 0 && v[2] == 2);
|
|
CHECK(parse_version("4.1.0*", v) && v[1] == 1); // (a version the graphics driver brings)
|
|
CHECK(!parse_version("FSR", v) && !parse_version(nullptr, v) && !parse_version("4.0", v));
|
|
{ const char* n[] = {"4.0.2", "3.1.6"}; CHECK(pick_version(n, 2, false) == 0 && pick_version(n, 2, true) == 0); }
|
|
{ const char* n[] = {"3.1.6", "4.0.0", "4.0.2*", "4.0.2", "4.0.1"}; CHECK(pick_version(n, 5, false) == 2); }
|
|
{ const char* n[] = {"3.1.6", "3.1.4"}; CHECK(pick_version(n, 2, false) == 0); CHECK(pick_version(n, 2, true) == -1); }
|
|
{ const char* n[] = {"3.1.4", "3.1.6"}; CHECK(pick_version(n, 2, false) == 1); } // (the newest 3.1)
|
|
{ const char* n[] = {"3.1.6"}; CHECK(pick_version(n, 1, false) == 0); } // (an RX 7900 XT's whole list)
|
|
{ const char* n[] = {"3.1.6", "4.0.2"}; CHECK(pick_version(n, 2, false) == 1); } // (FSR 4's first wherever it is listed)
|
|
{ const char* n[] = {nullptr, "?", "5.0.0"}; CHECK(pick_version(n, 3, true) == -1); CHECK(pick_version(n, 3, false) == 2); }
|
|
{ const char* n[] = {nullptr, "?"}; CHECK(pick_version(n, 2, false) == -1); } // (nothing it can read)
|
|
CHECK(pick_version(nullptr, 0, false) == -1);
|
|
// each reason it is not used has words for the log
|
|
for (int w = 0; w < FG_WHY_COUNT; w++) CHECK(why_name((Why)w) && *why_name((Why)w) && std::strcmp(why_name((Why)w), "?"));
|
|
// the row's name for it, by the version in use
|
|
char label[32];
|
|
CHECK(!std::strcmp(row_label(label, sizeof label, "3.1.6"), "AMD FSR (3.1.6)"));
|
|
CHECK(!std::strcmp(row_label(label, sizeof label, "4.0.2*"), "AMD FSR (4.0.2)")); // (the driver's star is not shown)
|
|
CHECK(!std::strcmp(row_label(label, sizeof label, ""), "AMD FSR") && !std::strcmp(row_label(label, sizeof label, nullptr), "AMD FSR"));
|
|
CHECK(!std::strcmp(row_label(label, 8, "3.1.6"), "AMD FSR")); // (cut to what fits, never past the buffer)
|
|
// ((Triforce, FG-9) RX_VK_FRAMEGEN_MULT: the row's whole range, AMD's 9 among it; not a number, 2 as before
|
|
CHECK(env_row("9") == 9 && env_row("0") == 0 && env_row("1") == 1 && env_row("5") == 5);
|
|
CHECK(env_row("12") == 9 && env_row("-3") == 0 && env_row("x") == 2 && env_row("") == 2 && env_row(nullptr) == 2);
|
|
// ((Triforce, FG-2) the game's frame alone: a new history, or no picture without the HUD (HDR Native first)
|
|
CHECK(game_frame_alone(SKIP) && game_frame_alone(GAME) && !game_frame_alone(MADE) && !game_frame_alone(OWN));
|
|
for (int scene = 0; scene < 2; scene++)
|
|
for (int hl = 0; hl < 2; hl++) CHECK(held_for(true, scene != 0, hl != 0) == HELD_HDR_NATIVE);
|
|
CHECK(held_for(false, true, true) == HELD_HDR_SCENE && held_for(false, true, false) == HELD_HDR_SCENE);
|
|
CHECK(held_for(false, false, false) == HELD_NO_HUDLESS && held_for(false, false, true) == HELD_NONE);
|
|
// ((Triforce) HDR Native and RenoDX's RGBA16F scene hold for every present: the renderer's own makes the frame, as a saved
|
|
// 9 ran on an RX 6000 or 7000 before (shown(9, false) == 2); only a frame missing its picture without the HUD is the game's
|
|
// frame alone
|
|
CHECK(held_whole_run(HELD_HDR_NATIVE) && held_whole_run(HELD_HDR_SCENE));
|
|
CHECK(!held_whole_run(HELD_NO_HUDLESS) && !held_whole_run(HELD_NONE));
|
|
CHECK(held_made(HELD_HDR_NATIVE) == OWN && held_made(HELD_HDR_SCENE) == OWN && held_made(HELD_NO_HUDLESS) == GAME);
|
|
CHECK(!game_frame_alone(held_made(HELD_HDR_NATIVE)) && !game_frame_alone(held_made(HELD_HDR_SCENE)));
|
|
// the picture without the HUD, cut as the present is: the same rect at the same size, scaled at another
|
|
SourceRect r = hudless_source(3416, 1440, 3416, 1440, 0, 0, 3416, 1440);
|
|
CHECK(r.x0 == 0 && r.y0 == 0 && r.x1 == 3416 && r.y1 == 1440);
|
|
r = hudless_source(2560, 1440, 2560, 1440, 160, 90, 2240, 1260);
|
|
CHECK(r.x0 == 160 && r.y0 == 90 && r.x1 == 2400 && r.y1 == 1350);
|
|
r = hudless_source(1280, 720, 2560, 1440, 160, 90, 2240, 1260); // (an output half the window texture's size)
|
|
CHECK(r.x0 == 80 && r.y0 == 45 && r.x1 == 1200 && r.y1 == 675);
|
|
r = hudless_source(2560, 1440, 2560, 1440, 2500, 1400, 100, 100); // (clipped to the picture)
|
|
CHECK(r.x0 == 2500 && r.y0 == 1400 && r.x1 == 2560 && r.y1 == 1440);
|
|
r = hudless_source(0, 1440, 2560, 1440, 0, 0, 2560, 1440);
|
|
CHECK(r.x1 == 0 && r.y1 == 0);
|
|
r = hudless_source(2560, 1440, 2560, 1440, 2560, 0, 10, 10);
|
|
CHECK(r.x1 == 0);
|
|
r = hudless_source(2, 2, 2560, 1440, 0, 0, 1, 1); // (nothing of a pixel left: none)
|
|
CHECK(r.x1 == 0 && r.y1 == 0);
|
|
|
|
// the camera: the view matrix's rows are its axes, the position -R^T t
|
|
const float still[12] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0};
|
|
Pose a = pose_of(still);
|
|
CHECK(a.pos[0] == 0 && a.pos[1] == 0 && a.pos[2] == 0 && a.fwd[2] == -1 && a.up[1] == 1 && a.right[0] == 1);
|
|
const float moved[12] = {1, 0, 0, -3, 0, 1, 0, -4, 0, 0, 1, 12}; // (the camera at 3, 4, -12)
|
|
Pose b = pose_of(moved);
|
|
CHECK(b.pos[0] == 3 && b.pos[1] == 4 && b.pos[2] == -12);
|
|
const float turned[12] = {0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0}; // (a quarter turn about the up axis)
|
|
CHECK(std::fabs(pose_of(turned).fwd[0] + 1.0f) < 1e-6f);
|
|
// a cut: over 5 units, or over 10 degrees with over half a unit, for each 60th of a second
|
|
auto at = [](float x, float deg) {
|
|
Pose p;
|
|
p.pos[0] = x;
|
|
p.fwd[0] = std::sin(deg * 0.01745329252f), p.fwd[2] = -std::cos(deg * 0.01745329252f);
|
|
return p;
|
|
};
|
|
CHECK(!camera_cut(at(0, 0), at(0.05f, 0.08f), 16.667f)); // (play: NX2navi's medians)
|
|
CHECK(!camera_cut(at(0, 0), at(4.9f, 0), 16.667f));
|
|
CHECK(camera_cut(at(0, 0), at(5.1f, 0), 16.667f)); // (an area load)
|
|
CHECK(!camera_cut(at(0, 0), at(0.4f, 45), 16.667f)); // (a fast turn in place is no cut)
|
|
CHECK(camera_cut(at(0, 0), at(0.6f, 12), 16.667f));
|
|
CHECK(!camera_cut(at(0, 0), at(0.6f, 8), 16.667f));
|
|
CHECK(!camera_cut(at(0, 0), at(9.0f, 0), 33.333f)); // (a 30 fps frame may move twice as far)
|
|
CHECK(camera_cut(at(0, 0), at(11.0f, 0), 33.333f));
|
|
CHECK(camera_cut(at(0, 0), at(21.0f, 0), 500.0f) && !camera_cut(at(0, 0), at(19.0f, 0), 500.0f)); // (four times at the most)
|
|
CHECK(camera_cut(at(0, 0), at(5.1f, 0), 4.0f) && camera_cut(at(0, 0), at(5.1f, 0), 0.0f)); // (never less than one 60th's)
|
|
Pose none; // (no camera: nothing to compare, a new history)
|
|
CHECK(camera_cut(none, at(0, 0), 16.667f) && camera_cut(at(0, 0), at(NAN, 0), 16.667f));
|
|
|
|
// a context: for one picture size and one kind of depth, any scene up to the picture's size
|
|
const ContextKey k = context_for(2560, 1440, 1920, 1080, true);
|
|
CHECK(k.width == 2560 && k.height == 1440 && k.max_render_width == 2560 && k.max_render_height == 1440 && k.infinite_depth);
|
|
CHECK(context_fits(k, 2560, 1440, 1920, 1080, true) && context_fits(k, 2560, 1440, 2560, 1440, true));
|
|
CHECK(context_fits(k, 2560, 1440, 1280, 720, true)); // (the game's dynamic resolution)
|
|
CHECK(!context_fits(k, 1920, 1080, 1920, 1080, true) && !context_fits(k, 2560, 1440, 1920, 1080, false));
|
|
CHECK(!context_fits(k, 2560, 1440, 2561, 1440, true));
|
|
const ContextKey big = context_for(1280, 720, 1920, 1080, false); // (a scene larger than the picture still gets one)
|
|
CHECK(big.max_render_width == 1920 && big.max_render_height == 1080 && context_fits(big, 1280, 720, 1920, 1080, false));
|
|
|
|
// let go: 120 presents after the row left it, 2 after a failure, never at the present of its last frame
|
|
CHECK(!release_due(false, false, 500, 0) && !release_due(false, true, 500, 0));
|
|
CHECK(!release_due(true, false, 100, 100) && !release_due(true, false, 219, 100) && release_due(true, false, 220, 100));
|
|
CHECK(!release_due(true, true, 100, 100) && !release_due(true, true, 101, 100) && release_due(true, true, 102, 100));
|
|
CHECK(!release_due(true, true, 99, 100));
|
|
|
|
// taken down in play: no new call, the GPU past its work, AMD's context, then the image it wrote; at the exit only the first
|
|
Ops play, exit;
|
|
teardown(play, false);
|
|
CHECK((play.did == std::vector<std::string>{"stop", "wait_gpu", "destroy_context", "destroy_images"}));
|
|
teardown(exit, true);
|
|
CHECK((exit.did == std::vector<std::string>{"stop"}));
|
|
std::puts("PASS: the Frame generation row's AMD FSR, AMD's version list, its name, the env pin, the picture without the HUD's "
|
|
"rules, camera cuts, context life and teardown order");
|
|
}
|
|
'''
|
|
|
|
MENU = CHECK + r'''
|
|
#include <algorithm>
|
|
#include <cstring>
|
|
#include "framegen_rows.h"
|
|
namespace framegen_rows = mkwvk::framegen_rows;
|
|
namespace fsr4fg {
|
|
framegen_rows::Why now = framegen_rows::FG_OK;
|
|
const char* in_use = "3.1.6";
|
|
framegen_rows::Why why() { return now; }
|
|
bool offered() { return why() == framegen_rows::FG_OK; }
|
|
framegen_rows::Why why_known() { return now; } // ((Triforce) the menu's rows read the answer as known)
|
|
bool offered_known() { return why_known() == framegen_rows::FG_OK; }
|
|
const char* version() { return now == framegen_rows::FG_OK ? in_use : ""; }
|
|
// ((Triforce) what holds AMD's library from every present: HDR Native's picture (present_native_pq), RenoDX's RGBA16F scene
|
|
framegen_rows::Held held_now = framegen_rows::HELD_NONE;
|
|
framegen_rows::Held held() { return held_now; }
|
|
}
|
|
struct { int hdr = 0; } opts; // ((Triforce, FG-5) the HDR row: 2 Native, which alone is no pause (no HDR display, say)
|
|
/* TX */
|
|
/* HN */
|
|
int main() {
|
|
static const char* const before[] = {"Off", "Auto", "2x", "3x", "4x", "5x", "6x", "7x", "8x"};
|
|
static const framegen_rows::Held holds[] = {framegen_rows::HELD_NONE, framegen_rows::HELD_NO_HUDLESS, framegen_rows::HELD_HDR_NATIVE,
|
|
framegen_rows::HELD_HDR_SCENE};
|
|
for (int hdr = 0; hdr <= 2; hdr++)
|
|
for (framegen_rows::Held held : holds)
|
|
for (int w = 0; w < framegen_rows::FG_WHY_COUNT; w++) {
|
|
fsr4fg::now = (framegen_rows::Why)w;
|
|
fsr4fg::held_now = held;
|
|
opts.hdr = hdr;
|
|
const bool paused = framegen_rows::held_whole_run(held); // (HDR Native's picture, or RenoDX's scene, in any HDR mode)
|
|
for (int v = 0; v <= 8; v++) CHECK(!std::strcmp(tx_framegen(v), before[v])); // (an options file from before)
|
|
// (a saved choice shows what runs: AMD's, by the version AMD's library makes the frames with, or 2x)
|
|
CHECK(!std::strcmp(tx_framegen(9), w == framegen_rows::FG_OK ? "AMD FSR (3.1.6)" : "2x"));
|
|
const char* line = hn_framegen_fsr4(-1);
|
|
CHECK(line && *line);
|
|
CHECK((std::strstr(line, "AMD's frame generation library (its version") != nullptr) == (w == framegen_rows::FG_OK && !paused));
|
|
CHECK((std::strstr(line, "Paused with HDR Native or RenoDX") != nullptr) == (w == framegen_rows::FG_OK && paused));
|
|
// (paused, the frame is still made: by the renderer's own, as a saved 9 ran on a card without AMD's)
|
|
if (w == framegen_rows::FG_OK && paused) CHECK(std::strstr(line, "renderer's own makes the one frame, as at 2x"));
|
|
if (w != framegen_rows::FG_OK && w != framegen_rows::FG_NOT_YET) CHECK(std::strstr(line, "the renderer's own makes"));
|
|
bool listed = false; // (the menu measures every line a value can show: the one shown now is among them)
|
|
int k = 0;
|
|
for (; const char* t = hn_framegen_fsr4(k); k++) listed |= t == line;
|
|
CHECK(listed && k == framegen_rows::FG_WHY_COUNT + 1);
|
|
}
|
|
fsr4fg::now = framegen_rows::FG_OK, fsr4fg::in_use = "4.0.2";
|
|
CHECK(!std::strcmp(tx_framegen(9), "AMD FSR (4.0.2)")); // (an RX 9000's)
|
|
fsr4fg::in_use = "";
|
|
CHECK(!std::strcmp(tx_framegen(9), "AMD FSR")); // (offered, its version not read)
|
|
// (said to the player: the HUD is kept out of what is moved, and HDR Native pauses it)
|
|
CHECK(std::strstr(hn_framegen_fsr4(0), "HUD kept where the game drew it"));
|
|
CHECK(std::strstr(hn_framegen_fsr4(framegen_rows::FG_WHY_COUNT), "HDR Native") && !hn_framegen_fsr4(framegen_rows::FG_WHY_COUNT + 1));
|
|
std::puts("PASS: the row's names for an options file's values, AMD's by its version, what a saved AMD FSR shows where it "
|
|
"cannot run, and its pause with HDR Native or RenoDX's scene");
|
|
}
|
|
'''
|
|
|
|
FG = CHECK + r'''
|
|
#define NOMINMAX
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#define VK_NO_PROTOTYPES
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#include <atomic>
|
|
#include <cfloat>
|
|
#include <chrono>
|
|
#include <cmath>
|
|
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
#include <map>
|
|
#include <mutex>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "api/include/ffx_api.h"
|
|
#include "api/include/ffx_api_types.h"
|
|
#include "api/include/vk/ffx_api_vk.h"
|
|
#include "framegeneration/include/ffx_framegeneration.h"
|
|
#include "framegen_rows.h"
|
|
|
|
typedef struct VmaAllocation_T* VmaAllocation;
|
|
|
|
// ---- what the section takes from the renderer and from the rest of vk_fsr4.cpp: stand-ins that note what they are asked ----
|
|
static std::vector<std::string> events;
|
|
static std::vector<std::string> logged;
|
|
static void ev(const char* fmt, ...) {
|
|
char b[256];
|
|
va_list ap;
|
|
va_start(ap, fmt);
|
|
vsnprintf(b, sizeof b, fmt, ap);
|
|
va_end(ap);
|
|
events.push_back(b);
|
|
}
|
|
static bool has_log(const char* part) {
|
|
for (const std::string& l : logged)
|
|
if (l.find(part) != std::string::npos) return true;
|
|
return false;
|
|
}
|
|
namespace mkwvk {
|
|
void logf(const char* fmt, ...) {
|
|
char b[1024];
|
|
va_list ap;
|
|
va_start(ap, fmt);
|
|
vsnprintf(b, sizeof b, fmt, ap);
|
|
va_end(ap);
|
|
logged.push_back(b);
|
|
}
|
|
static std::map<std::string, int> env;
|
|
int env_switch(const char* name) {
|
|
const auto it = env.find(name);
|
|
return it == env.end() ? -1 : it->second;
|
|
}
|
|
struct Device {
|
|
VkDevice device = (VkDevice)(uintptr_t)0x11;
|
|
bool offscreen = false;
|
|
std::mutex present_mu;
|
|
} dev;
|
|
static int idle_waits;
|
|
void device_wait_idle_locked() { idle_waits++, events.push_back("wait_gpu"); }
|
|
static bool image_fails;
|
|
static int images_live;
|
|
static VkImage last_image;
|
|
static VkImageUsageFlags last_image_usage;
|
|
bool create_image(const VkImageCreateInfo& ci, VkImage& image, VmaAllocation& allocation, bool = false, bool = false, bool = false) {
|
|
if (image_fails) return false;
|
|
static uintptr_t next = 0x1000;
|
|
image = last_image = (VkImage)(next += 0x10), allocation = (VmaAllocation)(next + 1);
|
|
last_image_usage = ci.usage;
|
|
CHECK(ci.format == VK_FORMAT_R8G8B8A8_UNORM);
|
|
images_live++, ev("create_image %ux%u", ci.extent.width, ci.extent.height);
|
|
return true;
|
|
}
|
|
void destroy_image(VkImage image, VmaAllocation) {
|
|
CHECK(image != VK_NULL_HANDLE);
|
|
images_live--, events.push_back("destroy_image");
|
|
}
|
|
void full_barrier(VkCommandBuffer, const char* = "") {}
|
|
void note_work(VkCommandBuffer) {} // ((Triforce, P4) cmd_work.h's: counted in the command buffer)
|
|
namespace rec {
|
|
enum { B_DIRECT };
|
|
void boundary(int) {}
|
|
}
|
|
struct {
|
|
int framegen = 9;
|
|
} opts;
|
|
namespace dlssg {
|
|
static bool on;
|
|
bool active() { return on; }
|
|
}
|
|
VkImageMemoryBarrier2 barrier(VkImage image, VkAccessFlags2, VkAccessFlags2, VkImageLayout from, VkImageLayout to) {
|
|
VkImageMemoryBarrier2 b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2};
|
|
b.image = image, b.oldLayout = from, b.newLayout = to;
|
|
return b;
|
|
}
|
|
void barriers(VkCommandBuffer, const VkImageMemoryBarrier2* b, uint32_t n) {
|
|
CHECK(n == 1 && b->image == last_image && b->oldLayout == VK_IMAGE_LAYOUT_UNDEFINED && b->newLayout == VK_IMAGE_LAYOUT_GENERAL);
|
|
events.push_back("image to GENERAL");
|
|
}
|
|
constexpr const char* kLoader = "amd_fidelityfx_loader_vk.dll";
|
|
struct Library {
|
|
std::mutex mu;
|
|
std::string dir;
|
|
PfnFfxCreateContext create = nullptr;
|
|
PfnFfxDestroyContext destroy = nullptr;
|
|
PfnFfxConfigure configure = nullptr;
|
|
PfnFfxQuery query = nullptr;
|
|
PfnFfxDispatch dispatch = nullptr;
|
|
VkDeviceContext device_context{};
|
|
};
|
|
Library& lib() {
|
|
static Library l;
|
|
return l;
|
|
}
|
|
static bool library_there = true;
|
|
static int library_loads;
|
|
bool load_library(Library&) { return library_loads++, library_there; }
|
|
|
|
namespace fsr4fg {
|
|
/* INPUTS */
|
|
framegen_rows::Why why();
|
|
inline bool offered() { return why() == framegen_rows::FG_OK; } // (as vk_fsr4.h has it)
|
|
framegen_rows::Why why_known();
|
|
inline bool offered_known() { return why_known() == framegen_rows::FG_OK; }
|
|
// ((Triforce) vk_fsr4.cpp's held(), outside the section: HDR Native's picture or RenoDX's RGBA16F scene, set by a scene
|
|
static framegen_rows::Held held_now = framegen_rows::HELD_NONE;
|
|
framegen_rows::Held held() { return held_now; }
|
|
}
|
|
/* SECTION */
|
|
} // namespace mkwvk
|
|
|
|
using namespace mkwvk;
|
|
namespace fgr = mkwvk::framegen_rows;
|
|
|
|
// ---- AMD's library: a stand-in that checks what it is given and notes the calls ----
|
|
static std::vector<const char*> listed = {"4.0.2", "3.1.6"};
|
|
static const uint64_t kIds[] = {0x402, 0x316, 0x999};
|
|
static int amd_calls, contexts_live, contexts_made;
|
|
static bool create_fails;
|
|
static int fail_dispatch; // (0 none, 1 the preparation, 2 the generation)
|
|
static bool fail_configure;
|
|
static uint64_t chosen_id;
|
|
static VkCommandBuffer const kCmd = (VkCommandBuffer)(uintptr_t)0x77;
|
|
static VkImage const kColor = (VkImage)(uintptr_t)0xC0, kDepth = (VkImage)(uintptr_t)0xD0, kMotion = (VkImage)(uintptr_t)0xE0;
|
|
static VkImage const kHudless = (VkImage)(uintptr_t)0xF0; // ((Triforce, FG-2) the picture without the HUD)
|
|
static uint64_t last_id;
|
|
static uint32_t made_w, made_h, made_rw, made_rh, made_flags;
|
|
|
|
static ffxReturnCode_t amd_query(ffxContext* context, ffxQueryDescHeader* d) {
|
|
amd_calls++;
|
|
if (d->type == FFX_API_QUERY_DESC_TYPE_GET_VERSIONS) {
|
|
auto* q = (ffxQueryDescGetVersions*)d;
|
|
CHECK(!context && q->createDescType == FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION); // (frame generation's list, not the upscaler's)
|
|
CHECK(q->device == &lib().device_context && q->outputCount);
|
|
if (!q->versionIds && !q->versionNames) return *q->outputCount = listed.size(), FFX_API_RETURN_OK;
|
|
CHECK(*q->outputCount >= listed.size());
|
|
for (size_t i = 0; i < listed.size(); i++) q->versionIds[i] = kIds[i], q->versionNames[i] = listed[i];
|
|
return *q->outputCount = listed.size(), FFX_API_RETURN_OK;
|
|
}
|
|
CHECK(context && *context);
|
|
if (d->type == FFX_API_QUERY_DESC_TYPE_FRAMEGENERATION_GPU_MEMORY_USAGE)
|
|
return ((ffxQueryDescFrameGenerationGetGPUMemoryUsage*)d)->gpuMemoryUsageFrameGeneration->totalUsageInBytes = 300ull << 20, FFX_API_RETURN_OK;
|
|
if (d->type == FFX_API_QUERY_DESC_TYPE_GET_PROVIDER_VERSION) return ((ffxQueryGetProviderVersion*)d)->versionName = "4.0.2", FFX_API_RETURN_OK;
|
|
return 1;
|
|
}
|
|
static ffxReturnCode_t amd_create(ffxContext* context, ffxCreateContextDescHeader* d, const ffxAllocationCallbacks*) {
|
|
amd_calls++;
|
|
CHECK(d->type == FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION);
|
|
const auto* c = (const ffxCreateContextDescFrameGeneration*)d;
|
|
bool api = false, backend = false, pin = false, hudless = false;
|
|
for (const ffxApiHeader* h = d->pNext; h; h = h->pNext) {
|
|
if (h->type == FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_VERSION)
|
|
api = ((const ffxCreateContextDescFrameGenerationVersion*)h)->version == FFX_FRAMEGENERATION_VERSION;
|
|
if (h->type == FFX_API_CREATE_CONTEXT_DESC_TYPE_BACKEND_VK)
|
|
backend = ((const ffxCreateBackendVKDesc*)h)->deviceContext.vkDevice == lib().device_context.vkDevice;
|
|
if (h->type == FFX_API_DESC_TYPE_OVERRIDE_VERSION) pin = ((const ffxOverrideVersion*)h)->versionId == chosen_id;
|
|
if (h->type == FFX_API_CREATE_CONTEXT_DESC_TYPE_FRAMEGENERATION_HUDLESS) // ((Triforce, FG-2) its format, the picture's)
|
|
hudless = ((const ffxCreateContextDescFrameGenerationHudless*)h)->hudlessBackBufferFormat ==
|
|
ffxApiGetSurfaceFormatVK(VK_FORMAT_R8G8B8A8_UNORM);
|
|
}
|
|
CHECK(api && backend && pin && hudless); // (the API's version, the device, the version asked for by its id, the HUD-less format)
|
|
CHECK(c->backBufferFormat == ffxApiGetSurfaceFormatVK(VK_FORMAT_R8G8B8A8_UNORM));
|
|
CHECK(c->flags & FFX_FRAMEGENERATION_ENABLE_DEPTH_INVERTED);
|
|
CHECK(!(c->flags & (FFX_FRAMEGENERATION_ENABLE_ASYNC_WORKLOAD_SUPPORT | FFX_FRAMEGENERATION_ENABLE_DISPLAY_RESOLUTION_MOTION_VECTORS)));
|
|
if (create_fails) return ev("create fails"), 2;
|
|
made_w = c->displaySize.width, made_h = c->displaySize.height, made_rw = c->maxRenderSize.width, made_rh = c->maxRenderSize.height;
|
|
made_flags = c->flags;
|
|
*context = (ffxContext)(uintptr_t)(0x5000 + ++contexts_made);
|
|
contexts_live++, ev("create_context %ux%u", made_w, made_h);
|
|
return FFX_API_RETURN_OK;
|
|
}
|
|
static ffxReturnCode_t amd_destroy(ffxContext* context, const ffxAllocationCallbacks*) {
|
|
amd_calls++;
|
|
CHECK(context && *context && contexts_live == 1);
|
|
CHECK(images_live == 1); // (AMD's context goes before the image it wrote into)
|
|
contexts_live--, events.push_back("destroy_context");
|
|
return FFX_API_RETURN_OK;
|
|
}
|
|
static ffxReturnCode_t amd_configure(ffxContext* context, const ffxConfigureDescHeader* d) {
|
|
amd_calls++;
|
|
CHECK(context && *context && d->type == FFX_API_CONFIGURE_DESC_TYPE_FRAMEGENERATION);
|
|
const auto* c = (const ffxConfigureDescFrameGeneration*)d;
|
|
// (no swapchain of AMD's and none of its callbacks: the frame is asked for, and presented by the renderer)
|
|
CHECK((c->flags & FFX_FRAMEGENERATION_FLAG_NO_SWAPCHAIN_CONTEXT_NOTIFY) && !c->swapChain && !c->presentCallback && !c->frameGenerationCallback);
|
|
// ((Triforce, FG-2) and the picture without the HUD, every frame: the HUD is kept where the game drew it)
|
|
CHECK(c->frameGenerationEnabled && !c->allowAsyncWorkloads && !c->onlyPresentGenerated && c->HUDLessColor.resource == kHudless);
|
|
CHECK(c->HUDLessColor.description.width == made_w && c->HUDLessColor.state == FFX_API_RESOURCE_STATE_UNORDERED_ACCESS);
|
|
CHECK(c->generationRect.left == 0 && c->generationRect.top == 0 && (uint32_t)c->generationRect.width == made_w);
|
|
CHECK(c->frameID == last_id + 1); // (one more for each frame handed over)
|
|
last_id = c->frameID;
|
|
ev("configure %llu", (unsigned long long)c->frameID);
|
|
return fail_configure ? 3 : FFX_API_RETURN_OK;
|
|
}
|
|
static ffxReturnCode_t amd_dispatch(ffxContext* context, const ffxDispatchDescHeader* d) {
|
|
amd_calls++;
|
|
CHECK(context && *context);
|
|
if (d->type == FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION_PREPARE_V2) {
|
|
const auto* p = (const ffxDispatchDescFrameGenerationPrepareV2*)d;
|
|
CHECK(p->frameID == last_id && p->commandList == kCmd);
|
|
CHECK(p->depth.resource == kDepth && p->motionVectors.resource == kMotion);
|
|
CHECK(p->depth.state == FFX_API_RESOURCE_STATE_UNORDERED_ACCESS && p->depth.description.width == p->renderSize.width);
|
|
CHECK(p->renderSize.width <= made_rw && p->renderSize.height <= made_rh);
|
|
CHECK(p->motionVectorScale.x == 1.0f && p->motionVectorScale.y == 1.0f && p->viewSpaceToMetersFactor == 1.0f);
|
|
CHECK(p->cameraNear == 0.1f && p->cameraFovAngleVertical == 1.0f && p->frameTimeDelta > 0.0f);
|
|
CHECK(p->cameraForward[2] == -1.0f && p->cameraUp[1] == 1.0f && p->cameraRight[0] == 1.0f);
|
|
ev("prepare %llu%s at %g", (unsigned long long)p->frameID, p->reset ? " reset" : "", p->cameraPosition[0] + 0.0f); // (+ 0: no "-0")
|
|
return fail_dispatch == 1 ? 4 : FFX_API_RETURN_OK;
|
|
}
|
|
CHECK(d->type == FFX_API_DISPATCH_DESC_TYPE_FRAMEGENERATION);
|
|
const auto* g = (const ffxDispatchDescFrameGeneration*)d;
|
|
CHECK(g->frameID == last_id && g->commandList == kCmd && g->numGeneratedFrames == 1);
|
|
CHECK(g->presentColor.resource == kColor && g->outputs[0].resource == last_image && !g->outputs[1].resource);
|
|
CHECK(g->outputs[0].description.width == made_w && (g->outputs[0].description.usage & FFX_API_RESOURCE_USAGE_RENDERTARGET));
|
|
CHECK((g->outputs[0].description.usage & FFX_API_RESOURCE_USAGE_UAV) && g->outputs[0].state == FFX_API_RESOURCE_STATE_UNORDERED_ACCESS);
|
|
CHECK(g->backbufferTransferFunction == FFX_API_BACKBUFFER_TRANSFER_FUNCTION_SRGB);
|
|
CHECK((uint32_t)g->generationRect.width == made_w && (uint32_t)g->generationRect.height == made_h);
|
|
ev("generate %llu%s", (unsigned long long)g->frameID, g->reset ? " reset" : "");
|
|
return fail_dispatch == 2 ? 5 : FFX_API_RETURN_OK;
|
|
}
|
|
|
|
static fsr4fg::Inputs frame(uint64_t sequence, float x = 0.0f, uint32_t w = 2560, uint32_t h = 1440, uint32_t rw = 1920, uint32_t rh = 1080) {
|
|
fsr4fg::Inputs in;
|
|
in.color = kColor, in.hudless = kHudless, in.width = w, in.height = h;
|
|
in.depth = kDepth, in.motion = kMotion, in.render_width = rw, in.render_height = rh;
|
|
in.near_plane = 0.1f, in.far_plane = FLT_MAX, in.fov_y = 1.0f;
|
|
const float view[12] = {1, 0, 0, -x, 0, 1, 0, 0, 0, 0, 1, 0}; // (the camera at x, looking down -z)
|
|
std::memcpy(in.view, view, sizeof view);
|
|
in.sequence = sequence;
|
|
return in;
|
|
}
|
|
static std::vector<std::string> take() {
|
|
std::vector<std::string> e;
|
|
e.swap(events);
|
|
return e;
|
|
}
|
|
static bool is(const std::vector<std::string>& got, std::vector<std::string> want) {
|
|
if (got == want) return true;
|
|
for (const std::string& e : got) std::fprintf(stderr, " got: %s\n", e.c_str());
|
|
return false;
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
const std::string scene = argc > 1 ? argv[1] : "play";
|
|
const std::string folder = argc > 2 ? argv[2] : ".";
|
|
Library& l = lib();
|
|
l.dir = folder;
|
|
l.create = amd_create, l.destroy = amd_destroy, l.configure = amd_configure, l.query = amd_query, l.dispatch = amd_dispatch;
|
|
l.device_context = VkDeviceContext{dev.device, (VkPhysicalDevice)(uintptr_t)0x22, nullptr};
|
|
chosen_id = kIds[0];
|
|
|
|
// ---- where it is offered ----
|
|
if (scene == "no-device") { // (asked before the device is made: no answer to keep, AMD's library not touched)
|
|
dev.device = VK_NULL_HANDLE;
|
|
CHECK(fsr4fg::why() == fgr::FG_NOT_YET && !fsr4fg::frames_wanted() && !library_loads && !amd_calls);
|
|
dev.device = (VkDevice)(uintptr_t)0x11;
|
|
// ((Triforce) as known, before it is asked: not yet, and AMD's library not touched; the menu's rows read this)
|
|
CHECK(fsr4fg::why_known() == fgr::FG_NOT_YET && !fsr4fg::offered_known() && !library_loads && !amd_calls);
|
|
CHECK(fsr4fg::why() == fgr::FG_OK && fsr4fg::frames_wanted());
|
|
CHECK(fsr4fg::why_known() == fgr::FG_OK && fsr4fg::offered_known()); // (and the answer once asked)
|
|
CHECK(!std::strcmp(fsr4fg::version(), "4.0.2"));
|
|
const int calls = amd_calls;
|
|
CHECK(fsr4fg::why() == fgr::FG_OK && amd_calls == calls && library_loads == 1); // (asked once)
|
|
return std::puts("PASS no-device"), 0;
|
|
}
|
|
if (scene == "no-library" || scene == "no-configure") {
|
|
if (scene == "no-library") library_there = false;
|
|
else l.configure = nullptr; // (a loader without ffxConfigure upscales, and has no frame generation)
|
|
CHECK(fsr4fg::why() == fgr::FG_NO_LIBRARY && !fsr4fg::offered() && !fsr4fg::frames_wanted() && !amd_calls);
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::OWN && !amd_calls && events.empty());
|
|
return std::puts("PASS no-library"), 0;
|
|
}
|
|
if (scene == "no-file") { // (AMD's frame generation library is not beside the loader: nothing asked of the loader)
|
|
CHECK(fsr4fg::why() == fgr::FG_NO_FILE && !amd_calls && has_log("amd_fidelityfx_framegeneration_vk.dll"));
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::OWN && events.empty());
|
|
return std::puts("PASS no-file"), 0;
|
|
}
|
|
if (scene == "fsr31" || scene == "any-version" || scene == "only-fsr4" || scene == "none-listed") {
|
|
// ((Triforce, FG-1) a card without FSR 4's frame generation (RX 6000, 7000): AMD's library lists FSR 3.1's alone, and
|
|
// it is taken, by default and with RX_VK_FSR4_FG=1; RX_VK_FSR4_FG=4 refuses it, as every run did before
|
|
listed = {"3.1.6"};
|
|
if (scene == "none-listed") listed.clear();
|
|
if (scene == "any-version") env["RX_VK_FSR4_FG"] = 1;
|
|
if (scene == "only-fsr4") env["RX_VK_FSR4_FG"] = 4;
|
|
chosen_id = kIds[0];
|
|
if (scene == "fsr31" || scene == "any-version") {
|
|
CHECK(fsr4fg::why() == fgr::FG_OK && fsr4fg::offered() && !std::strcmp(fsr4fg::version(), "3.1.6"));
|
|
CHECK(has_log("using 3.1.6") && has_log("FSR 3.1's frame generation"));
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::SKIP && fsr4fg::generate(kCmd, frame(2)) == fgr::MADE);
|
|
} else {
|
|
CHECK(fsr4fg::why() == fgr::FG_NO_MODEL && !fsr4fg::offered());
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::OWN && events.empty() && !contexts_made);
|
|
CHECK(scene == "none-listed" || (has_log("3.1.6") && has_log("RX_VK_FSR4_FG=4"))); // (the log names what AMD's library has)
|
|
}
|
|
return std::puts("PASS versions"), 0;
|
|
}
|
|
if (scene == "no-hudless" || scene == "hdr-native") {
|
|
// ((Triforce, FG-2, FG-5) the scene's depth and motion are there, the picture without the HUD is not (or HDR Native's
|
|
// picture): AMD's library is not given the frame and no context is made for it. Without the picture without the HUD,
|
|
// the game's frame is shown alone (GAME); HDR Native's picture, which no picture without the HUD can follow, goes to
|
|
// the renderer's own (OWN: it makes the frame, as at 2x). Each reason said once. Then with it: a new history (the
|
|
// frames in between were not given), and on from there
|
|
CHECK(fsr4fg::why() == fgr::FG_OK);
|
|
const int calls = amd_calls;
|
|
for (uint64_t i = 1; i <= 3; i++) {
|
|
fsr4fg::Inputs in = frame(i);
|
|
if (scene == "no-hudless") in.hudless = VK_NULL_HANDLE;
|
|
else in.pq = true; // (with the picture without the HUD too: HDR Native first)
|
|
CHECK(fsr4fg::generate(kCmd, in) == (scene == "no-hudless" ? fgr::GAME : fgr::OWN) && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
}
|
|
CHECK(amd_calls == calls && !contexts_made && events.empty());
|
|
CHECK(has_log(scene == "no-hudless" ? "no picture without the HUD this frame" : "paused with HDR Native"));
|
|
int said = 0;
|
|
for (const std::string& l : logged)
|
|
said += l.find(scene == "no-hudless" ? "the game's frame alone" : "the renderer's own makes the frame, as at 2x") != std::string::npos;
|
|
CHECK(said == 1);
|
|
CHECK(fsr4fg::generate(kCmd, frame(4)) == fgr::SKIP && fsr4fg::generate(kCmd, frame(5)) == fgr::MADE);
|
|
return std::puts("PASS held"), 0;
|
|
}
|
|
if (scene == "fsr31-hdr-native" || scene == "fsr31-hdr-scene" || scene == "hdr-scene") {
|
|
// ((Triforce) a saved 9 on an RX 6000 or 7000 (AMD's library lists 3.1.6 alone) with HDR Native's picture, or in a
|
|
// run with RenoDX's RGBA16F scene (the owner's: RX 7900 XT, HDR Native and RenoDX). Before AMD's FSR 3.1 frame
|
|
// generation was offered there, the row showed and ran 2x (shown(9, false)). It is offered now and its version on the
|
|
// row, but these hold it from every present: AMD's library is never asked for the frame, no input is wanted for it,
|
|
// and the renderer's own makes the one frame (OWN), never the game's frame alone. Gone again, AMD's makes them
|
|
if (scene != "hdr-scene") listed = {"3.1.6"};
|
|
const fgr::Held held = scene == "fsr31-hdr-native" ? fgr::HELD_HDR_NATIVE : fgr::HELD_HDR_SCENE;
|
|
CHECK(fsr4fg::why() == fgr::FG_OK && fsr4fg::offered() && fsr4fg::frames_wanted());
|
|
CHECK(!std::strcmp(fsr4fg::version(), scene == "hdr-scene" ? "4.0.2" : "3.1.6"));
|
|
const int calls = amd_calls;
|
|
fsr4fg::held_now = held;
|
|
CHECK(!fsr4fg::frames_wanted()); // (vk_fsr3_inputs.cpp wanted() and framegen_hudless_note make nothing for it)
|
|
for (uint64_t i = 1; i <= 4; i++) {
|
|
fsr4fg::Inputs in = frame(i);
|
|
in.pq = held == fgr::HELD_HDR_NATIVE;
|
|
const fgr::Made m = fsr4fg::generate(kCmd, in);
|
|
CHECK(m == fgr::OWN && !fgr::game_frame_alone(m) && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
}
|
|
CHECK(amd_calls == calls && !contexts_made && events.empty());
|
|
fsr4fg::held_now = fgr::HELD_NONE;
|
|
CHECK(fsr4fg::frames_wanted());
|
|
CHECK(fsr4fg::generate(kCmd, frame(5)) == fgr::SKIP && fsr4fg::generate(kCmd, frame(6)) == fgr::MADE);
|
|
return std::puts("PASS held for the run"), 0;
|
|
}
|
|
if (scene == "env-off" || scene == "fsr4-off") {
|
|
env[scene == "env-off" ? "RX_VK_FSR4_FG" : "RX_VK_FSR4"] = 0;
|
|
CHECK(fsr4fg::why() == fgr::FG_ENV_OFF && !fsr4fg::frames_wanted() && !library_loads && !amd_calls);
|
|
return std::puts("PASS env"), 0;
|
|
}
|
|
if (scene == "row") { // (asked only with the row at AMD FSR 4, and not beside NVIDIA DLSS frame generation)
|
|
for (int v = 0; v <= 8; v++) {
|
|
opts.framegen = v;
|
|
CHECK(!fsr4fg::frames_wanted() && fsr4fg::generate(kCmd, frame(1)) == fgr::OWN);
|
|
}
|
|
CHECK(!library_loads && !amd_calls); // (AMD's library is not even looked for while the row is elsewhere)
|
|
opts.framegen = 9;
|
|
dlssg::on = true;
|
|
CHECK(!fsr4fg::frames_wanted() && fsr4fg::generate(kCmd, frame(1)) == fgr::OWN && !contexts_made);
|
|
dlssg::on = false;
|
|
CHECK(fsr4fg::frames_wanted());
|
|
return std::puts("PASS row"), 0;
|
|
}
|
|
|
|
CHECK(fsr4fg::why() == fgr::FG_OK && fsr4fg::offered() && fsr4fg::frames_wanted());
|
|
take();
|
|
if (scene == "create-fails" || scene == "image-fails") { // (nothing published, nothing left, off for the run)
|
|
(scene == "create-fails" ? create_fails : image_fails) = true;
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::OWN);
|
|
CHECK(is(take(), scene == "create-fails" ? std::vector<std::string>{"create_image 2560x1440", "create fails", "destroy_image"}
|
|
: std::vector<std::string>{}));
|
|
CHECK(!images_live && !contexts_live && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
CHECK(fsr4fg::why() == fgr::FG_FAILED && !fsr4fg::offered() && !fsr4fg::frames_wanted());
|
|
const int calls = amd_calls;
|
|
create_fails = image_fails = false;
|
|
CHECK(fsr4fg::generate(kCmd, frame(2)) == fgr::OWN && amd_calls == calls); // (not tried again in this run)
|
|
for (int i = 0; i < 300; i++) fsr4fg::present_tick();
|
|
CHECK(take().empty() && amd_calls == calls);
|
|
return std::puts("PASS create-fails"), 0;
|
|
}
|
|
if (scene == "dispatch-fails" || scene == "configure-fails") {
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::SKIP && fsr4fg::generate(kCmd, frame(2)) == fgr::MADE);
|
|
fsr4fg::present_tick();
|
|
take();
|
|
if (scene == "configure-fails") fail_configure = true;
|
|
else fail_dispatch = 2;
|
|
CHECK(fsr4fg::generate(kCmd, frame(3)) == fgr::OWN); // (the renderer's own makes this frame)
|
|
CHECK(fsr4fg::made_image() == VK_NULL_HANDLE && fsr4fg::why() == fgr::FG_FAILED && has_log("off for this run"));
|
|
take();
|
|
const int calls = amd_calls;
|
|
// (the context stays while the failed frame's commands may be recorded and not on the queue: this present's tick
|
|
// leaves it, the next takes it down, the GPU idle first, AMD's context before the image)
|
|
fsr4fg::present_tick();
|
|
CHECK(take().empty() && contexts_live == 1);
|
|
CHECK(fsr4fg::generate(kCmd, frame(4)) == fgr::OWN && amd_calls == calls);
|
|
fsr4fg::present_tick();
|
|
CHECK(is(take(), {"wait_gpu", "destroy_context", "destroy_image"}) && !contexts_live && !images_live);
|
|
for (int i = 0; i < 300; i++) fsr4fg::present_tick();
|
|
CHECK(fsr4fg::generate(kCmd, frame(5)) == fgr::OWN && take().empty() && amd_calls == calls + 1); // (+1: the destroy)
|
|
return std::puts("PASS dispatch-fails"), 0;
|
|
}
|
|
if (scene == "exit") {
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::SKIP && fsr4fg::generate(kCmd, frame(2)) == fgr::MADE);
|
|
take();
|
|
const int calls = amd_calls;
|
|
fsr4fg::exiting();
|
|
// (nothing of AMD's is called at the exit or after it: no destroy under ExitProcess, no frame, no tick's release)
|
|
CHECK(fsr4fg::generate(kCmd, frame(3)) == fgr::OWN && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
for (int i = 0; i < 300; i++) fsr4fg::present_tick();
|
|
CHECK(take().empty() && amd_calls == calls && contexts_live == 1 && images_live == 1 && !idle_waits);
|
|
fsr4fg::exiting(); // (twice is once)
|
|
CHECK(amd_calls == calls);
|
|
return std::puts("PASS exit"), 0;
|
|
}
|
|
|
|
// ---- play: each frame's calls, the histories, another size, the row left ----
|
|
CHECK(scene == "play");
|
|
// the first frame: the image and the context made (the image first, published together), then AMD's order for frame 1,
|
|
// as a new history, and no made frame
|
|
CHECK(fsr4fg::generate(kCmd, frame(1)) == fgr::SKIP && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
CHECK(is(take(), {"create_image 2560x1440", "create_context 2560x1440", "image to GENERAL", "configure 1", "prepare 1 reset at 0",
|
|
"generate 1 reset"}));
|
|
CHECK(made_rw == 2560 && made_rh == 1440 && (made_flags & FFX_FRAMEGENERATION_ENABLE_DEPTH_INFINITE));
|
|
CHECK((last_image_usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)) ==
|
|
(VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT));
|
|
CHECK(has_log("FSR frame generation 4.0.2 made"));
|
|
fsr4fg::present_tick();
|
|
// the frames after it: configuration, preparation, generation, the id one more each; the made frame is the image of ours
|
|
CHECK(fsr4fg::generate(kCmd, frame(2, 0.05f)) == fgr::MADE && fsr4fg::made_image() == last_image);
|
|
CHECK(is(take(), {"configure 2", "prepare 2 at 0.05", "generate 2"}));
|
|
fsr4fg::present_tick();
|
|
CHECK(fsr4fg::generate(kCmd, frame(3, 0.1f, 2560, 1440, 1280, 720)) == fgr::MADE); // (the game's dynamic resolution: the same context)
|
|
CHECK(is(take(), {"configure 3", "prepare 3 at 0.1", "generate 3"}));
|
|
// a camera cut: handed over as a new history, and no frame made between the two views
|
|
CHECK(fsr4fg::generate(kCmd, frame(4, 40.0f)) == fgr::SKIP && fsr4fg::made_image() == VK_NULL_HANDLE);
|
|
CHECK(is(take(), {"configure 4", "prepare 4 reset at 40", "generate 4 reset"}) && has_log("a camera cut"));
|
|
CHECK(fsr4fg::generate(kCmd, frame(5, 40.05f)) == fgr::MADE); // (and on from there)
|
|
take();
|
|
// the caller's reset (its first frame, a hitch) and a present it did not hand over (a menu: no scene): a new history each
|
|
fsr4fg::Inputs hitch = frame(6, 40.1f);
|
|
hitch.reset = true;
|
|
CHECK(fsr4fg::generate(kCmd, hitch) == fgr::SKIP);
|
|
CHECK(is(take(), {"configure 6", "prepare 6 reset at 40.1", "generate 6 reset"}));
|
|
CHECK(fsr4fg::generate(kCmd, frame(7, 40.1f)) == fgr::MADE);
|
|
CHECK(fsr4fg::generate(kCmd, frame(9, 40.1f)) == fgr::SKIP); // (8 was not handed over)
|
|
CHECK(is(take(), {"configure 7", "prepare 7 at 40.1", "generate 7", "configure 8", "prepare 8 reset at 40.1", "generate 8 reset"}));
|
|
CHECK(fsr4fg::generate(kCmd, frame(10, 40.1f)) == fgr::MADE);
|
|
take();
|
|
// a present without its inputs is not handed over at all
|
|
fsr4fg::Inputs bare = frame(11, 40.1f);
|
|
bare.depth = VK_NULL_HANDLE;
|
|
const int calls = amd_calls;
|
|
CHECK(fsr4fg::generate(kCmd, bare) == fgr::OWN && amd_calls == calls && take().empty());
|
|
CHECK(has_log("a present without the scene's depth and motion")); // ((Triforce) said, once: the lab's run had no such line)
|
|
// another picture size: the GPU idle, AMD's context destroyed, then the image; then both made again, a new history
|
|
CHECK(fsr4fg::generate(kCmd, frame(12, 40.1f, 1920, 1080, 1920, 1080)) == fgr::SKIP);
|
|
CHECK(is(take(), {"wait_gpu", "destroy_context", "destroy_image", "create_image 1920x1080", "create_context 1920x1080", "image to GENERAL",
|
|
"configure 10", "prepare 10 reset at 40.1", "generate 10 reset"}));
|
|
CHECK(contexts_live == 1 && images_live == 1);
|
|
CHECK(fsr4fg::generate(kCmd, frame(13, 40.1f, 1920, 1080, 1920, 1080)) == fgr::MADE);
|
|
take();
|
|
// the row leaves AMD FSR 4: nothing for 119 presents, then the context and the image go, in that order
|
|
opts.framegen = 2;
|
|
CHECK(fsr4fg::generate(kCmd, frame(14, 40.1f, 1920, 1080, 1920, 1080)) == fgr::OWN && take().empty());
|
|
for (int i = 0; i < 119; i++) fsr4fg::present_tick();
|
|
CHECK(take().empty() && contexts_live == 1);
|
|
fsr4fg::present_tick();
|
|
CHECK(is(take(), {"wait_gpu", "destroy_context", "destroy_image"}) && !contexts_live && !images_live && has_log("row left AMD FSR 4"));
|
|
const int after = amd_calls;
|
|
for (int i = 0; i < 300; i++) fsr4fg::present_tick();
|
|
CHECK(take().empty() && amd_calls == after);
|
|
// and comes back: made again, a new history; AMD's library is not asked what it has a second time
|
|
opts.framegen = 9;
|
|
CHECK(fsr4fg::generate(kCmd, frame(15, 40.1f, 1920, 1080, 1920, 1080)) == fgr::SKIP);
|
|
CHECK(is(take(), {"create_image 1920x1080", "create_context 1920x1080", "image to GENERAL", "configure 12", "prepare 12 reset at 40.1",
|
|
"generate 12 reset"}));
|
|
CHECK(library_loads == 1 && contexts_made == 3);
|
|
return std::puts("PASS: AMD FSR 4's frame generation against a stand-in for AMD's library: each frame's calls, histories, sizes, release"), 0;
|
|
}
|
|
'''
|
|
|
|
def source_checks():
|
|
fsr4 = (VK / "vk_fsr4.cpp").read_text(encoding="utf-8")
|
|
framegen = (VK / "vk_framegen.cpp").read_text(encoding="utf-8")
|
|
menu = (VK / "vk_menu.cpp").read_text(encoding="utf-8")
|
|
header = (VK / "vk_menu.h").read_text(encoding="utf-8")
|
|
replay = (VK / "vk_replay.cpp").read_text(encoding="utf-8")
|
|
inputs = (VK / "vk_fsr3_inputs.cpp").read_text(encoding="utf-8")
|
|
|
|
def need(text, what, where):
|
|
if what not in text:
|
|
raise SystemExit("%s: missing %r" % (where, what))
|
|
|
|
# the default stays Off, and the row's table takes an options file's AMD FSR 4 before the graphics card is known
|
|
need(header, "int framegen = 0;", "vk_menu.h (the Frame generation row's default)")
|
|
# ((Triforce, options_version 7) the saved value's own row is hidden and ends at AMD FSR 4 (kRowMax, 9), so a file's 9
|
|
# loads before the card is known; the Graphics tab's Frame generation row is merged_rows.h's, its choices framegen_list)
|
|
need(menu, '{TAB_HIDDEN, "Frame generation", &opts.framegen, 0, framegen_rows::kRowMax, 1, tx_framegen, nullptr}',
|
|
"vk_menu.cpp rows[]")
|
|
sync = function(menu, "void framegen_row_sync() {")
|
|
need(sync, "mr7::framegen_choices(framegen_list, fsr4fg::offered_known(), dlssg_offered())",
|
|
"framegen_row_sync") # ((Triforce) as known: menu_ahead)
|
|
need(sync, "framegen_rows::kRowMax == 9", "framegen_row_sync")
|
|
if menu.count("framegen_row_sync();") < 2:
|
|
raise SystemExit("vk_menu.cpp: the Frame generation row's end is not set at both places the menu opens")
|
|
need(function(menu, "const char* hn_framegen(int v, int variant) {"), "if (v == framegen_rows::FSR4) return hn_framegen_fsr4(variant);",
|
|
"hn_framegen")
|
|
# the made frame: asked of AMD's library first, at the row's AMD FSR 4 only; what it does not make falls to the renderer's own,
|
|
# and a new history gets no made frame at all
|
|
need(function(framegen, "int multiplier() {"), "if (opts.framegen == framegen_rows::FSR4) return 2;", "vk_framegen.cpp multiplier")
|
|
record = function(framegen, "bool framegen_record(")
|
|
for what in ("if (opts.framegen == framegen_rows::FSR4) {", "fsr4_frame(cmd, *set, cur, uw, uh, sequence, blend)",
|
|
"none = framegen_rows::game_frame_alone(by_fsr4);", "if (set->made == 0 && !none && blend && m > 1) {",
|
|
"fg.src_w = sw, fg.src_h = sh, fg.source = source;"):
|
|
need(record, what, "framegen_record")
|
|
# ((Triforce) the renderer's own vectors are make_vectors')
|
|
if not record.index("fsr4_frame(") < record.index("fsr3fi_frame(") < record.index("make_vectors(cmd", record.index("fsr4_frame(")):
|
|
raise SystemExit("framegen_record: AMD FSR 4 is not asked before the renderer's own interpolation")
|
|
frame = function(framegen, "framegen_rows::Made fsr4_frame(")
|
|
for what in ("if (!fsr4fg::frames_wanted()) {", "framegen_rows::why_name(", "fsr3_inputs::take(f)", "in.reset = f.reset || !blend;",
|
|
"in.sequence = sequence;", "fsr4fg::generate(cmd, in)", "set.frame[0].image",
|
|
# ((Triforce, FG-2) this frame's picture without the HUD, none with HDR Native; what it answered counted
|
|
"in.hudless = in.pq ? VK_NULL_HANDLE : hudless_for(cmd, f.frame, uw, uh);",
|
|
"framegen_rows::game_frame_alone(made) ? made : framegen_rows::OWN"):
|
|
need(frame, what, "fsr4_frame")
|
|
# ((Triforce, FG-2) the picture without the HUD: this frame's alone, cut as the picture is, its bytes as AMD's library takes them
|
|
hudless = function(framegen, "VkImage hudless_for(VkCommandBuffer cmd, uint64_t frame, uint32_t w, uint32_t h) {")
|
|
for what in ("k.valid && k.frame == frame", "framegen_rows::hudless_source(t->w, t->h, fg.src_w, fg.src_h",
|
|
"VK_FORMAT_R8G8B8A8_SRGB", "vkCmdCopyImage(cmd, hl.srgb.image, VK_IMAGE_LAYOUT_GENERAL, hl.out.image"):
|
|
need(hudless, what, "vk_framegen.cpp hudless_for")
|
|
note = function(framegen, "void framegen_hudless_note(VkCommandBuffer cmd, Texture* out, uint32_t level) {")
|
|
for what in ("fsr4fg::frames_wanted()", "present_native_pq.load", "VK_FORMAT_B10G11R11_UFLOAT_PACK32", "vkCmdBlitImage(",
|
|
"t.frame = texture_frame_no()"):
|
|
need(note, what, "vk_framegen.cpp framegen_hudless_note")
|
|
need(fsr4, "c.HUDLessColor = image_resource(in.hudless,", "vk_fsr4.cpp generate")
|
|
# ((Triforce) HDR Native and RenoDX's RGBA16F scene hold AMD's library from every present: nothing is wanted for it, the
|
|
# renderer's own makes the frame, and the menu's line says so by the same rule, not by the HDR row alone
|
|
need(function(fsr4, "bool frames_wanted() {"), "!fgr::held_whole_run(held())", "vk_fsr4.cpp frames_wanted")
|
|
held = function(fsr4, "framegen_rows::Held fsr4fg::held() {")
|
|
for what in ("present_native_pq.load(", "temporal_scene_format(VK_FORMAT_R16G16B16A16_SFLOAT)"):
|
|
need(held, what, "vk_fsr4.cpp fsr4fg::held")
|
|
if fsr4.index("framegen_rows::Held fsr4fg::held() {") < fsr4.rindex("#endif"):
|
|
raise SystemExit("vk_fsr4.cpp: fsr4fg::held is not outside the build's FSR sections (the menu reads it in every build)")
|
|
need(function(fsr4, "framegen_rows::Made generate("), "return fgr::held_made(held);", "vk_fsr4.cpp generate")
|
|
hn = function(menu, "const char* hn_framegen_fsr4(int variant) {")
|
|
need(hn, "framegen_rows::held_whole_run(fsr4fg::held()) ? native : ok", "hn_framegen_fsr4")
|
|
if "opts.hdr" in hn:
|
|
raise SystemExit("hn_framegen_fsr4: the pause is read from the HDR row, not from what holds AMD's library (fsr4fg::held)")
|
|
need(fsr4, "s.desc.header.pNext = &s.hudless.header;", "vk_fsr4.cpp make (the HUD-less format linked)")
|
|
# its inputs are gathered while it is asked, its context looked after each present, and the exit reaches it
|
|
need(inputs, "|| fsr4fg::frames_wanted()", "vk_fsr3_inputs.cpp wanted()")
|
|
need(framegen, "void framegen_present_tick() { fsr4fg::present_tick(); }", "vk_framegen.cpp")
|
|
need(framegen, "void framegen_exiting() { fsr4fg::exiting(); }", "vk_framegen.cpp")
|
|
need(replay, "framegen_present_tick();", "vk_replay.cpp (each present)")
|
|
at = replay.find("if (id == HOS_OPT_EXITING) framegen_exiting();")
|
|
if at < 0 or not at < replay.find("if (id == HOS_OPT_EXITING) return dlssg::shutdown();"):
|
|
raise SystemExit("vk_replay.cpp: HOS_OPT_EXITING does not reach frame generation (before the return for DLSS's)")
|
|
# the real steps of the teardown are framegen_rows.h's, in its order, and the exit's are the exit's
|
|
need(function(fsr4, "void release(Fg& s, const char* why) {"), "fgr::teardown(d, false);", "vk_fsr4.cpp release")
|
|
need(function(fsr4, "void exiting() {"), "fgr::teardown(e, true);", "vk_fsr4.cpp exiting")
|
|
down = between(fsr4, "struct Down {", "struct AtExit {")
|
|
for what in ("device_wait_idle_locked();", "lib().destroy(&s.context, nullptr)", "destroy_image(s.out, s.out_memory)"):
|
|
need(down, what, "vk_fsr4.cpp Down")
|
|
at_exit = between(fsr4, "struct AtExit {", "void release(Fg& s")
|
|
if "lib()" in at_exit or "destroy_image(" in at_exit or "device_wait_idle" in at_exit:
|
|
raise SystemExit("vk_fsr4.cpp AtExit: something of AMD's or of the GPU is still called at the exit")
|
|
need(at_exit, "g_fg_exiting.store(true);", "vk_fsr4.cpp AtExit")
|
|
# a build without FSR, and one that is not for Windows, have the same functions answering "not here"
|
|
stubs = fsr4[fsr4.index("#else // (not Windows"):]
|
|
if stubs.count("framegen_rows::Why why() { return framegen_rows::FG_NOT_BUILT; }") != 2 or stubs.count("void exiting() {}") != 2:
|
|
raise SystemExit("vk_fsr4.cpp: the frame generation stubs of a build without FSR, or not for Windows, are missing")
|
|
# the rows are documented
|
|
readme = (ROOT / "readme.md").read_text(encoding="utf-8")
|
|
row = [line for line in readme.splitlines() if line.startswith("| Frame generation |")]
|
|
if len(row) != 1 or "AMD FSR (" not in row[0] or "2x up to 8x" not in row[0] or "3.1.6" not in row[0]:
|
|
raise SystemExit("readme.md: the Frame generation row does not list its choices with AMD FSR and its version")
|
|
dev = (ROOT / "docs" / "development.md").read_text(encoding="utf-8")
|
|
key = [line for line in dev.splitlines() if line.startswith("| `frame_generation` |")]
|
|
if len(key) != 1 or "9 AMD FSR frame generation" not in key[0] or "2 to 8 the multiplier" not in key[0]:
|
|
raise SystemExit("docs/development.md: frame_generation's values do not list 9, AMD FSR frame generation")
|
|
need(dev, "`RX_VK_FSR4_FG=0/1/4`", "docs/development.md (the switches)")
|
|
need(dev, "`RX_VK_FRAMEGEN_MULT=<0..9>`", "docs/development.md (the row's pin, 9 among it)")
|
|
need(dev, "`RX_VK_FG_OWN_MOTION=0`", "docs/development.md (frame generation's motion)")
|
|
need(dev, "`RX_VK_FG_HUDLESS=0`", "docs/development.md (the picture without the HUD)")
|
|
print("PASS: the row, the made frame, the present's tick, the exit and the documents are wired to AMD FSR 4's frame generation")
|
|
|
|
|
|
def main():
|
|
p = argparse.ArgumentParser(description=__doc__)
|
|
p.add_argument("--cxx", default="g++")
|
|
p.add_argument("--headers", type=Path)
|
|
a = p.parse_args()
|
|
menu = (VK / "vk_menu.cpp").read_text(encoding="utf-8")
|
|
fsr4 = (VK / "vk_fsr4.cpp").read_text(encoding="utf-8")
|
|
fsr4_h = (VK / "vk_fsr4.h").read_text(encoding="utf-8")
|
|
with tempfile.TemporaryDirectory(prefix="framegen-fsr4-") as tmp:
|
|
build_and_run(a.cxx, tmp, "rows", ROWS, ["-I" + str(VK)])
|
|
text = MENU.replace("/* TX */", function(menu, "const char* tx_framegen(int v) {"))
|
|
text = text.replace("/* HN */", function(menu, "const char* hn_framegen_fsr4(int variant) {"))
|
|
build_and_run(a.cxx, tmp, "menu", text, ["-I" + str(VK)])
|
|
if os.name != "nt":
|
|
print("skipped: AMD's frame generation section is the Windows build's (AMD publishes no library elsewhere)")
|
|
elif not a.headers or not (a.headers / "vulkan" / "vulkan.h").is_file():
|
|
raise SystemExit("--headers <Vulkan-Headers/include> is needed for AMD's frame generation section")
|
|
else:
|
|
section = between(fsr4, "namespace fsr4fg {\nnamespace {\nnamespace fgr = framegen_rows;", "#else // (not Windows")
|
|
text = FG.replace("/* INPUTS */", between(fsr4_h, "struct Inputs {", "/// Why AMD's library cannot make the frames here"))
|
|
text = text.replace("/* SECTION */", section)
|
|
there, bare = Path(tmp) / "with", Path(tmp) / "without"
|
|
there.mkdir(), bare.mkdir()
|
|
(there / "amd_fidelityfx_framegeneration_vk.dll").write_bytes(b"a stand-in: only looked for by its name")
|
|
scenes = ["play", "no-device", "no-library", "no-configure", "fsr31", "only-fsr4", "none-listed", "any-version", "env-off",
|
|
"fsr4-off", "row", "no-hudless", "hdr-native", "fsr31-hdr-native", "fsr31-hdr-scene", "hdr-scene", "create-fails", "image-fails", "dispatch-fails", "configure-fails",
|
|
"exit"]
|
|
build_and_run(a.cxx, tmp, "fg", text,
|
|
["-I" + str(a.headers), "-I" + str(ROOT / "third_party" / "fidelityfx"), "-I" + str(VK), "-Wno-unknown-pragmas",
|
|
"-Wno-unused-function", "-Wno-unused-variable", "-Wno-unused-const-variable", "-Wno-unused-parameter",
|
|
"-Wno-deprecated-declarations"],
|
|
runs=[(s, str(there)) for s in scenes] + [("no-file", str(bare))])
|
|
source_checks()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|