Repository navigation
GPU: retry tracked texture uploads after a staging allocation fails - #3174
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
|
Confirmed the conflict resolution with #3136 on an RTX 5080 and Windows inbox WARP. The allocator passed to The 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): git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/tracked-packed-retry
git switch --detach FETCH_HEAD
$env:VICTORY_D3D12_DEBUG = '1'
foreach ($warp in '0','1') {
$env:VICTORY_D3D12_WARP = $warp
cargo test --locked -p victory-gpu --all-features --lib packed_retry_preserves_old_and_new_writes -- --nocapture --test-threads=1
}AI-assisted testing with Codex. Synthetic texture data only. |
|
Thanks @steven-seagull27. I independently resolved the same conflict between 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
left a comment
There was a problem hiding this comment.
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).
A 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.
A 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.