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:
@@ -65,6 +65,10 @@
|
||||
#include "shadow_prev.h" // (Triforce: the texture shadow's pages taken again with bytes it holds, RX_VK_SHADOW_KEEP / _PREV)
|
||||
#include "page_table_census.h" // ((Triforce) the page table's windows, the census of the pools outside them, the cover
|
||||
#include "wb_excl_clip.h" // ((Triforce, 11-22) no write-back into memory the capture leaves out, RX_VK_WB_EXCL_CLIP)
|
||||
#include "cpuwordsseen.h" // ((Triforce, 11-26) a report word the sets hold is not noted again, RX_VK_CPU_WORDS_SEEN)
|
||||
#include "capgap.h" // ((Triforce, 11-26) the left-out check from the gaps found before, RX_VK_CAP_EXCL_GAP)
|
||||
#include "capunion.h" // ((Triforce, 11-26, C22) one union of the captures' range lists a version, its sorts as merges, RX_VK_CAP_UNION_SHARED)
|
||||
#include "bindspan.h" // ((Triforce, 11-26, C08) a read binding answered from a span of its pool's mirror, RX_VK_BIND_SPAN)
|
||||
#ifdef __linux__
|
||||
#include <cerrno>
|
||||
#include <dlfcn.h>
|
||||
@@ -122,6 +126,11 @@ struct Pool {
|
||||
// given back and made again left cyan in play and over the Start menu (RX 5500M, gone with RX_VK_MIRROR_KEEP=1); kept too)
|
||||
bool gpu_written = false;
|
||||
bool inherit_lost = false; // (retired, and the pool that took it in made no mirror in time to copy its GPU contents)
|
||||
// ((Triforce, 11-27, bindspan.h) made beside an import it overlaps, or overlapped by one so made (pool_lookup's plan past
|
||||
// 1 GB, pools_flag_overlapping): no bind span is filled for it, and its read bindings go by the page as before. Set under
|
||||
// pools_mu, read without it by gpu_buffer_bind (__atomic). Never cleared: it stays for the import's lifetime, also after
|
||||
// the import it overlapped is taken in or given back, which costs it only its spans (its bindings go as in v0.8.4)
|
||||
bool left_overlapping = false;
|
||||
// (EvilOOT) retired with its mirror on: the pool that took it in copies the GPU's contents from it when its own mirror is
|
||||
// made (mirror_make), and until then the mirror stays (mirrors_give_back)
|
||||
bool inherit_pending = false;
|
||||
@@ -1335,6 +1344,7 @@ namespace { void cap_view_bump(); } // (defined with cap_view_gen below, in th
|
||||
namespace {
|
||||
int cap_only_gpu();
|
||||
bool cap_excl_hit(uint64_t lo, uint64_t hi);
|
||||
bool cap_excl_hit_gap(uint64_t lo, uint64_t hi);
|
||||
bool cap_excl_page(uint64_t g);
|
||||
uint64_t cap_excl_kept(uint64_t lo, uint64_t hi, std::vector<std::pair<uint64_t, uint64_t>>& out);
|
||||
void cap_born_take(std::vector<std::pair<uint64_t, uint64_t>>& out);
|
||||
@@ -2648,7 +2658,8 @@ bool ranges_hit(const std::vector<std::pair<uint64_t, uint64_t>>& v, uint64_t lo
|
||||
}
|
||||
std::atomic<uint64_t> cap_excl_ver{1}; // (bumped at every change of cap_excl: the threads' copies below)
|
||||
/// whether [lo, hi) reaches into the left-out ranges: a thread's own copy of them, taken again only when they changed (the
|
||||
/// replay's reads and bindings ask at every uniform word and binding, from every recording thread: no lock there)
|
||||
/// write-back's clip and RX_VK_CAP_ONLY_GPU=2's page count ask it, and cap_excl_note with RX_VK_CAP_EXCL_GAP=0 or in the
|
||||
/// lab's nocapgap phases; by default the note asks cap_excl_hit_gap, from every recording thread: no lock there)
|
||||
bool cap_excl_hit(uint64_t lo, uint64_t hi) {
|
||||
static thread_local std::vector<std::pair<uint64_t, uint64_t>> mine;
|
||||
static thread_local uint64_t ver = 0;
|
||||
@@ -2660,6 +2671,61 @@ bool cap_excl_hit(uint64_t lo, uint64_t hi) {
|
||||
}
|
||||
return ranges_hit(mine, lo, hi);
|
||||
}
|
||||
/// ((Triforce, 11-26, the GPU audit's C09; capgap.h) cap_excl_hit for the count's question (cap_excl_note: every buffer
|
||||
/// binding, replay read and texture upload): answered from the last 8 gaps between left-out ranges this thread's searches
|
||||
/// found, searched only outside them; the memo is dropped with the thread's copy of the list at every change of it. The
|
||||
/// same answers as the search (the rule's test; RX_VK_CAP_EXCL_GAP=check runs both at every question, uses the search's
|
||||
/// and counts the differences, the first 20 logged). RX_VK_CAP_EXCL_GAP=0 and the lab's "nocapgap" phases: cap_excl_hit, as
|
||||
/// before. The write-back's clip and mode 2's page count ask cap_excl_hit itself. Counted a thread and added to the totals
|
||||
/// every 256 questions (the capture's 10 s line)
|
||||
std::atomic<int64_t> st_gap_memo{0}, st_gap_search{0}, st_gap_diff{0};
|
||||
bool cap_excl_hit_gap(uint64_t lo, uint64_t hi) {
|
||||
static const capgap::Mode env = [] {
|
||||
const char* e = getenv("RX_VK_CAP_EXCL_GAP");
|
||||
const capgap::Mode m = capgap::mode(e);
|
||||
if (m != capgap::kOn)
|
||||
logf("vk: the left-out ranges' check %s (RX_VK_CAP_EXCL_GAP)",
|
||||
m == capgap::kOff ? "searches at every question, as before" : "runs the gap memo and the search and counts differences");
|
||||
else if (e && e[0] && strcmp(e, "1"))
|
||||
logf("vk: RX_VK_CAP_EXCL_GAP=%s not known: the gap memo, as unset", e);
|
||||
return m;
|
||||
}();
|
||||
if (env == capgap::kOff) return cap_excl_hit(lo, hi); // (the switch says the search: no lab question)
|
||||
// (the lab knob's answer, asked again only when the phase moves: every phase pays the same load and compare a question,
|
||||
// where on()'s string compares at every question slowed the knobs' phases alone. on() loads the phase itself; a move
|
||||
// between the two loads is taken at the next question)
|
||||
static thread_local int lab_k = -1;
|
||||
static thread_local bool lab_off = false;
|
||||
if (const int k = lab_ab::active.load(std::memory_order_relaxed); k != lab_k) lab_k = k, lab_off = lab_ab::on("nocapgap");
|
||||
if (!capgap::use(env, lab_off)) return cap_excl_hit(lo, hi);
|
||||
static thread_local std::vector<std::pair<uint64_t, uint64_t>> mine;
|
||||
static thread_local uint64_t ver = 0;
|
||||
static thread_local capgap::Memo memo;
|
||||
static thread_local uint32_t n_memo = 0, n_search = 0;
|
||||
const uint64_t now = cap_excl_ver.load(std::memory_order_acquire);
|
||||
if (ver != now) {
|
||||
std::lock_guard lk(cap_excl_mu);
|
||||
mine = cap_excl;
|
||||
ver = cap_excl_ver.load(std::memory_order_relaxed);
|
||||
memo.clear(); // (its gaps were the old list's)
|
||||
}
|
||||
bool searched = false;
|
||||
const bool r = capgap::hit(memo, mine, lo, hi, &searched);
|
||||
if (searched) n_search++;
|
||||
else n_memo++;
|
||||
if (!((n_memo + n_search) & 255)) {
|
||||
st_gap_memo.fetch_add(n_memo, std::memory_order_relaxed), st_gap_search.fetch_add(n_search, std::memory_order_relaxed);
|
||||
n_memo = n_search = 0;
|
||||
}
|
||||
if (env == capgap::kCheck) {
|
||||
const bool old = ranges_hit(mine, lo, hi);
|
||||
if (old != r && st_gap_diff.fetch_add(1, std::memory_order_relaxed) < 20)
|
||||
logf("vk: RX_VK_CAP_EXCL_GAP=check: [%#llx, %#llx) the gap memo says %d, the search %d (%zu left-out ranges, version %llu)",
|
||||
(unsigned long long)lo, (unsigned long long)hi, (int)r, (int)old, mine.size(), (unsigned long long)ver);
|
||||
return old;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
/// cap_excl_hit for the 4 KB page at g, for a caller that asks in ascending order (a collection's pages): a cursor that walks on
|
||||
/// instead of a search for every page, started again by a search when the order goes back or the list changed
|
||||
bool cap_excl_page(uint64_t g) {
|
||||
@@ -2702,6 +2768,50 @@ void cap_born_take(std::vector<std::pair<uint64_t, uint64_t>>& out) {
|
||||
out.swap(born_stamp);
|
||||
born_stamp.clear();
|
||||
}
|
||||
// ((Triforce, 11-26, the GPU audit's C22; capunion.h; RX_VK_CAP_UNION_SHARED, on; =0: as before; =check: both ways, the
|
||||
// differences counted and the old lists used; the lab knob nocapunion: as before in its phases) The captures' union of the
|
||||
// range lists is built once each time a list changes and copied by its callers (capture_union_take_locked, below), its
|
||||
// sorts and the pool table's are merges of the runs that arrive sorted, and the pool table's look keeps the pools' first
|
||||
// captures only for RX_VK_CAPTURE_EAGER. The counts are the capture's 10 s line's (memory_cap_present)
|
||||
int cap_union_mode() {
|
||||
static const int v = [] {
|
||||
const char* e = getenv("RX_VK_CAP_UNION_SHARED");
|
||||
const int m = capunion::mode(e);
|
||||
if (m != capunion::ON)
|
||||
logf("vk: the captures' union of the range lists %s (RX_VK_CAP_UNION_SHARED)",
|
||||
m == capunion::CHECK ? "built both ways and compared" : "built by each caller, as before");
|
||||
else if (e && e[0] && strcmp(e, "1"))
|
||||
logf("vk: RX_VK_CAP_UNION_SHARED=%s not known: one union a version, as unset", e);
|
||||
return m;
|
||||
}();
|
||||
return v;
|
||||
}
|
||||
bool cap_union_shared() {
|
||||
return capunion::shared(cap_union_mode(), lab_ab::on("nocapunion"));
|
||||
}
|
||||
// (built: the shared union's builds; reused: a caller's copy of one built already; own: a caller's own build, the switch off
|
||||
// or the knob; sorts: runs that did not arrive sorted; diff: the check's lists that differ)
|
||||
std::atomic<int64_t> st_cu_built{0}, st_cu_reused{0}, st_cu_own{0}, st_cu_sorts{0}, st_cu_diff{0};
|
||||
void cap_union_differs(const char* what, size_t now, size_t before) {
|
||||
if (st_cu_diff.fetch_add(1, std::memory_order_relaxed) < 20)
|
||||
logf("vk: RX_VK_CAP_UNION_SHARED=check: a difference in %s (%zu ranges, %zu as before)", what, now, before);
|
||||
}
|
||||
/// ranges_merged of v, whose first cut ranges are one list and the rest another (cap_ranges_mu held, the shared union on):
|
||||
/// a merge when both arrive sorted; with the check, compared with ranges_merged, whose list is the one used (what: the
|
||||
/// list, for the check's log line)
|
||||
std::vector<std::pair<uint64_t, uint64_t>> cap_union_merged(std::vector<std::pair<uint64_t, uint64_t>> v, size_t cut, const char* what) {
|
||||
uint64_t sorts = 0;
|
||||
if (cap_union_mode() != capunion::CHECK) {
|
||||
auto m = capunion::merged_runs(std::move(v), cut, cut, &sorts);
|
||||
if (sorts) st_cu_sorts.fetch_add((int64_t)sorts, std::memory_order_relaxed);
|
||||
return m;
|
||||
}
|
||||
const auto m = capunion::merged_runs(v, cut, cut, &sorts);
|
||||
if (sorts) st_cu_sorts.fetch_add((int64_t)sorts, std::memory_order_relaxed);
|
||||
auto old = ranges_merged(std::move(v));
|
||||
if (m != old) cap_union_differs(what, m.size(), old.size());
|
||||
return old;
|
||||
}
|
||||
void refresh_pool_ranges_locked() { // (cap_ranges_mu held)
|
||||
if (!capture_pool_max() && !cap_only_gpu()) return;
|
||||
const uint32_t g = host->maps_generation();
|
||||
@@ -2711,33 +2821,50 @@ void refresh_pool_ranges_locked() { // (cap_ranges_mu held)
|
||||
const int n = host->gpu_pools(reinterpret_cast<uint64_t(*)[2]>(list.data()), (int)list.size());
|
||||
std::vector<std::pair<uint64_t, uint64_t>> v, every;
|
||||
std::unordered_map<uint64_t, uint64_t, PoolStartHash> seen;
|
||||
seen.reserve((size_t)std::max(n, 0));
|
||||
// ((Triforce, 11-26, C22) a pool's first capture is read by RX_VK_CAPTURE_EAGER alone: without it (the default) the map
|
||||
// is not made again at every look, a find and an insert a pool; RX_VK_CAP_UNION_SHARED=0 or the knob: as before.
|
||||
// =check skips it as the default does: without RX_VK_CAPTURE_EAGER it changes no list)
|
||||
const bool cu = cap_union_shared();
|
||||
const bool first_seen = capunion::first_seen_needed(eager_captures(), cu);
|
||||
if (first_seen) seen.reserve((size_t)std::max(n, 0));
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (list[i][1] && list[i][0] < (1ull << 40)) // (RX_VK_CAP_ONLY_GPU: every pool, whatever its size)
|
||||
every.push_back({list[i][0] & ~4095ull, (list[i][0] + list[i][1] + 4095) & ~4095ull});
|
||||
if (!list[i][1] || list[i][1] > capture_pool_max() || list[i][0] >= (1ull << 40)) continue;
|
||||
if (!first_seen) { // (no eager count: every small pool, as the test below lets through)
|
||||
v.push_back({list[i][0] & ~4095ull, (list[i][0] + list[i][1] + 4095) & ~4095ull});
|
||||
continue;
|
||||
}
|
||||
auto it = pool_first_seen.find(list[i][0]);
|
||||
const uint64_t first = it != pool_first_seen.end() ? it->second : captures_made;
|
||||
seen[list[i][0]] = first;
|
||||
if (!eager_captures() || captures_made - first < eager_captures())
|
||||
v.push_back({list[i][0] & ~4095ull, (list[i][0] + list[i][1] + 4095) & ~4095ull});
|
||||
}
|
||||
pool_first_seen.swap(seen);
|
||||
if (first_seen) pool_first_seen.swap(seen);
|
||||
// ((Triforce) the lists' version moves only when one of them changed, RX_VK_CAP_RANGES_SAME=0: at every look, as before. Each
|
||||
// move has the captures' union of the lists made again (capture_ranges_merged), and the look comes every 64 captures and at
|
||||
// every change of the pool table, mostly to find the same pools)
|
||||
static const bool same_kept = !(getenv("RX_VK_CAP_RANGES_SAME") && atoi(getenv("RX_VK_CAP_RANGES_SAME")) == 0);
|
||||
bool changed = !same_kept;
|
||||
if (cap_only_gpu()) {
|
||||
// ((Triforce, 11-26, C22) the host's pools and the recorded ones: two runs, each sorted where its source is in address
|
||||
// order (asked, not assumed), merged; the same list as the sort's)
|
||||
const size_t cut = every.size();
|
||||
pool_records_ranges(every);
|
||||
auto all = ranges_merged(std::move(every));
|
||||
auto all = cu ? cap_union_merged(std::move(every), cut, "the game's pools' list (all_pool_ranges)") : ranges_merged(std::move(every));
|
||||
if (all != all_pool_ranges) all_pool_ranges = std::move(all), changed = true;
|
||||
}
|
||||
std::sort(v.begin(), v.end());
|
||||
std::vector<std::pair<uint64_t, uint64_t>> m;
|
||||
for (const auto& r : v) {
|
||||
if (!m.empty() && r.first <= m.back().second) m.back().second = std::max(m.back().second, r.second);
|
||||
else m.push_back(r);
|
||||
if (cu) { // (one run)
|
||||
const size_t whole = v.size();
|
||||
m = cap_union_merged(std::move(v), whole, "the small pools' list (pool_cap_ranges)");
|
||||
} else {
|
||||
std::sort(v.begin(), v.end());
|
||||
for (const auto& r : v) {
|
||||
if (!m.empty() && r.first <= m.back().second) m.back().second = std::max(m.back().second, r.second);
|
||||
else m.push_back(r);
|
||||
}
|
||||
}
|
||||
if (m != pool_cap_ranges) pool_cap_ranges.swap(m), changed = true;
|
||||
if (changed) cap_ranges_ver++;
|
||||
@@ -2967,7 +3094,9 @@ void publish_tex_spans(uint64_t frame) {
|
||||
cap_ranges_ver++;
|
||||
}
|
||||
/// the captures' ranges: the mirrored imports (clipped to the GPU-visible memory with RX_VK_CAP_ONLY_GPU=1), the texture
|
||||
/// storage, the small pools; their union, sorted and merged (cap_ranges_mu held). The left-out ranges published for the checks
|
||||
/// storage, the small pools; their union, sorted and merged (cap_ranges_mu held). The left-out ranges published for the checks.
|
||||
/// capunion.h's build, join and clip copy this, ranges_merged and ranges_clip: tests/test_capunion.py compiles the three
|
||||
/// against them
|
||||
std::vector<std::pair<uint64_t, uint64_t>> capture_union_locked() {
|
||||
std::vector<std::pair<uint64_t, uint64_t>> imp = cap_ranges;
|
||||
if (cap_only_gpu()) {
|
||||
@@ -2987,12 +3116,56 @@ std::vector<std::pair<uint64_t, uint64_t>> capture_union_locked() {
|
||||
imp.insert(imp.end(), pool_cap_ranges.begin(), pool_cap_ranges.end());
|
||||
return ranges_merged(std::move(imp));
|
||||
}
|
||||
/// ((Triforce, 11-26, C22; capunion.h; RX_VK_CAP_UNION_SHARED) The captures' ranges for a caller whose own copy is older than
|
||||
/// cap_ranges_ver, into mine (cap_ranges_mu held). The union is built once a version of the lists, here, by whichever caller
|
||||
/// comes first (capture_make, capture_ranges_merged: the Presentation thread calls both in the plain mode; with threaded
|
||||
/// rendering the game's submitting thread calls one and the replay thread the other), and the left-out ranges are published
|
||||
/// at that build alone; the next caller of the version copies it. mine is the caller's own: the shared one is read under
|
||||
/// cap_ranges_mu only. =0 or the lab knob nocapunion: capture_union_locked for every caller, as before. =check: the build
|
||||
/// is capture_union_locked's, compared with capunion's, and a reuse is compared with a build made again
|
||||
void capture_union_take_locked(std::vector<std::pair<uint64_t, uint64_t>>& mine) {
|
||||
static capunion::Shared cap_union; // (cap_ranges_mu)
|
||||
static capunion::Built b; // (cap_ranges_mu; after a build, that version's union and left-out ranges, replaced at the next)
|
||||
if (!cap_union_shared()) {
|
||||
mine = capture_union_locked();
|
||||
st_cu_own.fetch_add(1, std::memory_order_relaxed);
|
||||
return;
|
||||
}
|
||||
const bool checked = cap_union_mode() == capunion::CHECK;
|
||||
uint64_t sorts = 0;
|
||||
bool built = false;
|
||||
const auto& u = capunion::get(cap_union, cap_ranges_ver, [&](std::vector<std::pair<uint64_t, uint64_t>>& uni) {
|
||||
capunion::build(cap_ranges, all_pool_ranges, tex_cap_ranges, pool_cap_ranges, cap_only_gpu(), b, &sorts);
|
||||
if (checked) { // (the lists as before, and the left-out ranges published as before; capunion's only compared)
|
||||
uni = capture_union_locked();
|
||||
if (b.uni != uni) cap_union_differs("the captures' union", b.uni.size(), uni.size());
|
||||
std::lock_guard lk(cap_excl_mu);
|
||||
if (b.excl_made && b.excl != cap_excl) cap_union_differs("the left-out ranges", b.excl.size(), cap_excl.size());
|
||||
return;
|
||||
}
|
||||
uni.swap(b.uni);
|
||||
if (b.excl_made) {
|
||||
std::lock_guard lk(cap_excl_mu);
|
||||
cap_excl.swap(b.excl);
|
||||
cap_excl_ver.fetch_add(1, std::memory_order_release);
|
||||
}
|
||||
}, &built);
|
||||
if (checked && !built) { // (a reuse: what a build of the caller's own would have given, and published)
|
||||
capunion::build(cap_ranges, all_pool_ranges, tex_cap_ranges, pool_cap_ranges, cap_only_gpu(), b, nullptr);
|
||||
if (b.uni != u) cap_union_differs("a reused union", b.uni.size(), u.size());
|
||||
std::lock_guard lk(cap_excl_mu);
|
||||
if (b.excl_made && b.excl != cap_excl) cap_union_differs("a reused union's left-out ranges", b.excl.size(), cap_excl.size());
|
||||
}
|
||||
mine = u;
|
||||
(built ? st_cu_built : st_cu_reused).fetch_add(1, std::memory_order_relaxed);
|
||||
if (sorts) st_cu_sorts.fetch_add((int64_t)sorts, std::memory_order_relaxed);
|
||||
}
|
||||
/// (RX_VK_CAP_ONLY_GPU) a replay read, texture upload or buffer binding of [gpu, gpu + n): counted, and the first 20 logged,
|
||||
/// when it reaches into the left-out ranges
|
||||
void cap_excl_note(uint64_t gpu, uint64_t n, const char* who) {
|
||||
if (!n) return;
|
||||
const uint64_t g = gpu < (1ull << 40) ? gpu : host->gpu_guest(gpu);
|
||||
if (!g || !cap_excl_hit(g, g + n)) return;
|
||||
if (!g || !cap_excl_hit_gap(g, g + n)) return;
|
||||
if (st_excl_reads.fetch_add(1, std::memory_order_relaxed) < 20)
|
||||
logf("vk: RX_VK_CAP_ONLY_GPU: %s of %#llx +%#llx reaches memory the capture leaves out", who, (unsigned long long)gpu,
|
||||
(unsigned long long)n);
|
||||
@@ -3027,7 +3200,8 @@ void cap_pool_born_now(uint64_t gpu, uint64_t size) {
|
||||
} // namespace
|
||||
|
||||
/// (RX_VK_CAP_ONLY_GPU) a present: every 10 s, the capture's pages a frame (and with 2 those it would leave out), the reads
|
||||
/// into the left-out ranges, and the largest of those ranges
|
||||
/// into the left-out ranges, the largest of those ranges, the left-out checks answered from the gap memo and searched
|
||||
/// (RX_VK_CAP_EXCL_GAP) and the union's builds (RX_VK_CAP_UNION_SHARED)
|
||||
void memory_cap_present() {
|
||||
if (!cap_only_gpu()) return;
|
||||
st_cap_presents.fetch_add(1, std::memory_order_relaxed);
|
||||
@@ -3053,9 +3227,17 @@ void memory_cap_present() {
|
||||
}
|
||||
logf("vk: capture (RX_VK_CAP_ONLY_GPU=%d), a frame over the last 10 s (%.0f frames, %.1f captures a frame): %.0f pages taken "
|
||||
"(%.1f MB), of them in the left-out ranges %.0f (counted with 2 only); reads and bindings into the left-out ranges %lld in "
|
||||
"all; left-out ranges %zu, %.0f MB, the largest:%s",
|
||||
"all; left-out ranges %zu, %.0f MB, the largest:%s; "
|
||||
"left-out checks in all from the gap memo %lld, searched %lld, differing %lld (RX_VK_CAP_EXCL_GAP); "
|
||||
"the captures' union of the lists (RX_VK_CAP_UNION_SHARED=%s): built %lld "
|
||||
"times, copied from one built %lld, built by a caller for itself %lld, runs that had to be sorted %lld, check differences "
|
||||
"%lld",
|
||||
cap_only_gpu(), f, takes / f, pages / f, pages * 4096.0 / 1048576.0 / f, excl / f, (long long)st_excl_reads.load(),
|
||||
ex.size(), total / 1048576.0, top.c_str());
|
||||
ex.size(), total / 1048576.0, top.c_str(), (long long)st_gap_memo.load(std::memory_order_relaxed),
|
||||
(long long)st_gap_search.load(std::memory_order_relaxed), (long long)st_gap_diff.load(std::memory_order_relaxed),
|
||||
cap_union_mode() == capunion::CHECK ? "check" : cap_union_mode() == capunion::ON ? "1" : "0",
|
||||
(long long)st_cu_built.exchange(0), (long long)st_cu_reused.exchange(0), (long long)st_cu_own.exchange(0),
|
||||
(long long)st_cu_sorts.exchange(0), (long long)st_cu_diff.load());
|
||||
}
|
||||
|
||||
void memory_note_texture_upload(uint64_t guest, uint64_t size) {
|
||||
@@ -3968,7 +4150,7 @@ std::unique_ptr<Capture> capture_make(bool behind) {
|
||||
static thread_local uint64_t ver = 0;
|
||||
if (ver != cap_ranges_ver) { // (the three lists overlap: their union, sorted, once each time one changes)
|
||||
ver = cap_ranges_ver;
|
||||
mirrored = capture_union_locked(); // (RX_VK_CAP_ONLY_GPU: the imports clipped to the game's pools)
|
||||
capture_union_take_locked(mirrored); // (RX_VK_CAP_ONLY_GPU: the imports clipped to the game's pools; (Triforce, 11-26, C22) the one union of this version, copied)
|
||||
texr = tex_cap_ranges;
|
||||
std::sort(texr.begin(), texr.end());
|
||||
size_t m = 0;
|
||||
@@ -4168,8 +4350,9 @@ std::unique_ptr<Capture> capture_make(bool behind) {
|
||||
|
||||
/// The ranges the captures take (the mirrored pools, the texture storage, the small pools): their union, sorted and
|
||||
/// merged, as of now; empty while no capture was made (memory_collect_written: a page in them written after its
|
||||
/// submit's capture is left for the next capture). Built again only when one of the three lists changed, as
|
||||
/// capture_make keeps its own union; the reference is the calling thread's until its next call
|
||||
/// submit's capture is left for the next capture). Copied again only when one of the lists changed, from the union
|
||||
/// capture_union_take_locked builds once a version (each caller builds its own with RX_VK_CAP_UNION_SHARED=0 or in the
|
||||
/// knob's phases); the reference is the calling thread's until its next call
|
||||
const std::vector<std::pair<uint64_t, uint64_t>>& capture_ranges_merged() {
|
||||
static const std::vector<std::pair<uint64_t, uint64_t>> none;
|
||||
static thread_local std::vector<std::pair<uint64_t, uint64_t>> merged;
|
||||
@@ -4181,7 +4364,7 @@ const std::vector<std::pair<uint64_t, uint64_t>>& capture_ranges_merged() {
|
||||
refresh_pool_ranges_locked(); // (a pool made since the last capture: the next one takes its pages, not this)
|
||||
if (ver != cap_ranges_ver) {
|
||||
ver = cap_ranges_ver;
|
||||
merged = capture_union_locked(); // (the same ranges as the captures take: RX_VK_CAP_ONLY_GPU)
|
||||
capture_union_take_locked(merged); // (the same ranges as the captures take: RX_VK_CAP_ONLY_GPU; (Triforce, 11-26, C22) the one union of this version, copied)
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
@@ -5201,6 +5384,9 @@ namespace {
|
||||
/// pools_mu held.
|
||||
Pool* pool_cache[4096]; // (by 64 KB page: the pools buffer bindings hit lately)
|
||||
std::atomic<uint64_t> pools_gen{1}; // (bumped when a pool leaves the table: the recording threads' caches go stale)
|
||||
// ((Triforce, 11-27, bindspan.h) bumped when imports are left overlapping (pools_flag_overlapping): a bind span filled before
|
||||
// is not asked again, as its pool may be one of them. The bind spans' key only: the memo and the per-page slots keep theirs)
|
||||
std::atomic<uint64_t> pools_overlap_gen{0};
|
||||
struct TlPool {
|
||||
Pool* p;
|
||||
uint64_t gen;
|
||||
@@ -5546,6 +5732,30 @@ void span_game_pools(uint64_t& lo, uint64_t& hi, uint64_t chunk) {
|
||||
}
|
||||
}
|
||||
|
||||
/// ((Triforce, 11-27, bindspan.h) The import n was made beside the imports its range overlaps (pool_lookup's plan past 1 GB:
|
||||
/// they stay): it and each of them are flagged left_overlapping, which no bind span is filled for, and pools_overlap_gen
|
||||
/// moves, so that a span of one of them filled before is not asked again. Their read bindings go by the page, the pool a
|
||||
/// thread's slot or pool_of gives, as before the spans. The imports it overlaps, counted (pools_mu held)
|
||||
int pools_flag_overlapping(std::map<uint64_t, Pool>::iterator n) {
|
||||
const uint64_t lo = n->second.lo, hi = n->second.hi;
|
||||
int found = 0;
|
||||
for (auto it = imported.lower_bound(hi); it != imported.begin();) { // (the imports starting below hi, the last ones first)
|
||||
--it;
|
||||
if (it == n) continue;
|
||||
if (it->second.hi <= lo) {
|
||||
if (it->second.hi + (1ull << 30) < lo) break; // (imports are at most 1 GB: none further down reaches lo)
|
||||
continue;
|
||||
}
|
||||
__atomic_store_n(&it->second.left_overlapping, true, __ATOMIC_RELAXED);
|
||||
found++;
|
||||
}
|
||||
if (found) {
|
||||
__atomic_store_n(&n->second.left_overlapping, true, __ATOMIC_RELAXED);
|
||||
pools_overlap_gen.fetch_add(1, std::memory_order_release); // (after the flags: a key with the new value sees them)
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
Pool* pool_lookup(uint64_t guest, uint64_t size) {
|
||||
if (guest_pools.empty()) return nullptr;
|
||||
bg_drain();
|
||||
@@ -5605,8 +5815,10 @@ Pool* pool_lookup(uint64_t guest, uint64_t size) {
|
||||
// new import of both and moved its GPU-written contents into it, for bindings that may never come. A real overlap of
|
||||
// the binding still takes the neighbour in. plan returns whether only the padding reached one)
|
||||
static const bool narrow_wanted = getenv("RX_VK_IMPORT_NARROW") && atoi(getenv("RX_VK_IMPORT_NARROW")) != 0;
|
||||
bool left_overlapping = false; // ((Triforce, 11-27) the last plan went past 1 GB: the import stays beside the others)
|
||||
auto plan = [&](bool spanned) { // (the range, the imported pools it takes in; spanned: span_game_pools's chunks too)
|
||||
bool padding_only = false;
|
||||
left_overlapping = false;
|
||||
lo = want_lo, hi = std::max(want_hi, imp != imported.end() ? imp->second.hi : 0);
|
||||
if (spanned && chunk) span_game_pools(lo, hi, chunk);
|
||||
for (bool grew = true; grew;) {
|
||||
@@ -5633,6 +5845,7 @@ Pool* pool_lookup(uint64_t guest, uint64_t size) {
|
||||
lo = want_lo, hi = std::max(want_hi, imp != imported.end() ? imp->second.hi : 0);
|
||||
overlapped.clear();
|
||||
if (imp != imported.end()) overlapped.push_back(imp->first);
|
||||
left_overlapping = true;
|
||||
}
|
||||
return padding_only;
|
||||
};
|
||||
@@ -5678,6 +5891,7 @@ Pool* pool_lookup(uint64_t guest, uint64_t size) {
|
||||
}
|
||||
p.imported_value = mem_rec_value;
|
||||
imp = imported.emplace(p.lo, p).first;
|
||||
if (left_overlapping) pools_flag_overlapping(imp); // ((Triforce, 11-27) no bind spans over two imports of one page)
|
||||
guest_pages_set(p.lo, p.hi, p.address);
|
||||
if (chunk) prefetch_chunks(p.lo, p.hi, chunk);
|
||||
if (overlapped.size() > 1) {
|
||||
@@ -5847,6 +6061,9 @@ bool mirror_small_full(const Pool& p, uint64_t take) {
|
||||
return mirror_heat_on() && __atomic_load_n(&p.heat, __ATOMIC_RELAXED) < mirror_hot_bytes() && mirror_bytes + take > mirror_small_cap();
|
||||
}
|
||||
bool mirror_upload = false; // (a submission is being recorded: its upload command buffer takes the syncs)
|
||||
// ((Triforce, 11-27) the lab knob nobindspan, read once a submission (memory_begin_submission): a span is only asked while
|
||||
// mirror_upload is on. Not lab_ab::on at every binding: its string compares ran in the knobs' phases alone)
|
||||
std::atomic<bool> bind_span_lab_off{false};
|
||||
std::vector<Pool*> mirror_wanted, mirror_synced;
|
||||
struct WriteBack {
|
||||
Pool* pool;
|
||||
@@ -5888,16 +6105,39 @@ void cpu_words_merge() { // (holding cpu_words_mu)
|
||||
}
|
||||
cpu_words_new.clear();
|
||||
}
|
||||
// ((Triforce, 11-26) The words the sets hold, asked at the note (cpuwordsseen.h): the same report words come every frame,
|
||||
// and each was pushed, sorted and searched for in both sets again at every part's end with write-backs, to be dropped
|
||||
// there. An entry is the word's whole address and the sets' generation, so the table never calls a word known that the
|
||||
// sets do not hold; it forgets where the sets are cleared, in memory_cpu_owned. Read and written under cpu_words_mu.
|
||||
// RX_VK_CPU_WORDS_SEEN=0: every word noted again, as before; =check: as before, and each word the table knows looked up
|
||||
// in the sets (mismatches in the mirror syncs' line). The lab knob nowordsseen notes every word again in its phases)
|
||||
cpu_words_seen::Table cpu_words_table;
|
||||
int cpu_words_seen_mode() {
|
||||
static const int env = [] {
|
||||
const char* e = getenv("RX_VK_CPU_WORDS_SEEN");
|
||||
const int m = cpu_words_seen::mode(e);
|
||||
if (m != cpu_words_seen::ON) logf("vk: report words the sets hold are %s (RX_VK_CPU_WORDS_SEEN)",
|
||||
m == cpu_words_seen::OFF ? "noted again every time, as before" : "noted again and checked against the sets");
|
||||
else if (e && e[0] && strcmp(e, "1"))
|
||||
logf("vk: RX_VK_CPU_WORDS_SEEN=%s not known: report words the sets hold are not noted again, as unset", e);
|
||||
return m;
|
||||
}();
|
||||
return cpu_words_seen::mode_now(env, lab_ab::on("nowordsseen"));
|
||||
}
|
||||
} // namespace
|
||||
void memory_cpu_owned(uint64_t guest, uint64_t size) {
|
||||
static const bool off = getenv("RX_VK_WB_REPORTS") != nullptr;
|
||||
if (off || !guest || wb_notes_off()) return; // ((Triforce, 11-22, MEM-51) no mirrors: no write-back cuts these words out)
|
||||
const int seen = cpu_words_seen_mode();
|
||||
std::lock_guard lk(cpu_words_mu);
|
||||
if (cpu_words.size() + cpu_words_recent.size() + cpu_words_new.size() > 65536) { // (as before: forgotten when it gets this big)
|
||||
cpu_words_merge(); // (which leaves cpu_words_new empty)
|
||||
if (cpu_words.size() + cpu_words_recent.size() > 65536) cpu_words.clear(), cpu_words_recent.clear();
|
||||
// ((Triforce, 11-26) the only place a word leaves the sets: the table of the words they hold forgets with them)
|
||||
if (cpu_words.size() + cpu_words_recent.size() > 65536) cpu_words.clear(), cpu_words_recent.clear(), cpu_words_table.forget();
|
||||
}
|
||||
for (uint64_t a = guest & ~7ull; a < guest + size; a += 8) cpu_words_new.push_back(a);
|
||||
// ((Triforce, 11-26) a word the sets hold already is not noted again: the merge would only find it there)
|
||||
for (uint64_t a = guest & ~7ull; a < guest + size; a += 8)
|
||||
if (cpu_words_seen::push(cpu_words_table, seen, a, cpu_words, cpu_words_recent, cpu_words_new)) cpu_words_new.push_back(a);
|
||||
// (the write itself, guest_cpu_write, has told the write-back diff's shadows)
|
||||
}
|
||||
namespace {
|
||||
@@ -7104,9 +7344,78 @@ std::atomic<uint64_t> st_binds_written{0}, st_binds_guest{0};
|
||||
void memory_bind_counts(uint64_t* written, uint64_t* guest) {
|
||||
*written = st_binds_written.load(std::memory_order_relaxed), *guest = st_binds_guest.load(std::memory_order_relaxed);
|
||||
}
|
||||
// ((Triforce, 11-26, the GPU pass on v0.8.3, C08) bindspan.h: a read binding inside a span of its pool's mirror that this
|
||||
// thread's lock-free path resolved before, under the same stamp, pool table, segment and recording, is given the mirror by two
|
||||
// compares in place of the pool table, the pool's fields, the add on Pool::binds and the resident pieces' walk. RX_VK_BIND_SPAN=0:
|
||||
// as before; =check: a hit is resolved the whole way too and the two compared (the whole way's returned); the lab's knob
|
||||
// "nobindspan" is =0 in its phases. Counted every 600 submissions (bind_span_report, memory_end_submission)
|
||||
static int bind_span_mode() {
|
||||
static const int m = [] {
|
||||
const char* e = getenv("RX_VK_BIND_SPAN");
|
||||
const int v = bindspan::mode(e);
|
||||
if (v != bindspan::kOn)
|
||||
logf("vk: bind spans %s (RX_VK_BIND_SPAN)", v == bindspan::kCheck ? "checked: every hit is resolved the whole way too, the "
|
||||
"whole way's result returned, the differences counted" : "off: every read binding the whole way, as before");
|
||||
else if (e && e[0] && strcmp(e, "1"))
|
||||
logf("vk: RX_VK_BIND_SPAN=%s not known: bind spans, as unset", e);
|
||||
return v;
|
||||
}();
|
||||
return m;
|
||||
}
|
||||
static thread_local bindspan::Set<VkBuffer, Pool*> tl_bind_spans;
|
||||
static thread_local bool tl_bind_span_checking = false; // (=check: the whole way is being asked for a hit's binding)
|
||||
static std::atomic<uint64_t> st_span_hits{0}, st_span_misses{0}, st_span_fills{0}, st_span_checked{0}, st_span_diffs{0};
|
||||
/// The lock-free path just gave p's mirror to a read binding of [off, off + size): the span around it, the pool's or its
|
||||
/// resident pieces' run. None for an import left overlapping another (pools_flag_overlapping): a span of either would
|
||||
/// answer for pages the other holds too, where the bindings go by the page
|
||||
static void bind_span_fill(const bindspan::Key& key, Pool* p, uint64_t off, uint64_t size) {
|
||||
if (__atomic_load_n(&p->left_overlapping, __ATOMIC_RELAXED)) return;
|
||||
const bool pieces = p->mpieces;
|
||||
if (pieces && p->res_bits.empty()) return;
|
||||
uint64_t lo = 0, hi = 0;
|
||||
bindspan::bounds(p->lo, p->hi, off, size, pieces ? p->res_bits.data() : nullptr, p->res_bits.size(), p->piece_shift, &lo, &hi);
|
||||
tl_bind_spans.fill(key, lo, hi, p->lo, p->mirror, p, [](Pool* q, uint32_t n) { __atomic_fetch_add(&q->binds, n, __ATOMIC_RELAXED); });
|
||||
}
|
||||
/// The thread's span counts to the sums now and then (every kTakeAt of its questions, a hit's or a miss's), not at each binding
|
||||
static void bind_span_take() {
|
||||
uint64_t h = 0, m = 0, f = 0;
|
||||
if (!tl_bind_spans.take_counts(&h, &m, &f)) return;
|
||||
st_span_hits.fetch_add(h, std::memory_order_relaxed), st_span_misses.fetch_add(m, std::memory_order_relaxed);
|
||||
st_span_fills.fetch_add(f, std::memory_order_relaxed);
|
||||
}
|
||||
/// (RX_VK_BIND_SPAN=check) a hit's answer against the whole way's; a difference logged with the span and its key
|
||||
static void bind_span_checked(const BufferRef& span, const BufferRef& whole, uint64_t guest, const bindspan::Set<VkBuffer, Pool*>::Span& s,
|
||||
const bindspan::Key& key) {
|
||||
st_span_checked.fetch_add(1, std::memory_order_relaxed);
|
||||
if (span.buffer == whole.buffer && span.offset == whole.offset && span.size == whole.size && span.address == whole.address) return;
|
||||
if (st_span_diffs.fetch_add(1, std::memory_order_relaxed) < 20)
|
||||
logf("vk: bind spans: a read binding of %#llx +%#llx: the span gave buffer %p at %#llx, the whole way %p at %#llx +%#llx "
|
||||
"(RX_VK_BIND_SPAN=check); the span %#llx..%#llx of the pool at %#llx%s, key stamp %#llx, pools %llu, segment %llu, "
|
||||
"recording %llu, overlaps %llu", (unsigned long long)guest, (unsigned long long)span.size, (void*)span.buffer,
|
||||
(unsigned long long)span.offset, (void*)whole.buffer, (unsigned long long)whole.offset, (unsigned long long)whole.size,
|
||||
(unsigned long long)s.lo, (unsigned long long)s.hi, (unsigned long long)s.base, s.pool->mpieces ? " (in pieces)" : "",
|
||||
(unsigned long long)key.stamp, (unsigned long long)key.pools_gen, (unsigned long long)key.segment,
|
||||
(unsigned long long)key.rec_value, (unsigned long long)key.overlaps);
|
||||
}
|
||||
static void bind_span_report() { // (every 600 submissions)
|
||||
const int mode = bind_span_mode();
|
||||
if (mode == bindspan::kOff || !mirror_on()) return; // (no mirror: no span, nothing to count)
|
||||
static uint64_t l_hits, l_misses, l_fills;
|
||||
const uint64_t h = st_span_hits.load(std::memory_order_relaxed), m = st_span_misses.load(std::memory_order_relaxed),
|
||||
f = st_span_fills.load(std::memory_order_relaxed);
|
||||
char chk[128] = "";
|
||||
if (mode == bindspan::kCheck)
|
||||
snprintf(chk, sizeof chk, "; checked against the whole way so far %llu, %llu differed (RX_VK_BIND_SPAN=check)",
|
||||
(unsigned long long)st_span_checked.load(std::memory_order_relaxed), (unsigned long long)st_span_diffs.load(std::memory_order_relaxed));
|
||||
logf("vk: bind spans (600 submits): %llu read bindings answered from a span, %llu the whole way past the memo, %llu spans "
|
||||
"filled%s", (unsigned long long)(h - l_hits), (unsigned long long)(m - l_misses), (unsigned long long)(f - l_fills), chk);
|
||||
l_hits = h, l_misses = m, l_fills = f;
|
||||
}
|
||||
|
||||
BufferRef gpu_buffer_bind(uint64_t gpu, uint64_t size, bool written) {
|
||||
if (written) texture_gpu_wrote(gpu, size), st_binds_written.fetch_add(1, std::memory_order_relaxed);
|
||||
if (cap_only_gpu()) cap_excl_note(gpu, size, "a buffer binding");
|
||||
// ((Triforce, 11-27) not again for RX_VK_BIND_SPAN=check's whole way of a span's hit: the outer call noted it)
|
||||
if (cap_only_gpu() && !tl_bind_span_checking) cap_excl_note(gpu, size, "a buffer binding");
|
||||
// (below 1 TB a GPU address is the guest address itself, and a pool holds the whole range or nothing: the host's
|
||||
// two translations are for the virtual pools above)
|
||||
uint64_t guest = gpu;
|
||||
@@ -7140,6 +7449,30 @@ BufferRef gpu_buffer_bind(uint64_t gpu, uint64_t size, bool written) {
|
||||
if (bind_memo_hit(guest, size, gpu_bind_stamp(), m.guest, m.size, m.stamp, m.ref.buffer != VK_NULL_HANDLE))
|
||||
return m.ref;
|
||||
}
|
||||
// ((Triforce, 11-26, C08) bindspan.h, after the memo and written into it as before: a span this thread filled under the
|
||||
// same key holds this read binding: its mirror, at the same offset the path below would find. Not for the cases the rule
|
||||
// leaves out, nor outside a submission's uploads (mirror_upload: the path below gives the import there))
|
||||
const int span_mode = bind_span_mode();
|
||||
const bool span_ok = span_mode != bindspan::kOff && !tl_bind_span_checking &&
|
||||
bindspan::eligible(written, size, mirror_upload && mirror_on(), mirror_use_on(), mirror_heat_on(), piece_idle_for() != 0) &&
|
||||
!bind_span_lab_off.load(std::memory_order_relaxed);
|
||||
bindspan::Key span_key;
|
||||
if (span_ok) {
|
||||
span_key = {gpu_bind_stamp(), pools_gen.load(std::memory_order_relaxed), texture_segment(), mem_rec_value,
|
||||
pools_overlap_gen.load(std::memory_order_acquire)};
|
||||
bind_span_take(); // (before the question: a checked hit takes its count back below)
|
||||
if (auto* s = tl_bind_spans.find(span_key, guest, size)) {
|
||||
const BufferRef ref{s->buffer, guest - s->base, size, 0};
|
||||
if (span_mode != bindspan::kCheck) return remember(ref);
|
||||
tl_bind_spans.checked(s); // (the whole way counts this binding itself; the line counts it as checked)
|
||||
const auto span = *s;
|
||||
tl_bind_span_checking = true;
|
||||
const BufferRef whole = gpu_buffer_bind(gpu, size, false);
|
||||
tl_bind_span_checking = false;
|
||||
bind_span_checked(ref, whole, guest, span, span_key);
|
||||
return whole;
|
||||
}
|
||||
}
|
||||
// (a read binding of a pool this thread found before and whose mirror is in use this submission or that has none,
|
||||
// without the lock: every thread's, the replay thread's too (each draw binds several uniform buffers: the pool's
|
||||
// lookup under the lock was ~8% of the replay's time in a race); the rest under it, as below)
|
||||
@@ -7159,6 +7492,7 @@ BufferRef gpu_buffer_bind(uint64_t gpu, uint64_t size, bool written) {
|
||||
// (Triforce: a mirror in pieces: only where it has memory; a piece left in guest memory for good: the import; else below)
|
||||
if (pieces_resident(p, off, size)) {
|
||||
pieces_touch(p, off, size); // ((Triforce, 11-22, MEM-26's count) nothing unless RX_VK_MIRROR_PIECE_IDLE is set
|
||||
if (span_ok) bind_span_fill(span_key, p, off, size); // ((Triforce, 11-26, C08) the span around it, for the next ones)
|
||||
return remember({p->mirror, off, size, 0});
|
||||
}
|
||||
if (pieces_direct(p, off, size)) return remember(in_guest({p->buffer, off, size, 0}));
|
||||
@@ -8383,6 +8717,7 @@ void memory_begin_submission() {
|
||||
retired_imports_give_back();
|
||||
mirror_epoch++;
|
||||
mirror_upload = true;
|
||||
bind_span_lab_off.store(lab_ab::on("nobindspan"), std::memory_order_relaxed); // ((Triforce, 11-27) bindspan.h)
|
||||
mirror_synced.clear();
|
||||
writebacks.clear();
|
||||
imports_give_back();
|
||||
@@ -9189,12 +9524,23 @@ void memory_end_submission(VkCommandBuffer cmd) {
|
||||
static int64_t n, l_live, l_cap;
|
||||
if (++n % 600 == 0) {
|
||||
msync_pass_report(); // ((Triforce, 11-21, MEM-48) how the syncs' pass went)
|
||||
bind_span_report(); // ((Triforce, 11-26, C08) the read bindings answered from a span, bindspan.h)
|
||||
static int64_t l_old;
|
||||
// ((Triforce, 11-26) the report words: cpuwordsseen.h's counters, since the last line, the check's mismatches since
|
||||
// the start; nothing is asked of the table with RX_VK_CPU_WORDS_SEEN=0 or in the lab knob nowordsseen's phases)
|
||||
static uint64_t l_wn, l_wk, l_wf;
|
||||
const uint64_t wn = cpu_words_table.st_noted.load(std::memory_order_relaxed), wk = cpu_words_table.st_known.load(std::memory_order_relaxed),
|
||||
wf = cpu_words_table.st_forgets.load(std::memory_order_relaxed), wm = cpu_words_table.st_mismatch.load(std::memory_order_relaxed);
|
||||
logf("vk: mirror syncs (600 submits): %lld dirty pages from their submits' captures, %lld from earlier ones', "
|
||||
"%lld from guest memory as it was at the replay; %zu captures kept; %lld pages the GPU wrote copied over "
|
||||
"(%lld live); %lld kept for the GPU (RX_VK_PROTECT_BARE)", (long long)(st_sync_cap_pages - l_cap),
|
||||
"(%lld live); %lld kept for the GPU (RX_VK_PROTECT_BARE); report words: %llu asked of the table, %llu known "
|
||||
"to it and not noted again (noted all the same with =check), the sets forgotten %llu times, %llu check "
|
||||
"mismatches since the start (RX_VK_CPU_WORDS_SEEN)",
|
||||
(long long)(st_sync_cap_pages - l_cap),
|
||||
(long long)(st_sync_old_pages - l_old), (long long)(st_sync_live_pages - l_live), cap_bufs.size(),
|
||||
(long long)st_sync_gpu_pages, (long long)st_sync_gpu_live, (long long)st_prot_kept.load());
|
||||
(long long)st_sync_gpu_pages, (long long)st_sync_gpu_live, (long long)st_prot_kept.load(),
|
||||
(unsigned long long)(wn - l_wn), (unsigned long long)(wk - l_wk), (unsigned long long)(wf - l_wf), (unsigned long long)wm);
|
||||
l_wn = wn, l_wk = wk, l_wf = wf;
|
||||
l_cap = st_sync_cap_pages, l_live = st_sync_live_pages, l_old = st_sync_old_pages;
|
||||
if (shadow_bytes || st_wbd_runs)
|
||||
logf("vk: write-back diff (600 submits): %lld runs, %.1f MB compared; %lld pages read into the shadows; %llu MB of shadows; "
|
||||
|
||||
Reference in New Issue
Block a user