upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/d3d12_vulkan.md
diff options
context:
space:
mode:
authorAslan2142 <jan.trencansky@protonmail.com>2026-12-01 18:17:55 +0100
committerGitHub <noreply@github.com>2026-12-01 18:17:55 +0100
commitd2a564b66a96127bc06bb348f3fae52d11e4461e (patch)
tree5e529db7041dcdc1ba66659598a38281aa46b4a1 /docs/d3d12_vulkan.md
parent3dd1bf42049934c31d0eaacb9e4e7b3a72c71b38 (diff)
parent4a305d0666c1e23df2a4d4c738dc6245b01203d9 (diff)
Merge pull request #2865 from azsekazvamdimitar/feat/rtx3090-vram-perf-and-translator
d3d12/vulkan + rdna2spirv: staged VRAM arena, DMA readback batching, parallel shadows, stream-pool fix & wave64 perf (RT-ARENA-DEVICE-LOCAL-STAGED)
Diffstat (limited to 'docs/d3d12_vulkan.md')
-rw-r--r--docs/d3d12_vulkan.md24
1 files changed, 21 insertions, 3 deletions
diff --git a/docs/d3d12_vulkan.md b/docs/d3d12_vulkan.md
index 083c91e0d..52cd58419 100644
--- a/docs/d3d12_vulkan.md
+++ b/docs/d3d12_vulkan.md
@@ -1908,9 +1908,27 @@ The runtime allocates image keys from `0x100000000` (4 GiB) in 256-byte steps, a
1908 `GPU address arena: 4080 MiB of the 4095 MiB asked for, capped by the device's Resizable BAR memory types`. 1908 `GPU address arena: 4080 MiB of the 4095 MiB asked for, capped by the device's Resizable BAR memory types`.
1909 Without Resizable BAR nothing changes. 1909 Without Resizable BAR nothing changes.
1910- M4+: allocate the arena `DEVICE_LOCAL` and stage CPU writes (descriptor heaps, shader blobs, buffer uploads) 1910- M4+: allocate the arena `DEVICE_LOCAL` and stage CPU writes (descriptor heaps, shader blobs, buffer uploads)
1911 through a host-visible staging buffer, copied before the commands that use them. The hash table is not in the 1911 through a host-visible staging buffer, copied before the commands that use them (`runtime/src/arena_staging.h`,
1912 arena either: it is a normal storage buffer in `DEVICE_LOCAL` memory, uploaded from a mapped staging copy before 1912 `LEONIDA_DEVICE_LOCAL_ARENA=auto|1|0`).
1913 the commands that read it (D3D-76). 1913 - In `auto` mode (the default), when the arena does not fit in `DEVICE_LOCAL | HOST_VISIBLE` memory (e.g. discrete
1914 GPUs without Resizable BAR where BAR1 is 256 MiB or less) and both a pure `DEVICE_LOCAL` VRAM type and a
1915 `HOST_VISIBLE | HOST_COHERENT` system-RAM staging type fit, `arena.buffer` is allocated in pure `DEVICE_LOCAL`
1916 VRAM and `arena.mapped` points at the `HOST_VISIBLE | HOST_COHERENT` staging mirror (`arena.staging_buffer`). On
1917 GPUs with Resizable BAR or unified memory, `auto` keeps the zero-copy single buffer; `LEONIDA_DEVICE_LOCAL_ARENA=1`
1918 forces the staged path for testing, and `LEONIDA_DEVICE_LOCAL_ARENA=0` keeps the single host-visible arena.
1919 - Overflow `TitleBufferWindows` slabs outside the main arena are budgeted by `LEONIDA_EXTERNAL_WINDOWS_MB` (default
1920 4096 MiB total when staged — counting both VRAM and host staging mirror — or 2048 MiB when unstaged). Empty slabs
1921 beyond one spare are reclaimed.
1922 - CPU writes into `arena.mapped` (`ShadowPages`, console and standard shader-visible descriptor heaps, shader blobs,
1923 `write_arena_value`, geometry leases, placed/committed buffer init and `Map`/`Unmap`) are tracked at exact byte
1924 granularity (never rounded up to 4 KiB pages, so flushing a 256-byte shadow piece or 32-byte descriptor never
1925 overwrites neighboring GPU writes on the same page), coalesced, and uploaded with batched `vkCmdCopyBuffer` plus
1926 cross-queue timeline synchronization before each submission. GPU-to-CPU readbacks (`write_back_titles`, retired
1927 shadow write-back, readable placed-buffer `Map()`, `read_arena`) subtract any unflushed dirty spans before copying
1928 back via `VulkanContext::copy_buffer_sync()`. `arena_staging_test` (CPU) covers the policy and dirty tracker.
1929 - The hash table is not in the
1930 arena either: it is a normal storage buffer in `DEVICE_LOCAL` memory, uploaded from a mapped staging copy before
1931 the commands that read it (D3D-76).
1914- Upload-heap buffers prefer `DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT` memory when the GPU has Resizable BAR 1932- Upload-heap buffers prefer `DEVICE_LOCAL | HOST_VISIBLE | HOST_COHERENT` memory when the GPU has Resizable BAR
1915 (D3D-96): the CPU writes them through the BAR and the GPU reads them from VRAM. `leonida::resizable_bar` 1933 (D3D-96): the CPU writes them through the BAR and the GPU reads them from VRAM. `leonida::resizable_bar`
1916 (`runtime/src/vulkan_memory.h`) calls it Resizable BAR when such a type sits in a device-local heap larger than 1934 (`runtime/src/vulkan_memory.h`) calls it Resizable BAR when such a type sits in a device-local heap larger than