Textures: the card detile buffer is leased per list and pooled between (VICTORY_DETILE_LEASE=1) #2338

Open
101Leafy wants to merge 1 commit from upstream-pr/2338 into main
101Leafy commented 2026-11-29 12:08:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 101Leafy on 2026-11-29T12:08:04Z.


A texture detiled on the card keeps its linear buffer for as long as its staging buffer lives, so every texture that was ever copied holds a second copy of its bytes in video memory, even when no list has copied from it for minutes.

With VICTORY_DETILE_LEASE=1 the linear buffer is made when a list first copies from the texture and goes back to the pool once no list that copies from it is held:

  • Staging::lease takes a hold for the list before it records copies, making the buffer from the pool if no list holds one, and resets recorded so the new buffer is detiled again.
  • The list keeps a LinearLease in its deferred state; reset drops it, and the last one gives the buffer back to the pool.
  • If no buffer can be made, the texture is deferred instead of copied from a missing buffer.

Off by default; without the switch the buffer is made with the staging buffer, as before.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5550550733 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2338). Originally posted by [101Leafy](https://github.com/101Leafy) on 2026-11-29T12:08:04Z. --- A texture detiled on the card keeps its linear buffer for as long as its staging buffer lives, so every texture that was ever copied holds a second copy of its bytes in video memory, even when no list has copied from it for minutes. With `VICTORY_DETILE_LEASE=1` the linear buffer is made when a list first copies from the texture and goes back to the pool once no list that copies from it is held: - `Staging::lease` takes a hold for the list before it records copies, making the buffer from the pool if no list holds one, and resets `recorded` so the new buffer is detiled again. - The list keeps a `LinearLease` in its deferred state; reset drops it, and the last one gives the buffer back to the pool. - If no buffer can be made, the texture is deferred instead of copied from a missing buffer. Off by default; without the switch the buffer is made with the staging buffer, as before.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2338:upstream-pr/2338'
git switch 'upstream-pr/2338'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2338'
git switch 'upstream-pr/2338'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2338'
git switch 'upstream-pr/2338'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2338'
git switch 'main'
git merge --squash 'upstream-pr/2338'
git switch 'main'
git merge --ff-only 'upstream-pr/2338'
git switch 'main'
git merge 'upstream-pr/2338'
git push origin 'main'
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!2338
No description provided.