Restore views after partial texture eviction #4870

Open
github-bot wants to merge 1 commit from github-bot/gh-4869 into main AGit
Owner

@⁠senduora on GitHub · 2026-12-01 12:09 UTC · original
senduora:fix/restore-partially-evicted-texture-views → main · +64 −0 · 1 files · 1 commits · open

What it changes

Texture eviction can reset one descriptor slot before it finds a busy or rewritten slot. It keeps the host texture in that case, but earlier slots may remain waiting even though the texture is still available. Queue the existing texture-made notification after a partial reset so the normal submission path can restore the affected views. That path checks the current descriptor before publishing it.

How it was tested

  • Native Windows D3D12, using a synthetic 4×4 texture and two descriptor slots. No game data or console profile was used.
  • Before, 5fabb46 with only the regression test fails because slot 0 still has no matching host descriptor after the waiting slots are processed.
  • After, the same test passes on 730cc2e. It checks that both slots show the original retained texture.
  • Command: cargo test --locked --offline -p victory-gpu --lib a_busy_texture_view_wakes_the_views_reset_before_it -- --nocapture --test-threads=1.
  • Gameplay effects were not measured.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #4737 handles a similar rollback in the dead render-target sweep. This change covers the separate sampled texture eviction path.
**@⁠senduora** on GitHub · 2026-12-01 12:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4869) `senduora:fix/restore-partially-evicted-texture-views` → `main` · +64 −0 · 1 files · 1 commits · open ## What it changes Texture eviction can reset one descriptor slot before it finds a busy or rewritten slot. It keeps the host texture in that case, but earlier slots may remain waiting even though the texture is still available. Queue the existing texture-made notification after a partial reset so the normal submission path can restore the affected views. That path checks the current descriptor before publishing it. ## How it was tested - Native Windows D3D12, using a synthetic 4×4 texture and two descriptor slots. No game data or console profile was used. - Before, `5fabb46` with only the regression test fails because slot 0 still has no matching host descriptor after the waiting slots are processed. - After, the same test passes on `730cc2e`. It checks that both slots show the original retained texture. - Command: `cargo test --locked --offline -p victory-gpu --lib a_busy_texture_view_wakes_the_views_reset_before_it -- --nocapture --test-threads=1`. - Gameplay effects were not measured. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #4737 handles a similar rollback in the dead render-target sweep. This change covers the separate sampled texture eviction path.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 12:09:57 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 12:32 UTC · original

I found another case on 730cc2ed. evict_slots adds each reset descriptor to WAITING, including placed texture SRVs. make_waiting removes the list when the texture is republished. It recognizes direct resource views, leaving a placed SRV reset until a later draw mirrors it.

479b33d7 checks that the placed SRV still resolves to the retained texture before mirroring it. The lookup uses the same normalized shape and copy destination precedence as normal placed texture resolution and does not allocate a texture on a miss.

I ran the exact make_waiting from both heads in one Windows Rust fixture with the descriptor heap and texture lookup stubbed. The original restored the direct SRV only. The patch also restored the matching placed SRV and left the rewritten, unresolved, buffer and UAV views alone. The production changes compiled in the Windows victory-gpu test target and the staged asset check passed. This fixture did not verify hardware descriptor writes or rendering.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 12:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4869#issuecomment-7311293824) I found another case on `730cc2ed`. `evict_slots` adds each reset descriptor to `WAITING`, including placed texture SRVs. `make_waiting` removes the list when the texture is republished. It recognizes direct resource views, leaving a placed SRV reset until a later draw mirrors it. [479b33d7](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/479b33d7751e5fe20ff23ec5701a8e3457f9f0ae) checks that the placed SRV still resolves to the retained texture before mirroring it. The lookup uses the same normalized shape and copy destination precedence as normal placed texture resolution and does not allocate a texture on a miss. I ran the exact `make_waiting` from both heads in one Windows Rust fixture with the descriptor heap and texture lookup stubbed. The original restored the direct SRV only. The patch also restored the matching placed SRV and left the rewritten, unresolved, buffer and UAV views alone. The production changes compiled in the Windows `victory-gpu` test target and the staged asset check passed. This fixture did not verify hardware descriptor writes or rendering. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4870/head:github-bot/gh-4869'
git switch 'github-bot/gh-4869'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4869'
git switch 'github-bot/gh-4869'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4869'
git switch 'github-bot/gh-4869'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4869'
git switch 'main'
git merge --squash 'github-bot/gh-4869'
git switch 'main'
git merge --ff-only 'github-bot/gh-4869'
git switch 'main'
git merge 'github-bot/gh-4869'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4870
No description provided.