<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/runtime/src/vulkan_memory.h, branch docs/pso-cache-scope-note</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=docs%2Fpso-cache-scope-note</id>
<link rel='self' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=docs%2Fpso-cache-scope-note'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/'/>
<updated>2026-11-24T23:25:24+00:00</updated>
<entry>
<title>d3d12_vulkan: textures share blocks of device memory (VK-IMAGE-MEMORY-POOL)</title>
<updated>2026-11-24T23:25:24+00:00</updated>
<author>
<name>TheGeogeo</name>
<email>57634077+TheGeogeo@users.noreply.github.com</email>
</author>
<published>2026-11-24T23:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=2b72fb53d15c91d3cf5998f863c38854396ce03b'/>
<id>urn:sha1:2b72fb53d15c91d3cf5998f863c38854396ce03b</id>
<content type='text'>
Every committed and placed texture made its own vkAllocateMemory and
released it with its own vkFreeMemory, about 100 us and 200 us on an
RTX 3080. Small device-local textures now take ranges of 64 MiB blocks
(runtime/src/image_memory.h). Render targets, depth buffers, CPU-visible
textures and textures over an eighth of a block keep their own
allocation. A range goes back to its block through the deferred
deletion queue, and a texture in a reused range is zeroed before a
shader reads it.

Tests: image_memory (CPU) and d3d12_texture_memory (GPU).
</content>
</entry>
<entry>
<title>d3d12: log once when a texture or default-heap buffer spills out of device-local memory (D3D-299)</title>
<updated>2026-11-22T20:28:35+00:00</updated>
<author>
<name>0xTehuti</name>
<email>xtehuti@agentmail.to</email>
</author>
<published>2026-11-22T20:28:35+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=780a8770cff2447e2f1eee47f9f0cb573c759e47'/>
<id>urn:sha1:780a8770cff2447e2f1eee47f9f0cb573c759e47</id>
<content type='text'>
DeviceState::allocate takes the next memory type when device-local memory is
full, so on a 4 GB GPU a texture could land in system memory without a word.
leonida::spilled_to_host (vulkan_memory.h) says when that happened: the
allocation preferred DEVICE_LOCAL, needed no host access, and got a type
without it. The arena and upload heaps in system memory without Resizable BAR
are the memory type policy and are not reported. The first spill is logged
once, with its size, memory type and heap. Part of #2375.

# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
</content>
</entry>
<entry>
<title>Runtime: only allocate from a memory heap that can hold the allocation (arena without Resizable BAR)</title>
<updated>2026-11-22T04:01:36+00:00</updated>
<author>
<name>Ryx</name>
<email>118130241+Ryx69@users.noreply.github.com</email>
</author>
<published>2026-11-21T22:52:38+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=1267591716621f05c24c0d5570eb29bca157050d'/>
<id>urn:sha1:1267591716621f05c24c0d5570eb29bca157050d</id>
<content type='text'>
Without Resizable BAR the only DEVICE_LOCAL | HOST_VISIBLE memory type sits in a heap of 256 MiB or less
(214 MiB on an RTX 3090, driver 616.56). The 256 MiB default arena preferred that type, so vkAllocateMemory
was asked for more than the heap holds (VUID-vkAllocateMemory-pAllocateInfo-01713). The NVIDIA driver still
returned VK_SUCCESS, so the fallback to plain host-visible memory never ran, and d3d12_compute_test and
d3d12_draw_test failed under validation. Reported by CharlyRien.

memory_type_order (vulkan_backend.h) now leaves out every type whose heap is smaller than the allocation,
so the preference falls through to system memory there. DeviceState::allocate uses it for every allocation.
d3d12_state_map_test checks the order on that card's heap layout and with Resizable BAR on.
</content>
</entry>
<entry>
<title>Runtime: upload heaps in Resizable BAR memory when the GPU has it (D3D-96)</title>
<updated>2026-11-22T03:26:20+00:00</updated>
<author>
<name>Felix Croasdale</name>
<email>x2020evy@stfx.ca</email>
</author>
<published>2026-11-22T03:26:20+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=039df7d24f233793436089e338cd9bcdb1cf7aaf'/>
<id>urn:sha1:039df7d24f233793436089e338cd9bcdb1cf7aaf</id>
<content type='text'>
Upload-heap buffers asked for HOST_VISIBLE | HOST_COHERENT memory only, so the GPU read every vertex, index and
constant buffer a game uploads over PCIe from system memory. They now prefer DEVICE_LOCAL | HOST_VISIBLE |
HOST_COHERENT when the device has Resizable BAR: such a type in a device-local heap larger than the 256 MiB BAR
window (leonida::resizable_bar, runtime/src/vulkan_memory.h). Without Resizable BAR that type is a window of
256 MiB or less that every upload buffer would share, so they stay in system memory there. A full VRAM heap falls
back to system memory through DeviceState::allocate's existing order.

The device logs where upload heaps live, LEONIDA_UPLOAD_SYSMEM=1 keeps them in system memory for comparison, and
vulkan_memory_flags / device_upload_in_vram report the choice to tests. d3d12_state_map_test checks the detection
on the heap layouts of an RTX 5060 Ti with Resizable BAR, an RTX 3090 without it, a 256 MiB window and an
integrated GPU; d3d12_vulkan_device_test checks that its upload buffer is placed accordingly, and its GPU copies
then read that buffer in both placements.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
