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

@@ -1,6 +1,7 @@
// Authored allocator/address failures only; no Vulkan device, driver or game data.
// Null mapping and zero BDA are defensive injections, not conforming-driver outcomes.
#include <algorithm>
#include <atomic>
#include <cstdint>
#include <cstdio>
#include <stdexcept>
@@ -28,12 +29,12 @@ static constexpr uint32_t sentinel = 0xcccccccc;
static void require(bool condition, const char* message) {
if (!condition) throw std::runtime_error(message);
}
static uint64_t ring_bytes();
static bool create_buffer(uint64_t size, VkBufferUsageFlags usage, bool host_visible,
VkBuffer& buffer, VmaAllocation& allocation, void** mapped) {
++creates;
require(creates == 1, "initialization allocated more than once");
require(size != 0 && size % 16 == 0 && size <= 4 * 1024 * 1024,
"unexpected allocation size");
require(size == ring_bytes(), "unexpected allocation size");
require(usage == (VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT |
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT) && host_visible && mapped,
"changed production allocation flags");
@@ -66,6 +67,8 @@ static uint64_t vkGetBufferDeviceAddress(int device, const VkBufferDeviceAddress
#include "mesh_args_actual.inc"
static uint64_t ring_bytes() { return static_cast<uint64_t>(kMeshArgs) * 4 * sizeof(uint32_t); }
static void initialized_ring() {
require(storage.size() == static_cast<std::size_t>(kMeshArgs) * 4 + 2,
"allocation does not hold the actual ring");
@@ -118,6 +121,28 @@ int main(int argc, char** argv) {
require(creates == 1 && destroys == 0 && addresses == 1 &&
mesh_args_words[4] == 123 && mesh_args_words[7] == 456,
"reuse recreated, destroyed or reset the ring");
} else if (mode == "take_ranges") {
// Entries handed out stay in use until kMeshArgs / 2 more have been handed out: no range may reuse one
// sooner. A big draw right before the old modulus wrapped, then a one-entry draw, overlapped.
std::vector<uint64_t> taken_at(kMeshArgs, UINT64_MAX);
uint64_t handed = 1; // (the ring's counter starts at 1)
const auto take = [&](uint32_t n) {
const uint32_t at = mesh_args_take(n);
n = std::clamp<uint32_t>(n, 1, kMeshArgs / 2);
require(at >= 1 && (uint64_t)at + n <= kMeshArgs, "range outside the ring or on entry 0");
for (uint32_t i = 0; i < n; ++i) {
const uint64_t prior = taken_at[at + i];
require(prior == UINT64_MAX || handed + n - prior > kMeshArgs / 2,
"range reuses entries still in use");
taken_at[at + i] = handed;
}
handed += n;
};
constexpr uint32_t big = 4096;
while (handed < (uint64_t)kMeshArgs - big) take(1);
take(big);
for (uint32_t k = 0; k < 64; ++k) take(1 + k % 5);
for (uint32_t k = 0; k < 3 * kMeshArgs / big; ++k) take(k % 3 ? 1 + k % 97 : big);
} else {
throw std::runtime_error("unknown fixture case");
}