mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #425] vulkan_bindless: a new set-0 generation reuses a spare set and writes only the delta; retired generations fit the pool limit (BINDLESS-SPARE-SET-DELTA) #477
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#477
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/425
Author: @Kokonotcu
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:pr/bindless-delta-log📝 Commits (2)
b69d590Bindless: cap retired generations by the update-after-bind pool limit (D4)5ab98b3Bindless: a new generation reuses a spare set and writes only the delta (I8)📊 Changes
5 files changed (+305 additions, -8 deletions)
View changed files
📝
runtime/CMakeLists.txt(+17 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+6 -3)📝
runtime/src/vulkan_bindless.h(+125 -5)📝
runtime/test/bindless_sizing_test.cpp(+31 -0)➕
runtime/test/vk_bindless_generation_test.cpp(+126 -0)📄 Description
Claim: BINDLESS-SPARE-SET-DELTA
What was wrong
Every generation of the bindless set 0 (a flush that changes a live hash-table entry: a live key's index replaced, or a key moved by a relocating insert) was a new descriptor pool and set into which every descriptor written so far was written again (
write_shadow): up to the whole set (~94k descriptors at full size without partially bound) for a one-entry change, on the submitting thread. And the number of retired generations kept alive (each a pool of the whole set's size) was capped at 8 whatevermaxUpdateAfterBindDescriptorsInAllPoolsallows, so on a device whose limit holds fewer, a replacing flush could fail to make its pool.What changed (two commits)
bindless::retired_generation_cap(D4): how many retired generations may wait for their submissions, at most 8, and fewer where their pools, the current set's and the new one's would not fitmaxUpdateAfterBindDescriptorsInAllPools(BindlessFeatures::pool_limit, set bysize_bindings). The device waits for the oldest past that cap, as it did at 8.BindlessSet::features()exposes the sizing for it.bindless::spare_setssays the budget has room), and the next generation takes it instead of making one. A numbered log of the descriptor writes applied since (binding, index) brings it up to date:write_deltawrites each element changed since its last sync, once. The log is pruned to what the spare and the retired generations still need, and dropped when it grows past four times the shadow (those sets then takewrite_shadow, as before).retired_generation_capleaves room for the spare.Note: open draft #113 (bindless zero-allocation pending writes,
vulkan_bindless.h) edits the same flush / pending-write code; the two will conflict textually, not in what they do.Testing
RTX 3080 Laptop GPU, i7-11800H, Windows 10 19045, NVIDIA driver, MSVC 2022 RelWithDebInfo, Vulkan SDK 1.4.350.
vk_bindless_generation_test(real GPU,vkUpdateDescriptorSetscounted, 3000 images, partially bound): descriptors written per new generation: 3788 every round before; 3769 for the first (no spare yet) and 1 (the table binding) for each one after.bindless_sizing_test: the cap with synthetic pool limits, the spare included (8 retired generations within 1048576 on this GPU).d3d12_set0_compute(four dispatches through set 0, every texel matched) andd3d12_bindless_churn(96 frames on a direct and a compute queue, 3 new generations, every sampled texel matched): pass.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.