D3D12.X: share staging for zero-filled lazy texture mips (#1773) #2573
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!2573
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2573"
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?
@razormontana on GitHub · 2026-11-25 23:18 UTC · original
razormontana:d3d12x/share-zero-mip-upload-staging→main· +229 −31 · 3 files · 1 commits · openPart of #1773 and #1833. Lazy texture uploads can contain several all-zero mips. The title-texture uploader now uses one zero-filled staging span for their sources, reducing the staging request while still copying every mip.
What is in it
title_textures.rspasses the existing lazy-level zero detection into the CPU uploader.texture.rsshares one aligned span when at least two zero sources are present, retaining the driver's footprint dimensions and each copy and transition. The reused staging span is cleared through the final row of every depth slice.Tested
cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputon1bfa05dreported 1424 passes, 0 failures, and 46 ignored. There were 26 explicit runner skips within the pass count.cargo build --offline --locked --release -p xclsucceeded.scripts/smoke.ps1ran the same title offline for 60 seconds per arm with direct DXIL and matching cache seeds.Regression run
Main
PR head
Not tested
AI use
Yes, Codex GPT-6.2 Sol implemented and independently reviewed the patch, ran the tests, and prepared this description.
@DavidM1911 on GitHub · 2026-11-25 23:28 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.Thanks!
— Devin
@xpatfussy69x on GitHub · 2026-11-26 00:02 UTC · original
Test run on exact head
1bfa05d(1bfa05d9214cf5f68e602233072d8786fd3c529a, on its basee1d84b7), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib shared_zero_mip_staging: 1 passed, 0 failedshared_zero_mip_staging_compacts_and_clears_the_full_span: okRegression run (60 s, default settings, a retail title)
main:
this PR:
No crash or device removal; frames 104 % of
main's, peak commit 100 %. Themainrun is on currentmain(08db802), newer than this PR's base.Not tested
main(tested on its own base; it merges into08db802without conflicts)AI use
@thehollowedone on GitHub · 2026-11-26 00:17 UTC · original
Independent Windows/NVIDIA check of the current clean head
1bfa05d. RTX 3080 Ti / driver 621.35, Windows 11 build 26300, rustc 1.99.1, DXC 1.8.2502.11; debug build.Tested
cargo test -p xcl --lib shared_zero_mip_staging_compacts_and_clears_the_full_span -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored.cargo test -p xcl --lib a_placed_texture_gets_the_pages_of_a_level_with_its_texels -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored. This exercised placed-resource refresh and GPU readback: the newly zeroed top and packed mips read back zero, while the nonzero neighboring mips retained their expected bytes. Neither focused test skipped.cargo build --workspace: passed.cargo test --workspace --no-fail-fast -- --test-threads=4: 1,424 passed, 0 failed, 46 ignored; 25 explicitSKIPPEDGPU notices. Both named tests passed in the workspace run too.Not tested: a paired retail-title smoke on this machine, AMD/native wave64, retail staging allocation savings, VRAM use, or world-load time. The synthetic planner's size assertions are not a measured retail performance result.
AI use: Codex (GPT-6.2 Sol) reviewed the tests, ran the commands, and drafted this report; GPT-6.2 Astra reviewed the staging and queue-lifetime reasoning.
@pickles976 on GitHub · 2026-11-26 04:42 UTC · original
Wine/NVIDIA cross-check: planner test passes; the GPU fixture cannot run under stock vkd3d-proton on this host. Head
1bfa05d9214cf5f68e602233072d8786fd3c529a, Linux + Wine 11.0, vkd3d-proton 3.2.0 (2576c0b4adfae4a), NVIDIA 590.48.1, RTX 4060 Laptop GPU 8 GiB,--locked --target x86_64-pc-windows-msvc, one test thread, freshCompiling xcl .../xcl-pr2573/...provenance, vendor masking disabled.gpu::texture::tests::shared_zero_mip_staging_compacts_and_clears_the_full_span— 1/1 pass (CPU-only, 0.00 s): shared offsets, full pitched clearing and requested size all check out on this host.hle::d3d12x::title_textures::tests::a_placed_texture_gets_the_pages_of_a_level_with_its_texels— aborts before the test body on stock vkd3d-proton's replaced-vtable assertion:ID3D12Fence1 – 12 PC methods, 10 internal slots under the guard, +64 stubsthenAssertion failed: iface->lpVtbl == &d3d12_fence_vtbl, file ../src-vkd3d-proton/libs/vkd3d/vkd3d_private.h, line 705, exit 3. This is the known #175 infrastructure wall on Linux/Wine (the same abort shape as the GPU fixtures of #2428/#2558 here), not a failure of this PR's code: the fixture's fence-guard setup itself trips the stock library. No pass/fail claim for the placed-texture extension on this stack; the Windows RTX 3070 result in the PR description remains the only GPU coverage of it.So on this host: staging-planner logic verified; zero-mip GPU readback unverified pending a vkd3d-proton build that tolerates replaced vtables (the #175 proposal, or the relaxed-vtable two-hunk build described in #2140). No title run; no staging-byte savings measured at retail.
Logs:
.compat-xcl/logs/verify-pr2573-wine-planner.log,verify-pr2573-wine-placed.log(local). AI-assisted verification and report (OpenAI Codex).@pickles976 on GitHub · 2026-11-26 04:57 UTC · original
Follow-up: the placed-texture GPU fixture now runs and passes on a relaxed diagnostic stack. My earlier comment reported the GPU leg aborting pre-body on stock vkd3d-proton's fence-vtable assertion (
vkd3d_private.h:705) with no verdict possible.Rebuilt the same exact provenance commit our stock DLL came from (
2576c0b4adfae4a) with-Db_ndebug=trueplus the twofrom_ifacerelaxations from #175 (local diagnostic build only), same RTX 4060 Laptop / Wine 11.0 / NVIDIA 590.48.1 host:a_placed_texture_gets_the_pages_of_a_level_with_its_texelspasses 1/1 (1.16 s, 0 ignored), freshCompiling xcl .../xcl-pr2573/...provenance.That completes this machine's verification of the PR: staging planner 1/1 (stock stack) and the placed-texture zero-mip GPU fixture 1/1 (relaxed diagnostic stack) — both consistent with the author's Windows RTX 3070 result. The fixture exercises the shared zero-span clearing of a previously mapped top mip and a packed mip with nonzero neighbours preserved, on the real adapter. No retail staging savings measured. Log:
.compat-xcl/logs/verify-pr2573-wine-placed-relaxed.log(local). AI-assisted verification and report (OpenAI Codex).mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175github-bot referenced this pull request2026-11-26 12:40:17 +00:00
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.