Triforce v0.8.5.2

Hotfix: the brightness flashes fixed without the fps cost (the readback wait only for ranges the CPU resets), and the Discord status names where Link is by default.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-28 15:45:28 -06:00
parent 0f7d57ac14
commit 8cb23131f9
13 changed files with 412 additions and 54 deletions

View File

@@ -71,10 +71,18 @@ def check_source():
check(replay.count("rec_parts_by_value.part_submitted(") == 1 and "rec_parts_by_value.submitted(" not in replay,
"vk_replay.cpp: the parts are noted somewhere past the registration")
on = function(replay, "bool rb_rec_end_on() {")
check('::mkwvk::wb_rec_wait::rec_end_on(getenv("RX_VK_RB_REC_END"))' in on and "static const bool v" in on,
on = function(replay, "int rb_rec_end_mode() {")
check('wr::rec_end_mode(getenv("RX_VK_RB_REC_END"))' in on and "static const int v" in on,
"RX_VK_RB_REC_END is not read once through the header's rule")
w = function(replay, "bool readback_rec_wait(uint64_t v, int* ok) {")
# ((Triforce, 11-28) mode 2, the default: the last-part rule only where the CPU writes the range after reading it)
fr = function(replay, "bool rb_rec_end_for(uint64_t guest, uint64_t size) {")
check("m == wr::kRecEndCpuWritten && memory_rb_cpu_written(guest, size)" in fr and "return wr::rec_end_applies(m, cpu);" in fr,
"rb_rec_end_for does not ask the memory whether the CPU writes the range (mode 2) through the header's rule")
mem = (ROOT / "gpu/vk/vk_memory.cpp").read_text(encoding="utf-8")
check(mem.count("memory_rb_cpu_collected(pages, n);") == 2, "the two collections of the CPU's pages do not both note the read-back pages")
check("memory_rb_watch(guest, size);" in function(mem, "void memory_note_readback(uint64_t guest, uint64_t size) {"),
"a readback's pages are not watched for the CPU's writes")
w = function(replay, "bool readback_rec_wait(uint64_t v, uint64_t guest, uint64_t size, int* ok) {")
for needle, why in (
("if (!rec_timeline || per_queue_fences_off()) return false;", "it waits by recordings where there are none"),
("::mkwvk::wb_rec_wait::readback_wait(rb_rec_end_on(), calls);", "it does not run the header's rule by the switch"),
@@ -92,15 +100,15 @@ def check_source():
"readback_rec_wait waits on the recordings' timeline before it flushes the held submits: a batched signal never comes")
check("pSemaphores = &rec_timeline;" in rw and "UINT64_MAX" in rw, "the recording's wait is not the recordings' timeline, unbounded")
both = function(replay, "bool readback_recorded_wait(uint64_t v, int* ok) {")
check("return rb_rec_end_on() ? readback_rec_wait(v, ok) : wait_recorded(v, UINT64_MAX, ok);" in both,
both = function(replay, "bool readback_recorded_wait(uint64_t v, uint64_t guest, uint64_t size, int* ok) {")
check("return rb_rec_end_for(guest, size) ? readback_rec_wait(v, guest, size, ok) : wait_recorded(v, UINT64_MAX, ok);" in both,
"readback_recorded_wait does not take the rule by the switch (the old wait kept for =0)")
inv = function(replay, "void invalidate(uint64_t gpu, uint64_t size) {")
check(inv.count("readback_recorded_wait(v, &ok)") == 2, "invalidate's two waits by recordings do not both take the rule")
check("if (!(unforced && readback_recorded_wait(v, &ok))) {" in inv, "the submitting thread's wait does not take the rule")
check("while (completed() < v && !readback_recorded_wait(v, &ok) && async_wait_step(v)) {}" in inv,
check(inv.count("readback_recorded_wait(v, host->gpu_guest(gpu), size, &ok)") == 2, "invalidate's two waits by recordings do not both take the rule")
check("if (!(unforced && readback_recorded_wait(v, host->gpu_guest(gpu), size, &ok))) {" in inv, "the submitting thread's wait does not take the rule")
check("while (completed() < v && !readback_recorded_wait(v, host->gpu_guest(gpu), size, &ok) && async_wait_step(v)) {}" in inv,
"the replay thread's wait does not take the rule")
for needle in ("readback_rec_wait(", "wait_recorded(", "rb_rec_end_on(", "rec_parts_by_value", "st_rb_went_on"):
for needle in ("readback_rec_wait(", "wait_recorded(", "rb_rec_end_on(", "rb_rec_end_for(", "memory_rb_cpu_written(", "rec_parts_by_value", "st_rb_went_on"):
check(needle not in inv, "invalidate holds %s itself: its branches change invalidate's control-flow hash, and the "
"renderer's play profile no longer matches it (keep them in the helpers)" % needle)
check("readback_zero_line((long long)presents_now, gpu, size, f0, v, (int)behind0, (int)w);" in inv,
@@ -114,7 +122,7 @@ def check_source():
"the 3000-readback line does not count the reads that waited past a part")
dev = (ROOT / "docs/development.md").read_text(encoding="utf-8")
rows = [line for line in dev.splitlines() if line.startswith("| `RX_VK_RB_REC_END=1` |")]
rows = [line for line in dev.splitlines() if line.startswith("| `RX_VK_RB_REC_END=0` |")]
check(len(rows) == 1, "docs/development.md: RX_VK_RB_REC_END is not in the switches table once")
check("tests/test_readback_rec_end.py" in rows[0] and "wb_rec_wait.h" in rows[0], "docs/development.md: the row names neither the rule nor its test")