Triforce v0.9.0

Character tab, faster renderer defaults, HD rumble shipped, and the 11-30 bug pass: ending softlock below 60 fps, adult first-night lock, Intel Arc robust buffers, adult map, randomizer load order.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-30 20:55:14 -06:00
parent 8cb23131f9
commit 822ee913bc
86 changed files with 8128 additions and 438 deletions

View File

@@ -3,7 +3,8 @@
vendor_fixes() is compiled with the Vulkan headers and run on the properties of GPUs players have: NVIDIA's driver on
Windows and Linux (and NVK on the same cards), AMD's Windows driver in its two branches (RDNA 1/2: "AMD proprietary
shader compiler"; RDNA 3/4: LLPC), RADV, AMDVLK, Intel's Windows driver on an integrated GPU and on an Arc card, ANV,
llvmpipe. Each fix must be on for the GPUs it is for and off for every other, and NVIDIA's driver must get none: that is
llvmpipe. Each fix must be on for the GPUs it is for and off for every other (robust buffer access: Intel's Windows driver alone,
11-30), and NVIDIA's driver must get none: that is
what keeps the renderer and the translated shaders on NVIDIA as they were. The RX_VK_ switches force each one either way.
Then the source: the device's fixes are made from its properties at device creation, and the translator is told
fetch_bounds, nan_bits and the gather offset (and the program cache's stamp tells the three apart).
@@ -20,29 +21,31 @@ RUN_ALL_ARGS = ["--cxx", "{cxx}", "--headers", "{vulkan_headers}"]
ROOT = Path(__file__).resolve().parents[1]
VK = ROOT / "gpu" / "vk"
# name, vendor, driver id, device type, driverInfo -> fetch_bounds, nan_bits, gather_offset
# name, vendor, driver id, device type, driverInfo -> fetch_bounds, nan_bits, gather_offset, robust_buffers
DEVICES = [
("RTX 3090, NVIDIA's Linux driver", 0x10DE, "NVIDIA_PROPRIETARY", "DISCRETE_GPU", "580.105.08", "000"),
("RTX 4070 laptop, NVIDIA's Windows driver", 0x10DE, "NVIDIA_PROPRIETARY", "DISCRETE_GPU", "581.57", "000"),
("GTX 1650, NVK", 0x10DE, "MESA_NVK", "DISCRETE_GPU", "Mesa 26.0.1", "000"),
("RTX 3090, NVIDIA's Linux driver", 0x10DE, "NVIDIA_PROPRIETARY", "DISCRETE_GPU", "580.105.08", "0000"),
("RTX 4070 laptop, NVIDIA's Windows driver", 0x10DE, "NVIDIA_PROPRIETARY", "DISCRETE_GPU", "581.57", "0000"),
("GTX 1650, NVK", 0x10DE, "MESA_NVK", "DISCRETE_GPU", "Mesa 26.0.1", "0000"),
("RX 6700 XT, AMD's Windows driver (RDNA 2 branch)", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU",
"26.10.1 (AMD proprietary shader compiler)", "111"),
"26.10.1 (AMD proprietary shader compiler)", "1110"),
("RX 5700, AMD's Windows driver (RDNA 1 branch)", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU",
"25.9.1 (AMD proprietary shader compiler)", "111"),
("RX 9070 XT, AMD's Windows driver (LLPC)", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU", "26.10.1 (LLPC)", "101"),
("RX 7600, AMD's Windows driver, no driverInfo", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU", "", "101"),
"25.9.1 (AMD proprietary shader compiler)", "1110"),
("RX 9070 XT, AMD's Windows driver (LLPC)", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU", "26.10.1 (LLPC)", "1010"),
("RX 7600, AMD's Windows driver, no driverInfo", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU", "", "1010"),
("AMD's driver naming another shader compiler", 0x1002, "AMD_PROPRIETARY", "DISCRETE_GPU", "26.10.1 (LLPC shader compiler)",
"101"),
("RX 580, RADV", 0x1002, "MESA_RADV", "DISCRETE_GPU", "Mesa 26.2.5", "101"),
("Steam Deck, RADV", 0x1002, "MESA_RADV", "INTEGRATED_GPU", "Mesa 25.1.0", "101"),
("RX 6800, AMDVLK", 0x1002, "AMD_OPEN_SOURCE", "DISCRETE_GPU", "2025.Q2.1 (LLPC)", "101"),
("UHD Graphics, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "INTEGRATED_GPU", "101.7088", "101"),
("Iris Xe, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "INTEGRATED_GPU", "101.7092", "101"),
("Arc B580, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "DISCRETE_GPU", "101.8132", "101"),
("Iris Xe, ANV", 0x8086, "INTEL_OPEN_SOURCE_MESA", "INTEGRATED_GPU", "Mesa 26.0.1", "101"),
("llvmpipe", 0x10005, "MESA_LLVMPIPE", "CPU", "Mesa 26.0.1 (LLVM 20.1.8)", "100"),
"1010"),
("RX 580, RADV", 0x1002, "MESA_RADV", "DISCRETE_GPU", "Mesa 26.2.5", "1010"),
("Steam Deck, RADV", 0x1002, "MESA_RADV", "INTEGRATED_GPU", "Mesa 25.1.0", "1010"),
("RX 6800, AMDVLK", 0x1002, "AMD_OPEN_SOURCE", "DISCRETE_GPU", "2025.Q2.1 (LLPC)", "1010"),
("UHD Graphics, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "INTEGRATED_GPU", "101.7088", "1011"),
("Iris Xe, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "INTEGRATED_GPU", "101.7092", "1011"),
("Arc B580, Intel's Windows driver", 0x8086, "INTEL_PROPRIETARY_WINDOWS", "DISCRETE_GPU", "101.8132", "1011"),
("Arc B570, Intel's Windows driver (the file select's lost device, 11-30)", 0x8086, "INTEL_PROPRIETARY_WINDOWS",
"DISCRETE_GPU", "101.9175", "1011"),
("Iris Xe, ANV", 0x8086, "INTEL_OPEN_SOURCE_MESA", "INTEGRATED_GPU", "Mesa 26.0.1", "1010"),
("llvmpipe", 0x10005, "MESA_LLVMPIPE", "CPU", "Mesa 26.0.1 (LLVM 20.1.8)", "1000"),
]
FIELDS = ['fetch_bounds', 'nan_bits', 'gather_offset']
FIELDS = ['fetch_bounds', 'nan_bits', 'gather_offset', 'robust_buffers']
FIXTURE = r"""
#include <cstdio>
@@ -57,7 +60,7 @@ static const char* get(const char* name) {
return it == env.end() ? nullptr : it->second.c_str();
}
static void print(const char* what, const VendorFixes& x) {
std::printf("%s %d%d%d\n", what, x.fetch_bounds, x.nan_bits, x.gather_offset);
std::printf("%s %d%d%d%d\n", what, x.fetch_bounds, x.nan_bits, x.gather_offset, x.robust_buffers);
}
int main() {
struct D { const char* name; uint32_t vendor; VkDriverId driver; VkPhysicalDeviceType type; const char* info; };
@@ -71,7 +74,7 @@ int main() {
print(d.name, x);
vendor_fixes_env(x, get); // (no switch set: as it was)
print(d.name, x);
const char* names[] = {"RX_VK_FETCH_BOUNDS", "RX_VK_NAN_BITS", "RX_VK_GATHER_OFFSET"};
const char* names[] = {"RX_VK_FETCH_BOUNDS", "RX_VK_NAN_BITS", "RX_VK_GATHER_OFFSET", "RX_VK_ROBUST"};
for (const char* n : names)
for (const char* v : {"0", "1", ""}) {
env.clear();
@@ -101,9 +104,16 @@ def cut(text, marker):
def check_source():
main = (VK / "vk_main.cpp").read_text(encoding="utf-8")
at = main.index("dev.fixes = vendor_fixes(facts);")
for text in ("vendor_fixes_env(dev.fixes,",):
for text in ("vendor_fixes_env(dev.fixes,", "robust = robust || dev.fixes.robust_buffers;",
"robust2.robustBufferAccess2 = robust_ok ? VK_TRUE : VK_FALSE;"):
if main.find(text, at) < 0:
raise SystemExit("FAIL: vk_main.cpp: %s not after the fixes are made" % text)
# ((Triforce, 11-30) the Intel fix decides the device's robustness: robust_ok made once, after it, and the features from it
# before the device)
if main.count("robust_ok = robust &&") != 1 or main.find("robust_ok = robust &&") < at:
raise SystemExit("FAIL: vk_main.cpp: robust_ok is made before the vendor fixes")
if "f.features.robustBufferAccess = robust_ok ? VK_TRUE : VK_FALSE;" not in main[at:main.index("vkCreateDevice(dev.physical, &ci")]:
raise SystemExit("FAIL: vk_main.cpp: robustBufferAccess not set from robust_ok before the device")
if main.index("dev.fixes = vendor_fixes(facts);") > main.index("vkCreateDevice(dev.physical, &ci"):
raise SystemExit("FAIL: the fixes are made after the device")
for field in ("vendor_id = p2.properties.vendorID", "driver_id = drv.driverID", "device_type = p2.properties.deviceType",
@@ -153,7 +163,7 @@ def main():
if line.split()[-1] != want:
failures.append("%s: %s, expected %s" % (name, line.split()[-1], want))
for i, line in enumerate(lines[2:]):
switch, value = ["RX_VK_FETCH_BOUNDS", "RX_VK_NAN_BITS", "RX_VK_GATHER_OFFSET"][i // 3], ["0", "1", ""][i % 3]
switch, value = ["RX_VK_FETCH_BOUNDS", "RX_VK_NAN_BITS", "RX_VK_GATHER_OFFSET", "RX_VK_ROBUST"][i // 3], ["0", "1", ""][i % 3]
got = list(line.split()[-1])
expect = list(want)
if value: