Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/d3d12_vulkan.md
Original file line number Diff line number Diff line change
Expand Up @@ -2081,8 +2081,18 @@ The game can use D3D12 descriptors in three ways, and the layer must handle all
heap pointers read by the mesh and pixel stages after a rebind. `d3d12_mesh_test` checks the recorded dwords
for a vertex draw, a resource-only rebind, a signature ending at s30 and one on the s0 layout.
Set `LEONIDA_GRAPHICS_DIRECT_HEAPS=0` to restore the previous draw arguments.
Missing console V# backing leaves a settled zero descriptor. Every 32 submissions a heap probes up to
eight of these slots in round-robin order, including independent UAV-counter failures.
Missing console V# backing leaves a zero descriptor in the copy. Each V# half of a console resource heap's copy
(the buffer V# and the UAV counter) has a record in host RAM of what it resolved to: the title's base and span,
the device address its copy names, and whether it resolved or waits (`src/console_heap_slot_records.h`, written
only by `fix_console_slot`). Two indexes find the halves near a range, by base and by target, per power-of-two
span class and 64 KiB-or-larger granule. Releases (a backing, a title-window or geometry block), alias ranges
removed or replaced (`TitleVaAliases` tells its listeners as it happens, `forget_copy` included) and additions
(a backing, an alias range, title memory) go on an unbounded per-device list; at the next submission each heap
fixes again exactly the slots whose records a change touches: a release or removal every half naming it, an
addition the waiting halves over it. Nothing walks the heap or reads the copy for this. A zeroed range, a slot
the title rewrote and a heap destroyed drop their records. `console_heap_slot_records_test` checks that a release
of a buffer 10 of 60,010 slots name looks at those 10, and compares the copy with a full re-resolution through
random writes, releases, additions and alias changes.
Console resource heap copies and shader-visible CBV/SRV/UAV heaps with at least 65,536 slots request
64 MiB of zeroed padding after their last descriptor. `LEONIDA_HEAP_GUARD_MB` sets the padding in MiB
(0 disables it). When arena space is tight, allocation can fall back to the heap alone. Only indices
Expand Down
2 changes: 1 addition & 1 deletion docs/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ reasons behind each step: [linux_proton.md](linux_proton.md#amd-on-linux-what-go
| `LEONIDA_TITLE_WATCHDOG=0`, `LEONIDA_TITLE_WATCHDOG_KICK=<trap RVA>,<kick RVA>` | the title's hang watchdog ([above](#settings-every-platform-needs)) |
| `LEONIDA_DEVICE_TYPE=6`, `LEONIDA_MAP_READBACK=1`, `LEONIDA_FRAME_PACING=1`, `LEONIDA_PRESENT_NO_TEAR=1` | taken over from the NVIDIA report below; their effect on AMD was not measured one by one |
| `LEONIDA_ARENA_MB=4095`, `LEONIDA_TITLE_WINDOWS_MB=4096`, `LEONIDA_GEOMETRY_MB=6144` | room for the title's buffers in the world |
| `LEONIDA_CONSOLE_RELEASE_FILTER=1`, `LEONIDA_SHADOW_ALIAS_MS=5000`, `LEONIDA_CONSOLE_FIX_US=0` | carried from earlier boot runs; their effect here was not measured one by one |
| `LEONIDA_SHADOW_ALIAS_MS=5000`, `LEONIDA_CONSOLE_FIX_US=0` | carried from earlier boot runs; their effect here was not measured one by one |
| `LEONIDA_DEVICE_FAULT=1` | a device-loss report if the GPU hangs |
| `LEONIDA_KEYBOARD_PAD=always` | the keyboard as the pad |

Expand Down
8 changes: 4 additions & 4 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4700,12 +4700,12 @@ if(TARGET Vulkan::Headers)
target_compile_options(title_window_plan_bounds_test PRIVATE /W4 /permissive- /utf-8)
endif()
add_test(NAME title_window_plan_bounds COMMAND title_window_plan_bounds_test)
# Host-RAM bitset of live console resource-heap V# slots (src/console_heap_vsharp_slots.h).
add_executable(console_heap_vsharp_slots_test test/console_heap_vsharp_slots_test.cpp)
# What each console resource-heap V# resolved to, and the slots a change touches (src/console_heap_slot_records.h).
add_executable(console_heap_slot_records_test test/console_heap_slot_records_test.cpp)
if(WIN32 AND MSVC)
target_compile_options(console_heap_vsharp_slots_test PRIVATE /W4 /permissive- /utf-8)
target_compile_options(console_heap_slot_records_test PRIVATE /W4 /permissive- /utf-8)
endif()
add_test(NAME console_heap_vsharp_slots COMMAND console_heap_vsharp_slots_test)
add_test(NAME console_heap_slot_records COMMAND console_heap_slot_records_test)
# A slot-133 shadow keeps a GPU write until the title's bytes under it change (src/shadow_keep.h).
add_executable(shadow_keep_test test/shadow_keep_test.cpp)
if(WIN32 AND MSVC)
Expand Down
3 changes: 1 addition & 2 deletions runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,7 @@ ones marked *diagnostic* only add log lines or exist to compare a run with and w
| `LEONIDA_CONSOLE_HEAP_ARENA` | unset | With `LEONIDA_CONSOLE_HEAP_GPU=1`, `1` puts a console heap's GPU copy and its guard in the arena (device-local where the device has ReBAR) instead of an import of host memory. No room in the arena: the import. |
| `LEONIDA_CONSOLE_GPU_TSHARPS` | on | With `LEONIDA_CONSOLE_HEAP_GPU=1`, the T#s of changed slots are registered by the resolver thread and the refresh only decodes them. `0` registers them on the submitting thread, under the fix budget. |
| `LEONIDA_CONSOLE_GPU_RETRY_MS` | `2000` | With `LEONIDA_CONSOLE_HEAP_GPU=1`, how often V# words that got no backing are asked for again, on a timer that bounds the cost per submission. |
| `LEONIDA_CONSOLE_GPU_FILTER` | `LEONIDA_CONSOLE_RELEASE_FILTER`'s value | With `LEONIDA_CONSOLE_HEAP_GPU=1`, `1`: a released backing, an alias range that went or a word answered since asks for a rescan of only the slots it touches, not of every V# slot. Overflows and key resets still rescan everything. |
| `LEONIDA_CONSOLE_RELEASE_FILTER` | unset | `1`: when a backing is released, only the console-heap slots whose V#s point into it are fixed again (by actual Vulkan address), instead of every V# slot of the heap. The heap log line counts the sweeps, live slots, fixes and full fallbacks. |
| `LEONIDA_CONSOLE_GPU_FILTER` | unset | With `LEONIDA_CONSOLE_HEAP_GPU=1`, `1`: a released backing, an alias range that went or a word answered since asks for a rescan of only the slots it touches, not of every V# slot. Overflows and key resets still rescan everything. |
| `LEONIDA_SHADOW_GPU` | unset | `1`: aliased pages of the slot-133 shadows are copied on the GPU at the start of a submission, from an import of the mapped title section (`VK_EXT_external_memory_host`, per 2 MiB window, kept while xmem's map journal shows no change over it). Destinations outside the arena and pages that do not import are copied by the CPU as before. |
| `LEONIDA_SHADOW_GPU_MB` | `1024` | With `LEONIDA_SHADOW_GPU=1`, the MiB of title memory imported for those copies at most. |
| `LEONIDA_SHADOW_JOIN` | unset | `1`: pieces of one shadow copy job that continue where the one before ended, in the pages and in the copy, are one copy (one GPU region); one the GPU refuses is copied by the CPU whole. |
Expand Down
Loading
Loading