Repository navigation
D3D12.X: cap title texture upload batches by count and 32 MiB - #1986
Merged
raylitebull merged 1 commit intoNov 25, 2026
Merged
Conversation
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
Member
|
Code review on
Remaining before merge: |
Empirical verification — PR #1986 (
|
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bound each title-texture upload batch in
title_textures::upload_allto at most 256 textures and 32 MiB (down from 256 MiB with no item limit).Previously,
upload_allonly split batches at 256 MiB (BATCH_BYTES = 256 << 20). During heavy streaming of small textures (4–64 KiB mip tails / UI / cubemaps), thousands of textures could accumulate below 256 MiB and be recorded into a singleExecuteCommandListscall (2 * Ntransitions +N * mipscopies), risking a Windows 2 s WDDM TDR (DXGI_ERROR_DEVICE_HUNG). Becausegpu::texture::Uploader::stagingrounds the peak batch footprint up to a power of two and keeps that upload buffer permanently mapped, a single 256 MiB batch also pinned a 256–512 MiB persistent upload heap for the rest of the process lifetime.What is in it
BATCH_BYTESfrom256 << 20to32 << 20and addBATCH_ITEMS = 256incrates/xcl/src/hle/d3d12x/title_textures.rs.batch_fits()withsaturating_addso empty batches always accept their first upload (even if larger thanBATCH_BYTES, preserving progress), while subsequent uploads split atBATCH_ITEMS,BATCH_BYTES, or device changes.subresources_of_all/ upload dispatch when every remaining entry in a chunk was filtered out byunchanged_skip().batch_fits_caps_items_bytes_and_devicecovering oversized single textures, item-count splitting, exact/overflow byte bounds, and device switching.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke.cargo test -p xcl --lib title_textures -- --test-threads=1: 14 passed, 0 failed, 0 ignored.cargo test -p xcl --lib gpu::texture -- --test-threads=1: 12 passed, 0 failed, 0 ignored.Regression run
main:
PR:
Not tested
AI use
batch_fits, added the unit test, ran the test/smoke verification, and drafted this description.