Triforce v0.8.0

Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-25 10:21:32 -06:00
parent 861702476a
commit 4fa4f9188b
881 changed files with 179428 additions and 15581 deletions

View File

@@ -0,0 +1,66 @@
// tests/test_sparse_spare.py: gpu/vk/sparse_spare.h, the sparse mirrors' buffers kept for the next mirror of their size
#include "../gpu/vk/sparse_spare.h"
#include <cstdio>
#include <vector>
namespace {
int failures = 0;
void check(bool ok, const char* what) {
if (!ok) failures++, std::printf("FAIL: %s\n", what);
}
using Spare = sparse_spare::Spare<int>;
using List = sparse_spare::List<int>;
constexpr uint64_t MB = 1 << 20;
Spare spare(int handle, uint64_t made, uint64_t after = 0) {
return {handle, made, made, 64 * 1024, 0x82, after};
}
} // namespace
int main() {
const uint64_t cap = 64 * MB;
std::vector<Spare> gone;
Spare s;
{ // a mirror of the same size takes the buffer, with what its requirements said; another size does not
List l;
check(l.put(spare(1, 4 * MB, 7), cap, &gone) && gone.empty() && l.held == 4 * MB, "a freed buffer is kept");
check(!l.take(8 * MB, &s) && !l.take(4 * MB - 1, &s) && !l.take(4 * MB + 65536, &s), "only its exact size takes it");
check(l.held == 4 * MB && l.items.size() == 1, "a miss takes nothing");
check(l.take(4 * MB, &s) && s.buffer == 1 && s.made == 4 * MB && s.size == 4 * MB && s.block == 64 * 1024 && s.types == 0x82 && s.after == 7,
"the spare comes back whole: its handle, sizes, block, memory types and its unbinding's value");
check(l.held == 0 && l.items.empty() && !l.take(4 * MB, &s), "taken once");
}
{ // of several of one size, the one kept last; the others stay, in their order
List l;
for (int h = 1; h <= 3; h++) l.put(spare(h, 4 * MB), cap, &gone);
l.put(spare(9, 8 * MB), cap, &gone);
check(l.take(4 * MB, &s) && s.buffer == 3, "the spare kept last goes first");
check(l.take(4 * MB, &s) && s.buffer == 2 && l.take(8 * MB, &s) && s.buffer == 9 && l.take(4 * MB, &s) && s.buffer == 1, "then the earlier ones");
check(gone.empty() && l.held == 0, "nothing was given up under the cap");
}
{ // over the cap the oldest go, as many as the new one needs, each with its own value; the new one is kept
List l;
for (int h = 1; h <= 4; h++) l.put(spare(h, 16 * MB, (uint64_t)h * 10), cap, &gone);
check(gone.empty() && l.held == cap, "exactly at the cap: all kept");
check(l.put(spare(5, 8 * MB, 50), cap, &gone), "one more is kept");
check(gone.size() == 1 && gone[0].buffer == 1 && gone[0].after == 10 && l.held == 56 * MB, "the oldest went for it, with its value");
gone.clear();
check(l.put(spare(6, 40 * MB, 60), cap, &gone) && gone.size() == 2 && gone[0].buffer == 2 && gone[1].buffer == 3,
"a large one sends as many of the oldest as it needs and no more, oldest first");
check(l.held == cap && l.items.size() == 3 && l.items[0].buffer == 4 && l.items[1].buffer == 5 && l.items[2].buffer == 6, "and the rest stay");
gone.clear();
check(l.put(spare(7, cap), cap, &gone) && gone.size() == 3 && l.held == cap && l.items.size() == 1, "one as large as the cap empties the list");
}
{ // what is never kept: no size (a mirror made before its size was recorded), larger than the cap, no cap at all
List l;
l.put(spare(1, 4 * MB), cap, &gone);
gone.clear();
check(!l.put(spare(2, 0), cap, &gone) && !l.put(spare(3, cap + 1), cap, &gone) && !l.put(spare(4, 4 * MB), 0, &gone),
"no size, over the cap, or no cap: the caller's to destroy");
check(gone.empty() && l.held == 4 * MB && l.items.size() == 1, "and nothing else was touched for it");
}
check(sparse_spare::kDefaultMb == 4096, "the default cap is 4 GB of address space");
if (!failures) std::printf("sparse_spare: ok\n");
return failures != 0;
}