mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.5.0
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
"""The GPUs whose task + mesh draws take the compute fallback by default (gpu/vk/vk_main.cpp, issue 996).
|
||||
|
||||
On AMD's Windows driver the native task + mesh path timed out the driver on Navi 22 (#1747) and on Navi 21: an RX 6800 XT lost
|
||||
the device within minutes at Hyrule Castle's entrance, and played 25 minutes there with none through the fallback. This checks
|
||||
that both chips are in the default, only for AMD and only on Windows, and that RX_VK_TASK_MESH_FALLBACK still decides over it.
|
||||
the device within minutes at Hyrule Castle's entrance, and played 25 minutes there with none through the fallback. The default
|
||||
was those two chips by their device ids. It is now every GPU of that driver's branch for RDNA 1 and 2 (the one whose
|
||||
driverInfo names the "AMD proprietary shader compiler"), which on a GPU with mesh shaders means RDNA 2: the RX 6600 and the
|
||||
other RX 6000 cards lost the device the same way in NX2navi, and the driver for RDNA 3 and 4 (LLPC) is left native.
|
||||
|
||||
This checks that the default is that branch, only for AMD and only on Windows, that no list of device ids narrows it again,
|
||||
that the branch is told by the driver and its driverInfo (the test tests/test_vendor_fixes.py runs on made-up devices for
|
||||
nan_bits, which is the same function), and that RX_VK_TASK_MESH_FALLBACK still decides over it.
|
||||
|
||||
python -I -B tests/test_task_mesh_fallback_devices.py
|
||||
"""
|
||||
@@ -10,32 +16,47 @@ from pathlib import Path
|
||||
import re
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DEVICES = {
|
||||
0x73BF: "Navi 21 (RX 6800, 6800 XT, 6900 XT)",
|
||||
0x73AF: "Navi 21 (RX 6900 XT, XTXH)",
|
||||
0x73A5: "Navi 21 (RX 6950 XT)",
|
||||
0x73DF: "Navi 22 (RX 6700 XT)",
|
||||
}
|
||||
|
||||
|
||||
def body(text, marker):
|
||||
start = text.index(marker)
|
||||
end = text.index("{", start) + 1
|
||||
depth = 1
|
||||
while depth:
|
||||
depth += (text[end] == "{") - (text[end] == "}")
|
||||
end += 1
|
||||
return text[start:end]
|
||||
|
||||
|
||||
def main():
|
||||
main_cpp = (ROOT / "gpu/vk/vk_main.cpp").read_text(encoding="utf-8")
|
||||
vendor = (ROOT / "gpu/vk/vk_vendor.h").read_text(encoding="utf-8")
|
||||
at = main_cpp.index("bool task_mesh_fallback = false;")
|
||||
block = main_cpp[at:main_cpp.index("dev.task_mesh_fallback =", at)]
|
||||
default = re.search(r"#ifdef _WIN32\n(.*?)#endif\n", block, re.S)
|
||||
assert default, "the default is no longer Windows-only"
|
||||
line = re.search(r"task_mesh_fallback = (.*?);", default.group(1), re.S)
|
||||
code = "\n".join(line for line in default.group(1).splitlines() if not line.strip().startswith("//"))
|
||||
line = re.search(r"task_mesh_fallback = (.*?);", code, re.S)
|
||||
assert line, "no default for task_mesh_fallback"
|
||||
cond = line.group(1)
|
||||
assert "dev.props.vendorID == 0x1002" in cond, "the default is not limited to AMD"
|
||||
ids = {int(x, 16) for x in re.findall(r"dev\.props\.deviceID == (0x[0-9a-fA-F]+)", cond)}
|
||||
for device, name in DEVICES.items():
|
||||
assert device in ids, "%s (0x%04x) is not in the default" % (name, device)
|
||||
assert ids == set(DEVICES), "unexpected devices in the default: %s" % sorted(hex(i) for i in ids - set(DEVICES))
|
||||
assert re.search(r"&&\s*amd_older\b", cond), "the default is not AMD's driver branch for RDNA 1 and 2"
|
||||
assert "deviceID" not in cond, "a list of device ids narrows the default again: the RX 6600 and others are left out"
|
||||
# (the branch is told once, from the driver's own properties, where the other vendor facts are read)
|
||||
assert "amd_older = amd_older_compiler(facts);" in main_cpp, "amd_older is not vk_vendor.h's amd_older_compiler"
|
||||
assert main_cpp.index("amd_older = amd_older_compiler(facts);") < at, "amd_older is set after the default reads it"
|
||||
rule = body(vendor, "inline bool amd_older_compiler(")
|
||||
assert "f.driver_id == VK_DRIVER_ID_AMD_PROPRIETARY" in rule and '"proprietary shader compiler"' in rule, \
|
||||
"amd_older_compiler no longer tells the branch by AMD's proprietary driver and its driverInfo"
|
||||
assert "x.nan_bits = amd_older_compiler(f);" in vendor, \
|
||||
"nan_bits is no longer the same branch: tests/test_vendor_fixes.py no longer checks amd_older_compiler on its devices"
|
||||
# (the environment variable is read after the default, so it decides for any GPU)
|
||||
override = block.index('getenv("RX_VK_TASK_MESH_FALLBACK")')
|
||||
assert override > default.end(), "RX_VK_TASK_MESH_FALLBACK is read before the default and is overwritten by it"
|
||||
print("PASS: task + mesh fallback by default on Windows for AMD's %s" % ", ".join(DEVICES.values()))
|
||||
# (and only a GPU with mesh shaders takes it: one without draws through the older fallback, as before)
|
||||
assert "dev.task_mesh_fallback = task_mesh_fallback && dev.mesh_shader" in main_cpp, \
|
||||
"the task + mesh fallback no longer needs a GPU with mesh shaders"
|
||||
print("PASS: task + mesh fallback by default on Windows for AMD's driver branch for RDNA 1 and 2")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user