diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 05:56:53 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 05:56:53 -0500 |
| commit | 0cdc80d2075a7e22f24c76f4a9cfe6c0ae72f08a (patch) | |
| tree | b1e161d6960d02cdf73723c51b5b583c5858600e /runtime/test/memory_breakdown_test.cpp | |
| parent | f950eaae8f63f6ad90c8bf47d5d8cd874ed8969c (diff) | |
d3d12: slot-133 buffers, title windows and pool extents onto the page mirror; GPU writes into mirrored pages go back; hot/cold tracking; homes by budget (RT-PAGE-MIRROR)
Step C, with the previous WIP commit.
- Resource::create_mirror_buffer: a slot-133 buffer over title memory the mirror holds in one chunk is bound to that
chunk at heap_base + its title address: no import, no shadow, no per-submission walk or guard of its own. Its GPU VA
is the title address; V#s and root views naming it keep that address. Title windows and stream-pool extents are not
made for mirrored memory (resolve_title_memory answers the mirror first, since step B).
- Write-back (DeviceState::page_mirror_write_back, from write_back_titles after the reaching submission retired): the
256-byte pieces whose home differs from the title's page are written back through kernel_writes, on pages nothing
wrote since they were last armed (TitleMirrorTracking::unwritten); a page written on both sides keeps the title's
bytes, which are uploaded over the home before the next submission. Ranges are noted (note_title_write, with its
caps) where a V#, a writable geometry range, a title-memory resolution or a BVH range is answered by the mirror.
- The mirror's tracking is HotColdTracking (src/title_mirror_hot_cold.h); it now answers unwritten() for cold pages
from the version its guard was armed at (an additive change to that file and to the interface, default false).
- Homes go to device-local memory while VK_EXT_memory_budget keeps 1.5 GiB (or an eighth of the budget) for the
title's textures and render targets after a unit, to host memory otherwise, decided per 32 MiB unit and logged when
it switches; the mirror's line and the mem-probe item count units of each kind.
- The mirror's line adds hot and cold pages, write faults, hot and cold copies, and KiB uploaded a submission and a
frame.
Not moved: the XMemAlloc heap (HeapCreate places it). RtlCreateHeap over a reservation in the mirror's range faults
under Wine (it writes the reserved base), so it stays outside the mirror; slot-133 buffers there keep their shadows.
Tests: d3d12_page_mirror_test (Wine, iGPU): a slot-133 buffer over mirrored memory has the title's address as its GPU
VA and is no shadow; a GPU write into its home goes back to the title's page (one 256-byte piece), a page written on
both sides keeps the title's write. Linux ctest (llvmpipe) 122/122; xmem_test OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/memory_breakdown_test.cpp')
| -rw-r--r-- | runtime/test/memory_breakdown_test.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/test/memory_breakdown_test.cpp b/runtime/test/memory_breakdown_test.cpp index 17c804e9a..fd99fda42 100644 --- a/runtime/test/memory_breakdown_test.cpp +++ b/runtime/test/memory_breakdown_test.cpp | |||
| @@ -100,8 +100,9 @@ int text() { | |||
| 100 | EXPECT(contains(line, " + title windows and shadows 0 (0)")); | 100 | EXPECT(contains(line, " + title windows and shadows 0 (0)")); |
| 101 | EXPECT(contains(line, " + upload heaps 0 (0) + staging 0 (0) + texture blocks 0 (0) + sampled textures 0 (0)")); | 101 | EXPECT(contains(line, " + upload heaps 0 (0) + staging 0 (0) + texture blocks 0 (0) + sampled textures 0 (0)")); |
| 102 | EXPECT(contains(line, " + render targets and depth 1180 (1) + page mirror 0 (0)")); | 102 | EXPECT(contains(line, " + render targets and depth 1180 (1) + page mirror 0 (0)")); |
| 103 | EXPECT(contains(line, " chunks 1] + other 819 (1);")); | 103 | EXPECT(contains(line, " 0 host] + other 819 (1);")); |
| 104 | EXPECT(contains(line, "page mirror 0 (0) [homes bound 2 MiB (32), pages mirrored 40, chunks 1]")); | 104 | EXPECT(contains(line, "page mirror 0 (0) [homes bound 2 MiB (32), pages mirrored 40, chunks 1, units 0 " |
| 105 | "device-local 0 host]")); | ||
| 105 | EXPECT(contains(line, "imported 206 MiB (1)")); | 106 | EXPECT(contains(line, "imported 206 MiB (1)")); |
| 106 | EXPECT(contains(line, "bindless tables 2 MiB")); | 107 | EXPECT(contains(line, "bindless tables 2 MiB")); |
| 107 | EXPECT(contains(line, "shader modules 12 MiB SPIR-V")); | 108 | EXPECT(contains(line, "shader modules 12 MiB SPIR-V")); |