upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 21:28:25 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 21:28:25 -0500
commit266f335dda39d8807f6ee5f44e89d5514d85ee8a (patch)
treeb7c82344b9c9d94c6ba97b60ff71ad79d544d74e /runtime/src
parent861bb0546e0fa11f22b6550e576fa21ed9b445b5 (diff)
d3d12: a retired geometry view invalidates the answers it made without an alias
forget_geometry_alias only removed the view's alias ranges. vsharp_address and placed views take geometry_va() answers straight from GeometryViews, with no alias entry, so a retirement left the console heap slots translated through them, and the GPU key table's entries, pointing at the view after its reap. TitleVaAliases::forget_copy records the retired view as a removal: its title range (CPU address and GPU twin) goes into changed_ranges with an invalidations bump, so the console heaps translate those slots again, and its shader VA into take_removed, so the GPU key table drops answers into it. That is what remove() does for a range that has an alias; recording the answers instead would cost a table entry per answer on the hot path, while this costs one entry per retirement. The retirement runs before refresh_shadows() (previous commit), so the submission about to run already translates without the view. pool_spans keeps a retired view's shader_va, but only for its statistics line; nothing answers from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/title_va_alias.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/runtime/src/title_va_alias.h b/runtime/src/title_va_alias.h
index 8d97764d5..f3fd2b410 100644
--- a/runtime/src/title_va_alias.h
+++ b/runtime/src/title_va_alias.h
@@ -84,6 +84,19 @@ public:
84 count_.store(ranges_.size(), std::memory_order_release); 84 count_.store(ranges_.size(), std::memory_order_release);
85 } 85 }
86 86
87 // A copy that answered for [title_va, title_va + bytes) at shader_va went, whether or not it had a range here (a
88 // geometry copy that vsharp_address or a placed view reached through GeometryViews directly has none): what was
89 // translated through it is stale. Recorded as a removal would be: the console heaps translate the slots in the
90 // range again (invalidations, changed_ranges), and the GPU key table drops answers into shader_va (take_removed).
91 void forget_copy(std::uint64_t title_va, std::uint64_t bytes, std::uint64_t shader_va) {
92 if (!bytes) return;
93 std::unique_lock lock(mutex_);
94 changes_.record(title_va, bytes);
95 note_removed(shader_va, bytes);
96 invalidations_.fetch_add(1, std::memory_order_release);
97 generation_.fetch_add(1, std::memory_order_release);
98 }
99
87 // The address a shader must be given for `va` from the ranges added so far: translated inside one, unchanged 100 // The address a shader must be given for `va` from the ranges added so far: translated inside one, unchanged
88 // elsewhere. No copy is made here. 101 // elsewhere. No copy is made here.
89 std::uint64_t shader_va(std::uint64_t va, std::uint64_t bytes = 1) const { 102 std::uint64_t shader_va(std::uint64_t va, std::uint64_t bytes = 1) const {