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

@@ -254,16 +254,28 @@ struct Parts {
/// 0.8.5.1 turned it off. Now, by default, a readback waits for the last part where the CPU writes the range after reading it
/// (kRecEndCpuWritten: the exposure meter, whose late read lost the CPU's 0 and flashed), and for the first part, as before,
/// where it only reads it (a frame late at worst, then the next read has it). vk_memory.cpp memory_rb_cpu_written
enum RecEnd { kRecEndOff = 0, kRecEndAll = 1, kRecEndCpuWritten = 2 };
/// The mode from the switch's text: unset or empty, 2 (the CPU-written ranges); 0 or a word (atoi, as the renderer's other
/// switches), off: the first part, as before; 1, every readback, as 0.8.5; another number, 2
inline int rec_end_mode(const char* text) {
if (!text || !*text) return kRecEndCpuWritten;
/// ((Triforce, 11-29) kRecEndRange: mode 2, and a range the CPU only reads waits for the part that copied it back (Parts' range,
/// readback_range_wait below), not the recording's first part. The first part is the first ~32 draws where a submission's parts end
/// at the game's render passes (vk_replay.cpp pass_end_parts, on NVIDIA's driver by default since 11-29): a result written back
/// in a later part was read as it was a frame before, and one of them moves OoT's exposure: with the camera moving the whole
/// picture went ~5 levels brighter for 15 presents and back, three times in 30 s at Kakariko (the performance session's
/// moving-camera picture check), and never with the parts counted (240 draws, the first part 240 too) or with mode 1)
enum RecEnd { kRecEndOff = 0, kRecEndAll = 1, kRecEndCpuWritten = 2, kRecEndRange = 3 };
/// The mode from the switch's text: unset or empty, `unset` (2, the CPU-written ranges; ((Triforce, 11-29, the owner's
/// decision)) 3 where a submission's parts end at the game's render passes: vk_replay.cpp rb_rec_end_mode); 0 or a word (atoi,
/// as the renderer's other switches), off: the first part, as before; 1, every readback, as 0.8.5; 3, 2 and the read-only
/// ranges at their part; another number, 2
inline int rec_end_mode(const char* text, int unset = kRecEndCpuWritten) {
if (!text || !*text) return unset;
const int v = std::atoi(text);
return v == 0 ? kRecEndOff : v == 1 ? kRecEndAll : kRecEndCpuWritten;
return v == 0 ? kRecEndOff : v == 1 ? kRecEndAll : v == 3 ? kRecEndRange : kRecEndCpuWritten;
}
/// Whether a readback takes the last-part rule: by the mode, and in mode 2 whether the CPU writes its range (cpu_written)
inline bool rec_end_applies(int mode, bool cpu_written) { return mode == kRecEndAll || (mode == kRecEndCpuWritten && cpu_written); }
/// Whether a readback takes the last-part rule: by the mode, and in modes 2 and 3 whether the CPU writes its range (cpu_written)
inline bool rec_end_applies(int mode, bool cpu_written) {
return mode == kRecEndAll || ((mode == kRecEndCpuWritten || mode == kRecEndRange) && cpu_written);
}
/// ((Triforce, 11-29) Whether a readback the last-part rule did not take waits for its range's part (mode 3), not the first part
inline bool range_applies(int mode, bool cpu_written) { return mode == kRecEndRange && !cpu_written; }
/// The switch on at all (a mode other than 0)
inline bool rec_end_on(const char* text) { return rec_end_mode(text) != kRecEndOff; }
@@ -329,4 +341,55 @@ ReadbackWait readback_wait(bool rec_end, D& d) {
return r;
}
/// ((Triforce, 11-29) RX_VK_RB_REC_END=3's wait for a range the CPU only reads: the part whose write-back covered the range (d's
/// range_seq: vk_memory.cpp memory_wb_part_seq, the part's batch noted at its submit), not the recording's first part. While no part
/// of the recording is known to have copied the range back, the newest part submitted is waited for and the recording looked at
/// again between 1 ms slices of the submissions' timeline (as the last-part rule), until the range's part is known (then that part),
/// the recording has ended (then all its parts are done: a range none of them noted, its runs dropped once done, is not waited for
/// again), or the timeline reaches the value. A range one part copied back and a later one copies again is read at the first of
/// them (the result of that part: a frame late at worst, as before, but never at the first part when a later one wrote it). A
/// recording whose parts are not known at all: the first part, as before (the old lookup), else the caller's fallback.
/// d as readback_wait's, with uint64_t range_seq() the part that copied the read's range back, 0 while none is known
template <class D>
ReadbackWait readback_range_wait(D& d) {
ReadbackWait r;
Parts::Entry e = d.look();
if (!e.seq) {
const uint64_t seq = d.first_part();
if (!seq) return r;
r.known = true;
r.ok = d.rec_wait(seq) == 0;
return r;
}
r.known = true;
for (;;) {
const uint64_t rs = d.range_seq();
if (rs) { // (the part that copied the range back)
r.ok = d.rec_wait(rs) == 0;
return r;
}
if (d.rec_wait(e.seq) != 0) return r; // (the newest part submitted: never past what the recording has sent)
if (e.ended) {
r.ok = true;
return r;
}
r.went_on = true; // (a part, and the range not copied back by any part submitted yet)
for (;;) {
d.flush(); // (a batched submit's part is noted once the batch goes out: RX_VK_PEND_HELD)
const Parts::Entry n = d.look();
if (n.ended || n.seq != e.seq || d.range_seq()) {
e = n;
break;
}
const int s = d.slice();
r.slices++;
if (s == 0) { // (the timeline at the value: every recording up to it done)
r.ok = true;
return r;
}
if (s != 1) return r;
}
}
}
} // namespace mkwvk::wb_rec_wait