GPU: retry tracked texture uploads after a staging allocation fails #3174
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3174
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3174"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 11:07 UTC · original
andrewpozdnakov7-jpg:codex2/texture-staging-retry→main· +112 −8 · 2 files · 1 commits · openA tracked texture takes its changed pages before reserving an upload buffer. If that reservation fails, the next submission sees a clean tracker and skips the upload even when staging space is available again. Restore the taken pages to that texture's tracker when the allocation is refused.
The same Windows WARP regression filled a tracked 4×4 RGBA8 texture, refused its first staging allocation, and allowed the next allocation with no title writes between the two attempts.
63bcca4A third refresh found the tracker clean. App-local WARP diagnostics passed 247 tests with one ignored. Strict GPU Clippy passed with default and all features. The asset policy passed.
#3136 also edits the allocation site in texture.rs. The two current branches have a text conflict there. When combined, retry the taken pages if the allocation of the packed staging space fails.
@steven-seagull27 on GitHub · 2026-11-26 11:17 UTC · original
Confirmed the conflict resolution with #3136 on an RTX 5080 and Windows inbox WARP. The allocator passed to
detilemust receive the packed byte count. Both adapters read back all 49,152/49,152 destination texels correctly after the retry. Tested merge of656a143and0c59a0f· Regression testThe test seeds three 128×128 RGBA8 slices with different values. It writes slice 2, refuses its 64 KiB reservation, then writes slice 0 before retrying. The retry requests 128 KiB for slices 0 and 2. Each updated slice and the untouched middle slice matched all 16,384 expected texels after the GPU copy and fence. The next refresh requested no space.
Two controls behaved identically on both adapters with the D3D12 debug layer enabled:
The existing single-mip readback and 4×4 retry regression also passed on both. To run the new synthetic test in a test checkout (PowerShell):
AI-assisted testing with Codex. Synthetic texture data only.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 11:22 UTC · original
Thanks @steven-seagull27. I independently resolved the same conflict between
656a143and0c59a0fand checked a different layout with app-local Agility SDK 620 and WARP 1.0.22.My tracked 512×512 RGBA8 fixture uploads both mips, changes only the 256×256 mip, then refuses its reservation once. The failed attempt and the retry both requested 262,144 bytes, compared with 1,310,720 bytes for the full texture. With no intervening title write, the retry staged mip 1 alone, all 65,536/65,536 texels matched, and the next refresh made no allocation. The combined suite also passed #3136's GPU mip readback and its untouched-mip control.
Full GPU diagnostics 249 passed, 1 ignored, strict GPU Clippy in both configurations, and asset policy passed. The composed detiler passes the packed size to the retry allocator. Your published merge and three-slice test provide a reproducible reference.
AI-assisted with Codex.
@Dukestar69 on GitHub · 2026-11-26 11:29 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib texture:: -- --test-threads=1: 3/3 passed (includingtracked_texture_retries_after_staging_allocation_fails).cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly marks tracked texture pages dirty again so uploads retry after a transient staging allocation failure.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.