Check the whole backing before idle texture eviction and preserve eviction totals #2724

Merged
Tristan1019-user merged 1 commit from upstream-pr/2724 into main 2026-11-30 14:12:01 +00:00
Tristan1019-user commented 2026-11-29 16:37:49 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tristan1019-user on 2026-11-29T16:37:49Z.


What it changes

The streamed-out texture and idle render-target sweeps use the first page as a fast prefilter. An absent first page doesn't prove the rest of the texture is gone. Before detaching an otherwise eligible host copy, compute its layout extent, acquire the existing nonblocking mapping read guard, and require the full address range to be unmapped. Hold the guard through detachment, not staging cleanup. Unknown layout/backing, overflow, or a busy mapping leaves the copy alone. Existing ownership and idle checks still apply.

Separately, the interval logger was resetting the same atomics that the lifetime logger reads. Take a delta from the last interval snapshot instead. This is an accounting correction, not a claim that more memory was actually returned to the driver.

How it was tested

Windows, focused victory-gpu library tests (no title or SDK needed): idle_detach_keeps_a_mapped_middle_page and the_slot_eviction_line_tells_what_eviction_did both passed on this PR base. The first reserves three pages, commits only the middle one, checks that ownership is unchanged, then decommits it and checks that the owner transfers exactly once. No gameplay, performance or full-suite claim for this revision.

Overlap

Uses the existing whole-range check already used for the host-pressure path. Extends it to two other detach paths; does not introduce a competing VRAM policy, change texture fidelity or include the busy-descriptor proposal in trustno1-coder/VIctory-NVIDIA#2173.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5552793699 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2724). Originally posted by [Tristan1019-user](https://github.com/Tristan1019-user) on 2026-11-29T16:37:49Z. --- ## What it changes The streamed-out texture and idle render-target sweeps use the first page as a fast prefilter. An absent first page doesn't prove the rest of the texture is gone. Before detaching an otherwise eligible host copy, compute its layout extent, acquire the existing nonblocking mapping read guard, and require the full address range to be unmapped. Hold the guard through detachment, not staging cleanup. Unknown layout/backing, overflow, or a busy mapping leaves the copy alone. Existing ownership and idle checks still apply. Separately, the interval logger was resetting the same atomics that the lifetime logger reads. Take a delta from the last interval snapshot instead. This is an accounting correction, not a claim that more memory was actually returned to the driver. ## How it was tested Windows, focused `victory-gpu` library tests (no title or SDK needed): `idle_detach_keeps_a_mapped_middle_page` and `the_slot_eviction_line_tells_what_eviction_did` both passed on this PR base. The first reserves three pages, commits only the middle one, checks that ownership is unchanged, then decommits it and checks that the owner transfers exactly once. No gameplay, performance or full-suite claim for this revision. ## Overlap Uses the existing whole-range check already used for the host-pressure path. Extends it to two other detach paths; does not introduce a competing VRAM policy, change texture fidelity or include the busy-descriptor proposal in trustno1-coder/VIctory-NVIDIA#2173.
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
trustno1-coder/VIctory-NVIDIA!2724
No description provided.