mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-28 20:08:51 -04:00
Triforce v0.8.5
A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
@@ -164,6 +164,9 @@ std::map<uint64_t, uint64_t> value_rec; // submission value (or a recording'
|
||||
// recording's own value at its first part's submit, which a wait for a write-back may not stop at. Noted at the submit that ends
|
||||
// the recording, not a part's (submit_recording's part). rec_map_mu; wb_rec_wait.h)
|
||||
::mkwvk::wb_rec_wait::Finished fin_rec;
|
||||
// ((Triforce, 11-27) the recordings by their own value, the value their write-backs are noted under: the newest part submitted and
|
||||
// whether it ended the recording, for a readback's wait (readback_rec_wait; wb_rec_wait.h Parts). rec_map_mu)
|
||||
::mkwvk::wb_rec_wait::Parts rec_parts_by_value;
|
||||
std::unordered_map<uint64_t, uint64_t> q_last; // queue -> its last submission's value (sync_order_mu)
|
||||
std::map<uint64_t, uint64_t> value_queue; // a submission's value -> its queue (sync_order_mu)
|
||||
std::atomic<uint64_t> pushed{0};
|
||||
@@ -222,10 +225,14 @@ const bool rec_thread_hook = (::mkwvk::rec::g_thread_start_hook = [] {
|
||||
// (Triforce, lab) RX_VK_LAB_AB's knob norec: in its phases the replay makes its calls directly with the recorder thread on, what the
|
||||
// recorder gives the frame measured in one run (vk_recorder.h DrainingMutex::enter)
|
||||
const bool rec_direct_hook = (::mkwvk::rec::g_direct_hook = [] { return lab_ab::on("norec"); }, true);
|
||||
// ((Triforce) Threaded rendering's recorder (threaded_rendering.h): the hand-off by part with RX_VK_RECORDER_PARTS unset; the queue
|
||||
// locks tell the recorder when they are taken and let go (vk_internal.h QueueMutex; the hook does nothing without the hand-off)
|
||||
const bool rec_parts_hooks = (::mkwvk::rec::g_parts_default = [] { return threaded_on(); },
|
||||
::mkwvk::queue_lock_hook = ::mkwvk::rec::queue_lock_event, true);
|
||||
// ((Triforce) The recorder's hand-off by part (vk_recorder.h): the queue locks tell the recorder when they are taken and let go
|
||||
// (vk_internal.h QueueMutex; the hook does nothing without the hand-off). ((Triforce, 11-27) The hand-off is no longer Threaded
|
||||
// rendering's to turn on (rec::g_parts_default left unset): RX_VK_RECORDER_PARTS=1 alone does. The owner's F8 capture (RX 7900 XT,
|
||||
// AMD FSR 4.1 at 67%, RenoDX, 21:9: black characters, white ferns) and the lab's runs at the Kokiri Forest chest: Threaded rendering
|
||||
// On drew the 3D with wrong textures, in v0.8.3 as in this build; every piece of it on but the hand-off (RX_VK_RECORDER_PARTS=0), the
|
||||
// picture right at Off's frame rate (79-80 fps against 80); the hand-off without the render thread (RX_VK_ASYNC=0), a white 3D.
|
||||
// What in the hand-off draws them wrong is not found yet)
|
||||
const bool rec_parts_hooks = (::mkwvk::queue_lock_hook = ::mkwvk::rec::queue_lock_event, true);
|
||||
// ((Triforce) RX_VK_RECORDER_IDLE=wait, and the hand-off by part: the recorder's idle waits on its ring counter. Windows: from
|
||||
// kernelbase.dll, without linking Synchronization.lib; Linux: host/posix's, a futex)
|
||||
const bool rec_wait_hooks = [] {
|
||||
@@ -1203,7 +1210,7 @@ void gpu_time_end(Recording& r, bool uploads) {
|
||||
// (at its 1st and every 10th) by the first 64 report addresses with their counts.
|
||||
// Lab: RX_VK_LAB_AB naming the knob occq runs the queries the whole run; a report placed in a phase without the knob gets
|
||||
// no count written (4096 stays, as before).
|
||||
constexpr uint32_t kOccPerSlot = 1024; // (a recording is ~120 draws, a segment ~160 or more; a count is a query a pass)
|
||||
constexpr uint32_t kOccPerSlot = 1024; // (a recording is ~120-512 draws, a segment ~160 or more; a count is a query a pass)
|
||||
struct OccSlot {
|
||||
uint32_t used = 0; // (queries of the block taken by the recording made in it, not yet reset)
|
||||
bool armed = false; // (its block is reset: queries may begin)
|
||||
@@ -1847,7 +1854,7 @@ void submit_recording(Recording& r, bool signal_value = true, uint64_t signal_at
|
||||
if (!seq) return;
|
||||
std::lock_guard mk(rec_map_mu);
|
||||
// (upstream #2419, behind RX_VK_REC_LAST: a submission recorded in parts maps its value to its LAST part. emplace keeps
|
||||
// the first, and a wait for the submission through wait_recorded comes back after its first ~120 draws)
|
||||
// the first, and a wait for the submission through wait_recorded comes back after its first part)
|
||||
const bool last_part = rb_fix(0);
|
||||
const auto finished_in = [&](uint64_t v) {
|
||||
auto it = value_rec.find(v);
|
||||
@@ -1856,6 +1863,7 @@ void submit_recording(Recording& r, bool signal_value = true, uint64_t signal_at
|
||||
};
|
||||
for (uint64_t v : rec_open_values) finished_in(v);
|
||||
fin_rec.submitted(rec_open_values, seq, !part); // ((Triforce, wp20) a part's: noted at the recording's end)
|
||||
rec_parts_by_value.part_submitted(r.value, seq, part); // ((Triforce, 11-27) every part, for a readback's wait: readback_rec_wait)
|
||||
if (r.value) finished_in(r.value);
|
||||
rec_open_values.clear();
|
||||
// (RX_VK_FENCE_POLL_FAST: after value_rec has them, under rec_map_mu, so a poll that sees the mark finds the recording)
|
||||
@@ -3550,7 +3558,7 @@ void replay(VkCommandBuffer& cmd, NvnState& s, const uint8_t* p, const uint8_t*
|
||||
}
|
||||
}
|
||||
|
||||
// ---- chunks: a long submission goes to the GPU in parts (RX_VK_CHUNK=<draws and dispatches a part>, default 120;
|
||||
// ---- chunks: a long submission goes to the GPU in parts (RX_VK_CHUNK=<draws and dispatches a part>, unset: the driver's default;
|
||||
// 0: whole), so the GPU starts on its first part while the rest is recorded. The game waits for its fences within
|
||||
// the frame: with the whole submission recorded before the GPU saw any of it, its wait was the replay's time plus
|
||||
// the GPU's. Only the last part signals the submission's timeline value; the parts' slots free with it. ----
|
||||
@@ -3576,22 +3584,30 @@ int par_seg_most() {
|
||||
return v;
|
||||
}
|
||||
|
||||
bool pass_end_parts_on(); // (Threaded rendering's parts on: below)
|
||||
|
||||
/// ((Triforce, 11-22, the performance audit's SYNC-66, after Source B's; barrier_rules.h part_draws) A part's size: RX_VK_CHUNK
|
||||
/// when it is set, read once; else the RX_VK_LAB_AB knob chunk:<n> in its phases, read at each call, and the driver's default
|
||||
/// outside them (120 for every driver until the lab picks). It was a static of maybe_split: no knob could change it in a run
|
||||
/// outside them (240 on NVIDIA's driver, VK_DRIVER_ID_NVIDIA_PROPRIETARY, since 11-26, measured; 120 for every other driver,
|
||||
/// NVK on an NVIDIA card too, until the lab picks). It was a static of maybe_split: no knob could change it in a run. Read only
|
||||
/// where parts are counted: Threaded rendering's parts end at the game's pass ends outside the knob's phases (pass_end_parts)
|
||||
int64_t part_draws() {
|
||||
static const char* const env = getenv("RX_VK_CHUNK");
|
||||
static const int64_t env_value = env ? atoll(env) : 0;
|
||||
static const int64_t by_driver = [] {
|
||||
bool radv = false;
|
||||
VkPhysicalDeviceDriverProperties dp{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES};
|
||||
VkPhysicalDeviceProperties2 p2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
|
||||
p2.pNext = &dp;
|
||||
if (dev.physical) vkGetPhysicalDeviceProperties2(dev.physical, &p2), radv = dp.driverID == VK_DRIVER_ID_MESA_RADV;
|
||||
const int64_t v = barrier_rules::part_draws_default(dev.props.vendorID, radv);
|
||||
const int64_t v = barrier_rules::part_draws_default((uint32_t)dev.driver_id);
|
||||
// (with Threaded rendering's parts on, the size printed decides only in the knob's phases, and there only when RX_VK_CHUNK
|
||||
// is set: unset, the knob's own number decides in its phases, and the driver's default nowhere)
|
||||
const char* const not_in_force =
|
||||
!pass_end_parts_on() ? ""
|
||||
: env ? "; not in force outside the knob's phases: a part ends where the game ends its render pass (Threaded rendering, "
|
||||
"RX_VK_PART_PASS_END)"
|
||||
: "; not in force: a part ends where the game ends its render pass (Threaded rendering, RX_VK_PART_PASS_END; the "
|
||||
"knob's phases are counted)";
|
||||
logf("vk: a submission's parts: %lld draws and dispatches each (RX_VK_CHUNK%s%s; 0: whole submissions; this driver's default "
|
||||
"%lld; the lab knob chunk:<n> in its phases when the variable is unset)",
|
||||
(long long)barrier_rules::part_draws(env != nullptr, env_value, v), env ? "=" : " unset", env ? env : "", (long long)v);
|
||||
"%lld; the lab knob chunk:<n> in its phases when the variable is unset)%s",
|
||||
(long long)barrier_rules::part_draws(env != nullptr, env_value, v), env ? "=" : " unset", env ? env : "", (long long)v,
|
||||
not_in_force);
|
||||
return v;
|
||||
}();
|
||||
return barrier_rules::part_draws(env != nullptr, env_value, lab_ab::value_of("chunk", by_driver));
|
||||
@@ -3607,7 +3623,7 @@ int64_t part_draws() {
|
||||
// Measured on a renderer of the same base: in the Market faster than a part every 240 in all of 9 rounds paired (median standing
|
||||
// +4%, walking +15%, turning +2.5%; walking's 99th percentile 26.8 ms against 36.7, frames over 50 ms 20 against 44), and no
|
||||
// part ended inside a pass but at the ceiling. On with Threaded rendering and RX_VK_CHUNK unset; RX_VK_PART_PASS_END=1 on any
|
||||
// run, =0 off (the count, as before). Not with the lab knob chunk:<n> in its phases (part_draws decides there)
|
||||
// run, =0 off (counted parts of part_draws' size). Not with the lab knob chunk:<n> in its phases (part_draws decides there)
|
||||
struct PassEndParts {
|
||||
bool on = false;
|
||||
int64_t min = 120, max = 512, first = 32;
|
||||
@@ -3624,12 +3640,14 @@ PassEndParts& pass_end_parts() {
|
||||
v.first = std::clamp<int64_t>(num("RX_VK_PART_FIRST", 32), 0, v.min);
|
||||
if (v.on)
|
||||
logf("vk: a submission's parts end where the game has ended its render pass, from %lld draws and dispatches (the first "
|
||||
"part from %lld), at %lld at the latest (Threaded rendering; RX_VK_PART_PASS_END=0: every RX_VK_CHUNK, as before)",
|
||||
"part from %lld), at %lld at the latest (Threaded rendering; RX_VK_PART_PASS_END=0: counted parts of RX_VK_CHUNK or "
|
||||
"the driver's default, RX_VK_CHUNK=120 the size before)",
|
||||
(long long)v.min, (long long)v.first, (long long)v.max);
|
||||
return v;
|
||||
}();
|
||||
return p;
|
||||
}
|
||||
bool pass_end_parts_on() { return pass_end_parts().on; }
|
||||
|
||||
// ((Triforce, RX_VK_DRY_SHORT) a short command buffer replay_handle records on the replay thread in place of its dry pass and
|
||||
// one segment: one segment's worth, and a segment is not split)
|
||||
@@ -6173,6 +6191,105 @@ bool wait_recorded(uint64_t f, uint64_t timeout_ns, int* ok) {
|
||||
if (lost) wait_lost("a wait for recording", seq);
|
||||
return true;
|
||||
}
|
||||
/// ((Triforce, 11-27) RX_VK_RB_REC_END: a readback's wait for its write-back ends at the LAST part of the recording that writes it
|
||||
/// back, not the first (wb_rec_wait.h readback_wait: the exposure meter read as 0 between a recording's parts, the brightness
|
||||
/// flashes). On unless =0, read once
|
||||
bool rb_rec_end_on() {
|
||||
static const bool v = [] {
|
||||
const bool on = ::mkwvk::wb_rec_wait::rec_end_on(getenv("RX_VK_RB_REC_END"));
|
||||
logf("vk: a readback waits for %s (RX_VK_RB_REC_END%s)",
|
||||
on ? "the last part of the recording that writes it back" : "the first part of the recording that writes it back, as before",
|
||||
on ? "=0: the first part, as before" : "=0");
|
||||
return on;
|
||||
}();
|
||||
return v;
|
||||
}
|
||||
std::atomic<int64_t> st_rb_went_on{0}, st_rb_went_on_ns{0}; // ((Triforce, 11-27) readbacks whose writer's recording went on past a part)
|
||||
/// ((Triforce, 11-27) A readback's wait for write-back value v on the recordings' timeline, by the rule (rb_rec_end_on): true when
|
||||
/// the writer's recording is known (the result in *ok, as wait_recorded), false when it is not (the caller's fallback)
|
||||
bool readback_rec_wait(uint64_t v, int* ok) {
|
||||
if (!rec_timeline || per_queue_fences_off()) return false;
|
||||
struct Calls {
|
||||
uint64_t v;
|
||||
uint64_t first_part() {
|
||||
std::lock_guard mk(rec_map_mu);
|
||||
const auto it = value_rec.find(v);
|
||||
return it == value_rec.end() ? 0 : it->second;
|
||||
}
|
||||
::mkwvk::wb_rec_wait::Parts::Entry look() {
|
||||
std::lock_guard mk(rec_map_mu);
|
||||
return rec_parts_by_value.of(v);
|
||||
}
|
||||
int rec_wait(uint64_t seq) { // (as wait_recorded: done on the timeline already, no flush; else flushed, then waited)
|
||||
uint64_t rec_done = 0;
|
||||
if (pend_held_on() && vkGetSemaphoreCounterValue(dev.device, rec_timeline, &rec_done) == VK_SUCCESS && rec_done >= seq)
|
||||
return 0;
|
||||
queue_flush_for(FR_WAIT);
|
||||
VkSemaphoreWaitInfo wi{VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO};
|
||||
wi.semaphoreCount = 1;
|
||||
wi.pSemaphores = &rec_timeline;
|
||||
wi.pValues = &seq;
|
||||
const VkResult res = vkWaitSemaphores(dev.device, &wi, UINT64_MAX);
|
||||
wait_rec_result = res;
|
||||
// (said as a lost device, as wait_recorded says it; the next submit or the GPU hang watch ends the game, as there)
|
||||
const bool lost = res == VK_ERROR_DEVICE_LOST;
|
||||
if (lost) wait_lost("a readback's wait for recording", seq);
|
||||
return res == VK_SUCCESS ? 0 : 2;
|
||||
}
|
||||
void flush() { queue_flush_for(FR_WAIT); }
|
||||
int slice() {
|
||||
VkSemaphoreWaitInfo wi{VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO};
|
||||
wi.semaphoreCount = 1;
|
||||
wi.pSemaphores = &timeline;
|
||||
wi.pValues = &v;
|
||||
const VkResult res = vkWaitSemaphores(dev.device, &wi, ::mkwvk::wb_rec_wait::kSliceNs);
|
||||
return res == VK_SUCCESS ? 0 : res == VK_TIMEOUT ? 1 : 2;
|
||||
}
|
||||
} calls{v};
|
||||
GpuWaitTimer gwt("readback_rec_wait", v);
|
||||
const auto t0 = std::chrono::steady_clock::now();
|
||||
const ::mkwvk::wb_rec_wait::ReadbackWait r = ::mkwvk::wb_rec_wait::readback_wait(rb_rec_end_on(), calls);
|
||||
if (!r.known) return false;
|
||||
*ok = r.ok ? 1 : 0;
|
||||
if (r.went_on)
|
||||
st_rb_went_on.fetch_add(1, std::memory_order_relaxed),
|
||||
st_rb_went_on_ns.fetch_add(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now() - t0).count(),
|
||||
std::memory_order_relaxed);
|
||||
return true;
|
||||
}
|
||||
// ((Triforce, 11-27) The three below are invalidate's new lines, kept out of it: the renderer's play profile matches a function
|
||||
// by a hash of its control flow (if, ?:, !, &&, ||), and an `if` or `?:` added in invalidate (or `!` in submit_recording's
|
||||
// note) left both at plain -O2, invalidate's ~460,000 calls a benchmark run among them. A call in place of a call keeps it.
|
||||
/// A readback's wait on the recordings' timeline: by the rule (readback_rec_wait), or the first part as before (wait_recorded)
|
||||
bool readback_recorded_wait(uint64_t v, int* ok) {
|
||||
return rb_rec_end_on() ? readback_rec_wait(v, ok) : wait_recorded(v, UINT64_MAX, ok);
|
||||
}
|
||||
/// RX_VK_LOG_READBACK_ZERO's line, with the writer's recording now: its first part (the old wait's), its newest part and
|
||||
/// whether that ended it, and the recordings' timeline (a read between the parts waited for the first alone)
|
||||
void readback_zero_line(long long presents, uint64_t gpu, uint64_t size, uint64_t fence, uint64_t v, int behind, int waited) {
|
||||
uint64_t first = 0, rec_done = 0;
|
||||
::mkwvk::wb_rec_wait::Parts::Entry e;
|
||||
{
|
||||
std::lock_guard mk(rec_map_mu);
|
||||
const auto it = value_rec.find(v);
|
||||
if (it != value_rec.end()) first = it->second;
|
||||
e = rec_parts_by_value.of(v);
|
||||
}
|
||||
if (rec_timeline) vkGetSemaphoreCounterValue(dev.device, rec_timeline, &rec_done);
|
||||
logf("vk: readback zero %lld %#llx +%#llx: all 0 where it was not at its last readback (fence %llu, GPU done %llu, "
|
||||
"its write-back %llu, the replay behind %d, waited %d; its recording's first part %llu, newest %llu%s, "
|
||||
"recordings done %llu)", presents, (unsigned long long)gpu, (unsigned long long)size, (unsigned long long)fence,
|
||||
(unsigned long long)completed(), (unsigned long long)v, behind, waited, (unsigned long long)first,
|
||||
(unsigned long long)e.seq, e.ended ? " (ended)" : " (goes on)", (unsigned long long)rec_done);
|
||||
}
|
||||
/// The 3000-readback line's count of the readbacks whose writer's recording went on past the part first found (the old wait
|
||||
/// ended there)
|
||||
void readback_went_on_line() {
|
||||
if (const int64_t on = st_rb_went_on.exchange(0))
|
||||
logf("vk: readbacks of GPU results: %lld of them found their writer's recording going on past a part and waited for "
|
||||
"its last part, %.2f ms each (RX_VK_RB_REC_END=0: the first part, as before)",
|
||||
(long long)on, st_rb_went_on_ns.exchange(0) / (double)on / 1e6);
|
||||
}
|
||||
// ((Triforce, 11-22, the performance audit's SYNC-122, after Source B's) A readback whose write-back is not recorded yet
|
||||
// (wait_recorded said so: its writer is still being recorded, or stopped at an event wait). It waited on the submissions'
|
||||
// timeline with no bound and never looked again: recorded and done a moment later, the read still waited for every older
|
||||
@@ -6680,10 +6797,11 @@ void invalidate(uint64_t gpu, uint64_t size) {
|
||||
}
|
||||
} else if (!is_late && v > completed()) {
|
||||
int ok = 0;
|
||||
if (!(unforced && wait_recorded(v, UINT64_MAX, &ok))) {
|
||||
// ((Triforce, 11-27) RX_VK_RB_REC_END, on: the last part of the writer's recording, not its first (readback_recorded_wait)
|
||||
if (!(unforced && readback_recorded_wait(v, &ok))) {
|
||||
if (unforced && !async_on() && replay_behind()) wait_queue_empty(); // (not recorded whole: as before)
|
||||
if (async_unforced()) { // (its recording is being made: when the replay thread has it, on its timeline)
|
||||
while (completed() < v && !wait_recorded(v, UINT64_MAX, &ok) && async_wait_step(v)) {}
|
||||
while (completed() < v && !readback_recorded_wait(v, &ok) && async_wait_step(v)) {}
|
||||
if (completed() < v && !ok) wait_value(v);
|
||||
} else {
|
||||
// ((Triforce, 11-22, SYNC-122) the fallback: counted; in slices that look the recording up under
|
||||
@@ -6738,11 +6856,8 @@ void invalidate(uint64_t gpu, uint64_t size) {
|
||||
for (const uint32_t x : zw) nz |= x != 0;
|
||||
std::lock_guard zk(zm);
|
||||
uint8_t& l = last[gpu];
|
||||
if (l == 1 && !nz && zn++ < 6000)
|
||||
logf("vk: readback zero %lld %#llx +%#llx: all 0 where it was not at its last readback (fence %llu, GPU done %llu, "
|
||||
"its write-back %llu, the replay behind %d, waited %d)", (long long)presents_now, (unsigned long long)gpu,
|
||||
(unsigned long long)size, (unsigned long long)f0, (unsigned long long)completed(), (unsigned long long)v,
|
||||
(int)behind0, (int)w);
|
||||
if (l == 1 && !nz && zn++ < 6000) // ((Triforce, 11-27) with the writer's recording's parts: readback_zero_line)
|
||||
readback_zero_line((long long)presents_now, gpu, size, f0, v, (int)behind0, (int)w);
|
||||
l = nz ? 1 : 2;
|
||||
}
|
||||
}
|
||||
@@ -6771,6 +6886,7 @@ void invalidate(uint64_t gpu, uint64_t size) {
|
||||
"%.2f ms in all after it was done (counted with RX_VK_WB_WAIT_REC=2: what 1 would not have waited)",
|
||||
(long long)fb, fb_ns / (double)fb / 1e6, (long long)at_rec, (long long)held, held_ns / 1e6);
|
||||
}
|
||||
readback_went_on_line(); // ((Triforce, 11-27) those whose writer's recording went on past a part)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7521,8 +7637,27 @@ void log_frame_stats() {
|
||||
snprintf(libs, sizeof libs, "; %.2f library links tried (%.2f ms), %lld libraries the driver had and %lld cold in all; "
|
||||
"%lld of the cold built by workers (%.0f ms)", (links - l_links) / 120.0, (link_ms - l_link_ms) / 120.0,
|
||||
(long long)lib_hits, (long long)lib_cold, (long long)lib_built, lib_build_ms);
|
||||
logf("vk: a frame: %.0f draws kept their neighbour's descriptors (%.0f of them through other slots' registrations)",
|
||||
(draw_desc_reused() - l_reused) / 120.0, (draw_slotgen_saves() - l_saves) / 120.0);
|
||||
// ((Triforce, 11-26, the GPU audit's C02; pickwide.h, vk_shader.cpp program_for_wide) and the graphics draws' programs: by
|
||||
// the wide memo, by one pass over their answers, by program_for; with RX_VK_PICK_WIDE=check what the two ways differed in.
|
||||
// "by program_for" near the memo's count: more programs in a stretch of the frame than the memo holds, or one program object
|
||||
// drawn with three or more sets of vertex inputs or colour types in turn, each noted and replaced. With RX_VK_PICK_WIDE=0
|
||||
// and in the lab's nopickwide phases nothing is counted: the picks are 0 there but for what a thread held from before)
|
||||
int64_t pw[kProgramWideStats];
|
||||
static int64_t l_pw[kProgramWideStats];
|
||||
program_wide_stats(pw);
|
||||
char pw_check[320] = "";
|
||||
if (pw[6] || pw[7])
|
||||
snprintf(pw_check, sizeof pw_check, "; RX_VK_PICK_WIDE=check (every draw is program_for's, the memo's picks above were "
|
||||
"compared with it): %lld picks compared, %lld differences (%lld of them a program NOT of the bound textures' types) "
|
||||
"in all", (long long)pw[6], (long long)pw[7], (long long)pw[8]);
|
||||
logf("vk: a frame: %.0f draws kept their neighbour's descriptors (%.0f of them through other slots' registrations); "
|
||||
"%.0f program picks by the wide memo (%.0f past a uniform update), %.0f by one pass over their answers (%.0f of them "
|
||||
"a noted program's first, %.1f types compared), %.0f by program_for (%lld of its programs not of the textures at "
|
||||
"their next draw, in all)%s",
|
||||
(draw_desc_reused() - l_reused) / 120.0, (draw_slotgen_saves() - l_saves) / 120.0, (pw[0] - l_pw[0]) / 120.0,
|
||||
(pw[1] - l_pw[1]) / 120.0, (pw[2] - l_pw[2]) / 120.0, (pw[9] - l_pw[9]) / 120.0, (pw[4] - l_pw[4]) / 120.0,
|
||||
(pw[3] - l_pw[3]) / 120.0, (long long)pw[5], pw_check);
|
||||
std::memcpy(l_pw, pw, sizeof l_pw);
|
||||
l_reused = draw_desc_reused(), l_saves = draw_slotgen_saves();
|
||||
logf("vk: a frame: %.1f draws left out (not ready), %.2f waits for shaders or pipelines (%.1f ms); "
|
||||
"translation %.0f ms in all, %d jobs queued%s",
|
||||
@@ -10671,6 +10806,10 @@ int jitter_option(int id) {
|
||||
return (int)(d ? d : fsr3_inputs::jitter_size(axis));
|
||||
}
|
||||
|
||||
// ((Triforce, 11-27) the files still being written when the exit's wait ended (option_set's HOS_OPT_EXITING): the host asks
|
||||
// for it (option HOS_OPT_EXITING) and then ends the process without the libraries' unloading, host/hos_relaunch.c
|
||||
static std::atomic<int> exit_cut{0};
|
||||
|
||||
void fill_replay_table(MkwVkRenderer& t) {
|
||||
t.stats = stats;
|
||||
t.nvn_submit = submit;
|
||||
@@ -10686,6 +10825,8 @@ void fill_replay_table(MkwVkRenderer& t) {
|
||||
t.nvn_register_texture = register_texture_queued;
|
||||
t.nvn_event_signal = event_signal_queued;
|
||||
t.option = [](int id) -> int { // (3: the fixed path's scale in 1/10000, vk_menu.cpp; DLAA: full scale, vk_dlss.cpp)
|
||||
// ((Triforce, 11-27) host/hos_relaunch.c: a write cut at the exit; RX_VK_LAB_EXIT_CUT=1: as if one was (the lab's test)
|
||||
if (id == HOS_OPT_EXITING) return exit_cut.load() + (getenv("RX_VK_LAB_EXIT_CUT") && atoi(getenv("RX_VK_LAB_EXIT_CUT")) > 0);
|
||||
if (id == 11) return opts.stick_dead_zone;
|
||||
if (id == HOS_OPT_LSTICK_ZONE) return std::clamp(opts.lstick_dead_zone, -1, 50) + 1; // (0: none of its own)
|
||||
if (id == HOS_OPT_RSTICK_ZONE) return std::clamp(opts.rstick_dead_zone, -1, 50) + 1;
|
||||
@@ -10715,7 +10856,13 @@ void fill_replay_table(MkwVkRenderer& t) {
|
||||
return std::clamp(opts.pad_speaker_volume, 0, 200) | (std::clamp(opts.pad_speaker_sync, -100, 150) + 100) << 8 |
|
||||
std::clamp(opts.pad_speaker_headphone_volume, 0, 100) << 16;
|
||||
if (id == HOS_OPT_PAD_SPEAKER_HEADPHONES) return std::clamp(opts.pad_speaker_headphones, 0, 2);
|
||||
if (id == HOS_OPT_HDR_NATIVE) return dev.hdr && opts.hdr == 2;
|
||||
if (id == HOS_OPT_HDR_NATIVE) {
|
||||
// ((Triforce, 11-27, lab) RX_VK_LAB_HDR_NATIVE=1: the game told its display is HDR10 with no HDR swapchain, so it
|
||||
// makes its native HDR shaders on an SDR screen (their modules' checksums for RenoDX, RX_VK_DUMP_ALL_SPV); the
|
||||
// picture is wrong. Never for play)
|
||||
static const bool lab = getenv("RX_VK_LAB_HDR_NATIVE") && atoi(getenv("RX_VK_LAB_HDR_NATIVE")) == 1;
|
||||
return lab || (dev.hdr && opts.hdr == 2);
|
||||
}
|
||||
if (id == HOS_OPT_HDR_PEAK) return std::clamp(opts.hdr_peak, 400, 10000);
|
||||
if (id == HOS_OPT_HDR_WHITE) return std::clamp(opts.hdr_white, 80, 500);
|
||||
if (id == HOS_OPT_DISCORD) return opts.discord != 0;
|
||||
@@ -10767,7 +10914,11 @@ void fill_replay_table(MkwVkRenderer& t) {
|
||||
if (id == HOS_OPT_AUDIO_OUTPUT) return opts.audio_output; // ((Triforce) the Audio output row now: its Mono, host/nn_audio.c audio_mono)
|
||||
if (id == HOS_OPT_MUTE_BACKGROUND) return opts.mute_background != 0; // ((Triforce) the Mute in background row, host/nn_audio.c)
|
||||
if (id == HOS_OPT_MIC_GAIN) return std::clamp(opts.mic_gain, 25, 400); // ((Triforce) the Microphone gain row, host/nn_audio_in.c)
|
||||
return id == 0 ? opts.realtime : id == 1 ? menu_is_open() : id == 2 ? resolution_auto() && !temporal_full_scale() : id == 3 ? (temporal_full_scale() ? 10000 : resolution_scale()) : id == 4 ? opts.pad_background : id == 5 ? opts.text_speed : id == 6 ? opts.mouse_native :
|
||||
if (id == HOS_OPT_STEADY_ROW) return menu_steady_row(); // ((Triforce, 11-26) the Frame pacing row's Steady, now: host/nn_vi.c)
|
||||
// ((Triforce, 11-26) 2 and 3, the Render resolution as applied (vk_menu.h applied_resolution): host/nn_vi.c reads them
|
||||
// each frame, and the game remakes its 3D's targets when the scale changes. The 3D's full size by the applied choice
|
||||
// alone (resolution_full), not by what stands in for a while: a stand-in would remake them back and forth)
|
||||
return id == 0 ? opts.realtime : id == 1 ? menu_is_open() : id == 2 ? resolution_auto() && !resolution_full() : id == 3 ? (resolution_full() ? 10000 : resolution_scale()) : id == 4 ? opts.pad_background : id == 5 ? opts.text_speed : id == 6 ? opts.mouse_native :
|
||||
id == 7 ? opts.mouse_sens : id == 8 ? opts.mouse_invert : id == 9 ? opts.rumble : id == 16 ? opts.invert_cam_x : id == 17 ? opts.invert_cam_y : id == HOS_OPT_GYRO ? opts.gyro : id == HOS_OPT_GYRO_SENS_X ? opts.gyro_sens_x : id == HOS_OPT_GYRO_SENS_Y ? opts.gyro_sens_y : id == HOS_OPT_GYRO_INV_X ? opts.gyro_inv_x : id == HOS_OPT_GYRO_INV_Y ? opts.gyro_inv_y : id == HOS_OPT_GYRO_DEADZONE ? opts.gyro_deadzone :
|
||||
id == HOS_OPT_DLSS_JITTER_W || id == HOS_OPT_DLSS_JITTER_H || id == HOS_OPT_DLSS_JITTER_PHASES ? jitter_option(id) : 0;
|
||||
};
|
||||
@@ -10783,6 +10934,7 @@ void fill_replay_table(MkwVkRenderer& t) {
|
||||
t.option_set = [](int id, int value) {
|
||||
if (id == HOS_OPT_EXITING) { // ((Triforce, handoff §8) the files threads of their own are writing, finished first)
|
||||
const file_writers::Stopped s = file_writers::stop(file_writers::exit_wait_ms());
|
||||
exit_cut.store(s.left);
|
||||
if (s.left || s.waited_ms >= 1 || s.refused)
|
||||
logf("vk: exit: the files being written on threads of their own were waited for %.0f ms%s (%d not begun; "
|
||||
"RX_VK_WRITERS_WAIT_MS)", s.waited_ms, s.left ? (", " + std::to_string(s.left) + " still under way: cut, "
|
||||
|
||||
Reference in New Issue
Block a user