D3D12.X: share staging for zero-filled lazy texture mips (#1773) #2563
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by razormontana on 2026-11-25T23:18:38Z.
Part 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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T23:28:50Z.
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
Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-26T00:02:01Z.
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
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T00:17:21Z.
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.
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T04:42:56Z.
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).Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T04:57:46Z.
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).Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T01:58:17Z.
Independent desktop NVIDIA verification of PR #2573 at head
1bfa05d9214cf5f68e602233072d8786fd3c529a(1commit; exact parent & merge-base:e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
1bfa05d9)cargo test --release -p xcl --lib shared_zero_mip_staging_compacts_and_clears_the_full_span -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1324 filtered out× 3 (0.00s× 3,0skipped)cargo test --release -p xcl --lib gpu::texture:: -- --test-threads=1(3 consecutive runs)16 passed; 0 failed; 0 ignored; 1309 filtered out× 3 (0.87s,0.86s,0.86s,0skipped — includes live RTX 4060 texture upload tests)cargo test --release -p xcl --lib hle::d3d12x::title_textures:: -- --test-threads=1(3 consecutive runs)19 passed; 0 failed; 0 ignored; 1306 filtered out× 3 (0.82s,0.91s,0.81s,0skipped)cargo build --release -p xcl1m 10s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):PR #2573 (
1bfa05d9214cf5f68e602233072d8786fd3c529a):Runtime log observations (
xcl.log)9222log lines,0[ERROR]/ device-removal / panic lines.19528 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13975 MB committed by the process; video memory 6115 MB local, 4650 MB non-local.Limits of coverage
shared_zero_mip_staging_compacts_and_clears_the_full_span(3/3),gpu::texture::(16/16× 3 on RTX 4060), andhle::d3d12x::title_textures::(19/19× 3).title: 29640639exercises live lazy texture uploads and confirms zero visual/stability regression (frame-count delta vs. cached parent reflects single-run startup variance, not this PR); peak staging savings on textures with large zero-filled mip chains were not separately profiled.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:23:56Z.
Triage (#1607) – head
1bfa05dThis change is already on main:
a6dcf43("D3D12.X: share zero-mip upload staging") was adapted from this PR's commit1bfa05dand adds the same shared zeroed staging span for verified-zero mips (upload_batch_with_zero_mips,StagingOffsets,clear_staging_span), thetitle_textures.rszero masks and the README note, with an extra check that a zero mask matches the item's subresource count.Recommendation: close (superseded by main commit
a6dcf43).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:54:03Z.
Closing as superseded: this change is already on
main(a6dcf43).a6dcf43message says adapted from PR #2573 commit1bfa05d; same upload_batch_with_zero_mips / shared zero staging in texture.rs + title_textures.rs + README; XCL_TEXTURE_LEVEL_PAGES exists on main (vram.rs)Two independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed