fix(victory-gpu): retire kept host resources when releasing dynamic descriptor slots #446

Merged
Lewandox merged 1 commit from upstream-pr/446 into main 2026-11-27 12:55:43 +00:00
Lewandox commented 2026-11-26 18:55:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T18:55:22Z.


Summary

Rebased onto the #409 combined base (which already removed the 200 µs polling sleep from HostHeap::dynamic).

Fixes a VRAM / host-resource retention leak in victory-gpu/src/descriptor/host.rs:

  • HostHeap::release(first, n) previously cleared only the taken bitmap and left every released dynamic slot's self.kept[index] holding its ID3D12Resource COM reference until the slot was later overwritten.
  • Now HostHeap::release drains self.kept[index] for each released dynamic slot and retires the old resources via crate::host::retire_resource(old) after dropping the self.next mutex, matching HostHeap::keep and preventing evicted textures/buffers from staying pinned in VRAM/shared memory.
  • Adds GPU unit test descriptor::host::tests::release_clears_kept_resources_for_dynamic_slots.

Relates to #412.

Verification

  • cargo test -p victory-gpu descriptor::host::tests::release_clears_kept_resources_for_dynamic_slots (default and --features diagnostics)
<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5515604534 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/446). Originally posted by [Lewandox](https://github.com/Lewandox) on 2026-11-26T18:55:22Z. --- ## Summary Rebased onto the `#409` combined base (which already removed the 200 µs polling sleep from `HostHeap::dynamic`). Fixes a VRAM / host-resource retention leak in `victory-gpu/src/descriptor/host.rs`: - `HostHeap::release(first, n)` previously cleared only the `taken` bitmap and left every released dynamic slot's `self.kept[index]` holding its `ID3D12Resource` COM reference until the slot was later overwritten. - Now `HostHeap::release` drains `self.kept[index]` for each released dynamic slot and retires the old resources via `crate::host::retire_resource(old)` **after** dropping the `self.next` mutex, matching `HostHeap::keep` and preventing evicted textures/buffers from staying pinned in VRAM/shared memory. - Adds GPU unit test `descriptor::host::tests::release_clears_kept_resources_for_dynamic_slots`. Relates to #412. ## Verification - `cargo test -p victory-gpu descriptor::host::tests::release_clears_kept_resources_for_dynamic_slots` (default and `--features diagnostics`)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LooperSalty/AnyXboxX!446
No description provided.