mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 07:31:06 -04:00
Say in the flight recorder's blank-slot events what the slot resolves to, and whether any shader reads the pool as a volume.
Ten slots a frame are noted as having no picture when their submission ends: the 128x72 and 64x36 volumes the game registers under new slot numbers in every frame. The events now tell a slot whose entry cannot be viewed in any kind a shader reads from one whose lookup found nothing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -181,7 +181,7 @@ static void write_events(const DumpJob *j) {
|
||||
static const char *const flag_names[] = {"depth", "stencil", "mirrored", "bound", "astc", "gpu"};
|
||||
for (int b = 0; b < 6; b++)
|
||||
if (e->flags & 1u << b) k += snprintf(fl + k, sizeof fl - (size_t)k, "%s%s", k ? "," : "", flag_names[b]);
|
||||
char detail[160];
|
||||
char detail[400];
|
||||
if (e->kind == FLIGHT_TEX_NEW) snprintf(detail, sizeof detail, "%s", vk_texture_start_name((int)e->detail));
|
||||
else if (e->kind == FLIGHT_TEX_DROP) snprintf(detail, sizeof detail, "%s", vk_texture_drop_name((int)e->detail));
|
||||
else if (e->kind == FLIGHT_TEX_UP || e->kind == FLIGHT_TEX_REUP)
|
||||
@@ -194,10 +194,12 @@ static void write_events(const DumpJob *j) {
|
||||
snprintf(detail, sizeof detail, "slot %u: %s", e->us, was[e->detail & 3]);
|
||||
} else if (e->kind == FLIGHT_TEX_TOBLANK || e->kind == FLIGHT_TEX_BLANKSUB) {
|
||||
static const char *const bit[] = {"finalized", "own entry", "released", "superseded", "overwritten", "uploaded",
|
||||
"storage readable", "held out", "CPU-written", "GPU-owned", "retiring"};
|
||||
"storage readable", "held out", "CPU-written", "GPU-owned", "retiring",
|
||||
"resolves to an entry", "that entry is a volume", "that entry is another descriptor's",
|
||||
"no shader reads the pool as a volume"};
|
||||
int o = snprintf(detail, sizeof detail, e->kind == FLIGHT_TEX_TOBLANK ? "slot %u lost its picture:"
|
||||
: "slot %u had no picture when its submission ended:", e->us);
|
||||
for (int b = 0; b < 11 && o < (int)sizeof detail - 20; b++)
|
||||
for (int b = 0; b < 15 && o < (int)sizeof detail - 40; b++)
|
||||
if (e->detail & 1u << b) o += snprintf(detail + o, sizeof detail - (size_t)o, " %s;", bit[b]);
|
||||
} else if (e->kind == FLIGHT_TEX_BLANK)
|
||||
snprintf(detail, sizeof detail, "slot %u sampled as its stand-in%s%s", e->us, e->detail & 1 ? ", finalized" : "",
|
||||
|
||||
@@ -2456,6 +2456,10 @@ static int pool_view_blank(VkImageView v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// For the flight recorder's blank-slot events: 16384 when no pipeline made so far reads the pool as a volume (kind =
|
||||
// depth * 8 + dim * 2 + arrayed, vk.h), so a slot that holds a volume has a stand-in in every kind that is read.
|
||||
static uint32_t pool_no_3d(void) { return __atomic_load_n(&vk_pool_kinds_used, __ATOMIC_RELAXED) & 0x3030u ? 0 : 16384u; }
|
||||
|
||||
// Slot id's entry of a kind went from the view was to now: noted when a texture's view gives way to the stand-in, which
|
||||
// every draw of the submission that samples the slot then reads (the set is written with update-after-bind).
|
||||
static uint32_t pool_blanked[512]; // the slots that lost their picture since the last pool_blank_check
|
||||
@@ -2463,7 +2467,7 @@ static int pool_nblanked;
|
||||
static void pool_note_blank(uint32_t id, VkImageView was, VkImageView now, int *noted) {
|
||||
if (!flight_on || *noted || !was || pool_view_blank(was) || !pool_view_blank(now)) return;
|
||||
uint64_t addr;
|
||||
uint32_t fmt, w, h, why = vk_texture_slot_why_locked((int)id, &addr, &fmt, &w, &h);
|
||||
uint32_t fmt, w, h, why = vk_texture_slot_why_locked((int)id, &addr, &fmt, &w, &h) | pool_no_3d();
|
||||
flight_tex(FLIGHT_TEX_TOBLANK, addr, fmt, w, h, 0, 0, why, id);
|
||||
if (pool_nblanked < (int)(sizeof pool_blanked / sizeof *pool_blanked)) pool_blanked[pool_nblanked++] = id;
|
||||
*noted = 1;
|
||||
@@ -2483,7 +2487,7 @@ static void pool_blank_check(void) {
|
||||
}
|
||||
if (real) continue;
|
||||
uint64_t addr;
|
||||
uint32_t fmt, w, h, why = vk_texture_slot_why_locked((int)id, &addr, &fmt, &w, &h);
|
||||
uint32_t fmt, w, h, why = vk_texture_slot_why_locked((int)id, &addr, &fmt, &w, &h) | pool_no_3d();
|
||||
flight_tex(FLIGHT_TEX_BLANKSUB, addr, fmt, w, h, 0, 0, why, id);
|
||||
}
|
||||
vk_texture_unlock();
|
||||
|
||||
@@ -4442,11 +4442,14 @@ uint32_t vk_texture_slot_why_locked(int id, uint64_t *addr, uint32_t *format, ui
|
||||
make_key(&s->t, &k);
|
||||
const Tex *own = nvn_hm_get(&by_key, &k);
|
||||
*addr = k.addr, *format = (uint32_t)s->t.d.format, *w = s->t.d.width, *h = s->t.d.height;
|
||||
const Tex *ce = s->ce && s->cgen == agen[sinfo[id] & 0xffff] ? s->ce : NULL; // an older one may be gone
|
||||
return (s->finalized ? 1u : 0) | (own ? 2u : 0) | (own && own->released ? 4u : 0) | (own && own->superseded ? 8u : 0) |
|
||||
(own && own->overwritten ? 16u : 0) | (own && own->uploaded ? 32u : 0) |
|
||||
(s->t.mem && mem_readable((uint64_t)(uintptr_t)s->t.mem, s->t.L.size) ? 64u : 0) |
|
||||
(holds.n && nvn_hm_get(&holds, &k) ? 128u : 0) | (tex_mirrored(&s->t) ? 256u : 0) |
|
||||
(own && own->pub.gpu_owned ? 512u : 0) | (own && own->retiring ? 1024u : 0);
|
||||
(own && own->pub.gpu_owned ? 512u : 0) | (own && own->retiring ? 1024u : 0) |
|
||||
// what the slot's last lookup kept (vk_texture_by_id_locked): an entry, and whether its image is a volume
|
||||
(ce ? 2048u : 0) | (ce && ce->pub.type == VK_IMAGE_TYPE_3D ? 4096u : 0) | (ce && ce != own ? 8192u : 0);
|
||||
}
|
||||
|
||||
void vk_texture_lock(void) { lock(); }
|
||||
|
||||
Reference in New Issue
Block a user