GPU: dynamic descriptor slots go back only to the heap that took them #1324
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1324
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1324"
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?
@CwWwWwW on GitHub · 2026-11-26 15:23 UTC · original
CwWwWwW:fix/dynamic-slots-heap-identity→main· +75 −19 · 3 files · 1 commits · merged 2026-11-26 18:05 UTCProblem
State::dynamic(crates/victory-gpu/src/draw.rs) keeps the title descriptor heap of each range of dynamic slots by its address, anddescriptor::release_dynamicfrees the range in whatever host heap is registered at that address when the list is reset.A command list may outlive the title heap it recorded slots from: D3D12 keeps an object alive while a list names it, so the title can release a shader-visible heap before the lists that use it are reset. If the allocator later places another
Box<Heap>at the same address and that heap is registered inSHADER_HEAPS, the old list's reset finds it by address and frees its dynamic slots - slots another live list has taken. Two live lists then hold the same dynamic slots; one rewrites the other's descriptors (wrong bindings, and descriptors rewritten under a list already submitted).Change
HostHeapgets an identity from a process-wide counter (NEXT_ID).State::dynamicrecords it next to the heap address.HostHeap::release/descriptor::release_dynamictake it and free only when it is the heap's.A heap that is still there takes its own ranges back exactly as before; a stale release for a heap that is gone (or for a new heap at the old address) does nothing - the host heap it named no longer exists, so there is nothing of it to free.
Tests
descriptor::host::tests::dynamic_slots_are_given_back_only_to_the_heap_that_took_them: two host heaps; a range of A's released with B's identity stays taken, with A's identity is given back.VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib --features diagnostics dynamic_slots_are_given_backpasses with the change; without it the test fails (free slots 262,144 against 262,142, i.e. B's identity freed A's range).cargo test -p victory-gpu --lib --locked: 218 passed, 0 failed, 6 ignored.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean; likewise with--all-features.(CI note: as with #1320/#1321, the
checkjob onmainis currently red on the asset-policy violation; #1322 fixes that, after which this branch can be rebased.)@CwWwWwW on GitHub · 2026-11-26 15:44 UTC · original
Overlap note for the maintainer: #589 (AscilCH) is an independent, exact fix for the other half of this change's area - it makes a released view heap drop its page table and edits
Heap::dropindescriptor.rsnext to the identity used by this PR. Both are needed; if #589 lands first, rebase this branch on it (and vice versa). I checked that #589 is not superseded by this PR.