D3D12.X: reduce retained texture upload staging #2024
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2024
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2024/head"
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?
@ZekkJJ on GitHub · 2026-11-25 01:05 UTC · original
ZekkJJ:codex/texture-upload-staging-memory→main· +115 −1 · 1 files · 1 commits · merged 2026-11-25 01:23 UTCTighten the synchronous CPU texture uploader's large staging allocation classes and release the cached staging reference after its completed copy fence, before replacement. A retail ownership probe recorded a 132.3 MiB request growing staging from 128 MiB to 256 MiB. At that point the old and new staging resources and 131.5 MiB of detiled payload coexisted, for 515.5 MiB of tracked capacity and payload. The CPU fallback coordination was posted to the #1513 discussion for the #1513 and #455 authors. Coordination
What is in it
crates/xcl/src/gpu/texture.rskeeps the existing small allocation classes, rounds requests above 64 MiB to 16 MiB and releases the completed buffer's cached reference before creating its replacement. It uses the existing layout, barriers and fence.Tested
cargo build --locked --workspace --jobs 1followed bycargo test --locked --workspace --jobs 1 --no-fail-fast -- --test-threads=1 --nocapturereported 997 passed, 0 failed, 45 ignored. The passed count includes 24 capability skips covering wave64, unsupported direct-DXIL cases, driver cache control and heap windows.Regression run
Not tested
AI use
@raylitebull on GitHub · 2026-11-25 01:12 UTC · original
Code review on
24162c7:staging_capacityincrates/xcl/src/gpu/texture.rskeeps the existing power-of-two growth (>= STAGING_MIN) up to64 MiB(STAGING_MAX_POW2) and switches tochecked_next_multiple_of(16 MiB)(STAGING_LARGE_STEP) above64 MiB, avoiding128 -> 256 MiBovershoots on ~132 MiB uploads.Uploader::stagingcallsdrop(self.staging.take())before allocating the replacement upload buffer, so the old and new staging buffers do not coexist. Becauseupload_batchwaits onup.fence(fence::wait, orstd::mem::forget(up)on timeout) before returning theUploaderviaput_back, the previous staging buffer is GPU-idle when dropped.large_staging_uses_sixteen_mib_growth_stepsandgpu_large_mixed_upload_keeps_tight_staging_and_exact_pixelscleanly cover the size classes, reuse, and byte-exact GPU readback.Build and test (Windows, no GPU)andPR descriptionare both green (CLEAN).Remaining before merge: An independent AMD GPU test pass on exact head
24162c7.@WebIdentity1 on GitHub · 2026-11-25 01:17 UTC · original · edited 2026-11-25 01:18 UTC
Independent AMD check completed on unchanged exact head
24162c76f4a2c5d2e673bc05fbfdba71c3426668.Tested — Windows 10 Home 19045, Ryzen 7 7800X3D, AMD Radeon(TM) Graphics iGPU, driver 32.0.21030.2001, Rust 1.98.1 MSVC, debug. The fixture printed the AMD adapter name; this was not run on the RTX 3090.
2 passed / 0 failed / 0 ignored, zero GPU skips. The 132 MiB mixed RGBA/BC7 batch grew staging from 128 MiB to 144 MiB. Both growth and repeat uploads passed byte-exact readback; the repeat reused the same staging resource/capacity. Size-class boundaries and overflow rejection passed. All 311 source SHA256 hashes matched before/after and match the clean head worktree; XCL recompiled. No local source patch.
Not tested — The debug-layer request failed with
0x887A002D(missing/mismatched SDK component), so this is not a zero-debug-errors result. No discrete AMD GPU, full suite, retail smoke, constrained-process memory experiment, peak-memory comparison, or controlled timing comparison in this check. The printed capacity is retained staging, not measured process-memory savings. This supplies the requested independent AMD iGPU readback evidence; it does not replace the project's other merge gates.AI use — Codex (GPT-6) inspected the fixture, prepared and ran this native Windows check, verified logs/source hashes, and wrote this report.
@tyr0nsur on GitHub · 2026-11-25 01:53 UTC · original
Independent post-merge hardware run on unmodified
main@3da2abb81606. Windows 11 Pro 26300, Ryzen 7 5800X, desktop GeForce RTX 4060, NVIDIA driver 32.0.16.2114, Rust 1.98.1 MSVC, default test profile.Your mixed RGBA/BC7 fixture printed a 138,412,032-byte request (132 MiB), with staging growing from 134,217,728 to 150,994,944 bytes (128 → 144 MiB). The repeated upload reused the staging resource and passed byte-exact GPU readback. The fixture printed the physical adapter name. Growth took 43.61 ms and reuse 23.27 ms in this single run.
I ran
cargo test --locked -p xcl --lib <filter> -- --nocapture --test-threads=1once each forlarge_staging_uses_sixteen_mib_growth_stepsandgpu_large_mixed_upload_keeps_tight_staging_and_exact_pixels. Both passed, with zero failures, ignores or capability skips. This run measures staging capacity and pixel correctness only.AI use: Codex (GPT-6) ran the two existing tests and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 04:12 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!