mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-25 18:48:51 -04:00
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:
@@ -20,11 +20,20 @@ constexpr VkBufferUsageFlags VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 1;
|
||||
constexpr VkBufferUsageFlags VK_BUFFER_USAGE_TRANSFER_DST_BIT = 2;
|
||||
constexpr VkBufferUsageFlags VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 4;
|
||||
constexpr VkBufferUsageFlags VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 8;
|
||||
constexpr VkBufferUsageFlags VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 16;
|
||||
constexpr int VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO = 1;
|
||||
struct VkBufferDeviceAddressInfo { int sType; VkBuffer buffer = 0; };
|
||||
struct { int device = 1; } dev;
|
||||
namespace Shader::Backend::SPIRV {
|
||||
constexpr uint64_t MESH_FALLBACK_CAPACITY = 5, MESH_FALLBACK_HEADER_WORDS = 8, MESH_FALLBACK_RECORD_WORDS = 16;
|
||||
// (mma_layout.h mesh_fallback_global_attributes: the records buffer then holds the attribute regions' pool past the records)
|
||||
constexpr uint64_t MESH_FALLBACK_POOL_OFFSET = 128, MESH_FALLBACK_POOL_BYTES = 64;
|
||||
constexpr uint64_t MESH_FALLBACK_RECORDS_LIMIT = 1024; // (the largest records buffer made: these all fit)
|
||||
inline bool mesh_fallback_global_attributes = false;
|
||||
// (mma_layout.h mesh_fallback_shared_warp: its counters past the records, or past the pool; the pool's own wait counts there too)
|
||||
constexpr uint64_t WARP_COUNTER_BYTES = 16;
|
||||
inline bool mesh_fallback_shared_warp = false;
|
||||
inline bool MeshFallbackCounters() { return mesh_fallback_shared_warp || mesh_fallback_global_attributes; }
|
||||
}
|
||||
struct Program {
|
||||
uint32_t fallback_vertices_per_workgroup = 3;
|
||||
@@ -39,13 +48,15 @@ static Allocation poison;
|
||||
static std::unordered_map<VkBuffer, VmaAllocation> live;
|
||||
static unsigned create_calls, destroy_calls, address_calls;
|
||||
static unsigned fail_create, zero_address;
|
||||
static VkBufferUsageFlags records_usage; // (the first buffer made: the records)
|
||||
static void require(bool condition, const char* message) {
|
||||
if (!condition) throw std::runtime_error(message);
|
||||
}
|
||||
static bool create_buffer(uint64_t size, VkBufferUsageFlags, bool,
|
||||
static bool create_buffer(uint64_t size, VkBufferUsageFlags usage, bool,
|
||||
VkBuffer& buffer, VmaAllocation& allocation, void**) {
|
||||
require(size != 0, "fixture received a zero allocation size");
|
||||
++create_calls;
|
||||
if (create_calls == 1) records_usage = usage;
|
||||
if (create_calls == fail_create) {
|
||||
// An output written on failure must never be treated as a confirmed allocation.
|
||||
buffer = 0xffff;
|
||||
@@ -147,6 +158,24 @@ static void run(const std::string& name) {
|
||||
success_reuse(false);
|
||||
} else if (name == "task_success") {
|
||||
success_reuse(true);
|
||||
} else if (name == "pool_records") {
|
||||
// (the attribute regions' pool: the records buffer reaches its end, then the counters its wait counts in; the payload as
|
||||
// without it)
|
||||
Shader::Backend::SPIRV::mesh_fallback_global_attributes = true;
|
||||
require(fallback_buffers_of(p, out) && out && out->records_address, "initialization with the pool failed");
|
||||
require(out->records_bytes == 128 + 64 + 16, "the records buffer does not hold the pool, and its counters, past the records");
|
||||
require(out->payload_bytes == 44, "the pool changed the payload buffer");
|
||||
require(records_usage & VK_BUFFER_USAGE_TRANSFER_SRC_BIT, "the pool's counters cannot be copied out of the records");
|
||||
} else if (name == "warp_counters" || name == "warp_counters_pool") {
|
||||
// (the shared warp's counters: right past the records' regular end, with the pool or without, and the buffer a copy's source)
|
||||
Shader::Backend::SPIRV::mesh_fallback_shared_warp = true;
|
||||
Shader::Backend::SPIRV::mesh_fallback_global_attributes = name == "warp_counters_pool";
|
||||
require(fallback_buffers_of(p, out) && out && out->records_address, "initialization with the shared warp failed");
|
||||
require(out->records_bytes == (name == "warp_counters_pool" ? 128 + 64 : 96) + 16,
|
||||
"the records buffer has no room for the shared warp's counters");
|
||||
require(!out->warp_counters_cleared, "a new records buffer's counters count as cleared");
|
||||
require(records_usage & VK_BUFFER_USAGE_TRANSFER_SRC_BIT, "the counters cannot be copied out of the records");
|
||||
require(out->payload_bytes == 44, "the shared warp changed the payload buffer");
|
||||
} else if (name == "invalid_program") {
|
||||
p.fallback_record_words = 0;
|
||||
require(!fallback_buffers_of(p, out), "invalid program was accepted");
|
||||
|
||||
Reference in New Issue
Block a user