GPU: keep streamed textures with mapped mip data in the middle #1021

Open
Lkxex wants to merge 1 commit from upstream-pr/1023 into main
Lkxex commented 2026-11-25 16:31:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T16:31:01Z.


The indexed texture pass treats mapped_bytes == 0 as a streamed-out resource and drops its host slot. The previous endpoint check returned zero whenever the first and last pages were unavailable, even if pages in the middle of the texture were already readable.

Keep the console-page sampling path when either endpoint is available. When neither endpoint is available, walk virtual memory regions so a fully absent reservation still reads as zero and committed mip data inside it is counted. Exclude no-access and guard regions from the readable-byte total.

The new Windows regression reserves 256 KiB, commits a middle 64 KiB region, and verifies that the staging reader sees its bytes with zeros in the holes. On the original implementation mapped_bytes returned 0. The fixed code returns 65,536, including with VICTORY_COMMITTED_QUERY=1 and a neighboring no-access region. All three title-memory tests passed in both query configurations. The test uses synthetic memory and no title files. Game capture and frame cost of the sparse fallback are unmeasured.

AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6608967049 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1023). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T16:31:01Z. --- The indexed texture pass treats mapped_bytes == 0 as a streamed-out resource and drops its host slot. The previous endpoint check returned zero whenever the first and last pages were unavailable, even if pages in the middle of the texture were already readable. Keep the console-page sampling path when either endpoint is available. When neither endpoint is available, walk virtual memory regions so a fully absent reservation still reads as zero and committed mip data inside it is counted. Exclude no-access and guard regions from the readable-byte total. The new Windows regression reserves 256 KiB, commits a middle 64 KiB region, and verifies that the staging reader sees its bytes with zeros in the holes. On the original implementation mapped_bytes returned 0. The fixed code returns 65,536, including with VICTORY_COMMITTED_QUERY=1 and a neighboring no-access region. All three title-memory tests passed in both query configurations. The test uses synthetic memory and no title files. Game capture and frame cost of the sparse fallback are unmeasured. AI-assisted.
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/1023:upstream-pr/1023'
git switch 'upstream-pr/1023'

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/1023'
git switch 'upstream-pr/1023'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1023'
git switch 'upstream-pr/1023'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1023'
git switch 'main'
git merge --squash 'upstream-pr/1023'
git switch 'main'
git merge --ff-only 'upstream-pr/1023'
git switch 'main'
git merge 'upstream-pr/1023'
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
fxceless/victory-fork!1021
No description provided.