diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 06:05:33 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 06:05:33 -0500 |
| commit | ba32cd6acf9e6f5dfa2128ef53e05dec2cf34a38 (patch) | |
| tree | 1c11ec419865d0053029e2acb2a019303cdeb413 /runtime/shims/xmem.cpp | |
| parent | b4a6c3673aae1121559da4a5eba0c3b7ada70045 (diff) | |
d3d12: a console resource heap the page mirror holds is read in place: no copy, its pages filtered as they are filled
When every page of a console CBV/SRV/UAV heap lies in the page mirror (a reservation xmem placed in its range),
add_heap_in_place gives it no copy and no page tracker of its own. 25,865 of the corpus's 26,503 shaders keep 32 bits
of a descriptor-table pointer, so the heap's pages are bound a second time into the arena below 4 GiB
(TitleMirror::alias, same bind batches and wait as the mirror's), at a range of whole arena blocks with no arena
memory behind it (arena_reserve_unbacked); the null slots after the heap are that range's rest, unbound, reading
zero. Table pointers go there as before (console_heap_ranges).
The mirror fills the pages' home through filter_heap_page (TitleMirror::filter_range): the title's page is only
read; a slot whose bytes changed since it was last filtered, or that a change touched (the records' change list,
applied at the mirror's refresh before the written pages are filled, filtered straight into the home), is fixed as a
copied slot was, into the home: a V# whose base lies in the arena, the mirror or a buffer of ours stays as the title
wrote it (reachable_as_written, no record); another V# is resolved as before (an interim until every title allocation
is in the mirror) or written with no base and no records and waits; a T# is bound as before [TSHARP-INDEX: its
bindless index in the entry]; other words are null. A GPU write-back is never taken from these pages: the mirror has
none, and no window is made for them.
A heap the mirror does not hold (a device without the mirror, memory outside its range) is copied as before. New
log line per in-place heap: pages filtered and slots changed per submission and per frame, the ms, and the V#
halves read as the title wrote them. arena_gpu_read reads the arena with the GPU after the mirror's last bind
(tests).
Test: d3d12_heap_in_place_test (Wine, iGPU): a heap in physical pages of an XMemVirtualAlloc reservation; the GPU
reads, below 4 GiB, a V# into nobody's memory and a data word null and V#s into the arena and the mirror as written,
while the title's bytes stay as written byte for byte; a rewrite through the title's own view reaches the GPU at the
next refresh, filtered, and the title keeps what it wrote; the null slots read zero. It fails on the copy path. Linux
ctest 123/123.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/shims/xmem.cpp')
0 files changed, 0 insertions, 0 deletions