D3D12.X: map and unmap 3D texture mips separately #1028
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!1028
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1028"
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?
@bobosneefdev on GitHub · 2026-11-24 10:33 UTC · original
bobosneefdev:d3d12x-volume-mip-regions→main· +73 −11 · 2 files · 1 commits · openOn RX 6800, one linear tile-mapping region leaves upper 3D mips reading zero, and a NULL update over the same region leaves them mapped. By the spec one region from subresource 0 covers every mip; this maps and unmaps 3D textures with one region per standard mip plus the packed tail instead. Requested follow-up to #470; independent of it.
Since #1990, 3D textures with an XG packed mip tail take the detile/upload path instead of
vram::Pages, so this applies to placed volumes whose mips all stay above the tail.What is in it
vram.rs:tile_regionsbuilds the regions fromGetResourceTiling, shared by map and unmap. 2D textures and unexpected tilings keepmain's single region, including its trailing-SKIPtrim from3bc7143; 3D textures with split regions skip that trim, since their regions must cover every tile.title_textures.rs: a 256×256×64 four-mip volume (no XG packed tail, so placed), and a check that every mip of a placed 3D texture reads zero after retirement.Tested
7a8b3a0196a7662668b50304373454658be2875b(onmain6987e49):cargo test --workspace --no-fail-fast -- --test-threads=4: 1153 passed, 1 failed, 46 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1; it fails the same way on cleanmainand does not touch this code.heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows); the per-lane cases off16_programs_on_the_gpuandf32_programs_on_the_gpu(refused by design).placed_title_textures_share_vram_and_preserve_pixelsonmain6987e49with this test but without thevram.rschange: fails with3D 256x256x64 4 mips: subresource 2 mismatch(2/2 runs); with it, passes.Regression run
scripts/smoke.ps1 -Game '<game folder>' -Seconds 60, release,XCL_DATA_ROOT=%TEMP%\xcl-mips-game-data,XCL_COHERENT_MB=512,XCL_FRAME_DUMP=300, no scripted input. Three alternating clean pairs on6987e49/7a8b3a0(main/head frames): 678/802, 872/810, 675/741; no removals or crashes, peak commit 16851–17578 MB on both. The blocks below are the first pair.Main (
6987e49):This head (
7a8b3a0):Not tested
XCL_SAMPLE_*inputs.AI use
gpt-6.1-sol): implementation, tests, first description.3bc7143and6987e49, the test update after #1990, description, full test runs, revert checks, smoke pairs and the mapping instrumentation.🤖 Generated with Claude Code
@AlexandreSchuelter on GitHub · 2026-11-24 11:15 UTC · original
Test report on an RX 6900 XT (RDNA2): this PR fixes the
3D 64x64x64 4 mips: subresource 2 mismatchfailure, as-is and merged ontomain, and merges cleanly with #470.Tested
stable-x86_64-pc-windows-msvc, release;XCL_NETWORK=0,XCL_REQUIRE_GPU=wave64; no SKIPPED testscargo test -p xcl --lib --release -- --test-threads=4:placed_title_textures_share_vram_and_preserve_pixelsmain384f7f73D 64x64x64 4 mips: subresource 2 mismatch8e11e74384f7f73896e4f) merged onto384f7f7main(transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory) arePoisonErrorcascades: both pass when run without the failing test.main0/5 passed, this PR merged ontomain5/5 passed.Not tested
--workspace), only thexcllib testsscripts/smoke.ps1(no game here), debug builds, other GPUsAI use: Claude Code (Claude Opus 5.5) fetched the branches, ran the tests and wrote this report; the runs are real, on the hardware above.
@DavidM1911 on GitHub · 2026-11-24 11:18 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X Radeon iGPU (gfx1036 RDNA2) + RTX 3060 Ti; Rust stable MSVC, debug.
XCL_ADAPTER=radeon cargo test -p xcl --lib vram -- --test-threads=4: 8 passed, 1 failed —gpu_sparse_vram_descriptors_buffers_and_xmem(submit 1 lane 0 mismatch, left 0 / right 1077). That is the known #343 write-watch race between this test andplaced_title_textures_share_vram_and_preserve_pixels; the same pair fails identically on cleanmain384f7f7on this machine (3/3 + 1/1 runs), so it is not a regression here — on this iGPU the race resolves the same way every time.placed_title_textures_share_vram_and_preserve_pixelsitself passed on the Radeon — it carries this PR's new "unmapped subresource still reads data" asserts for 3D mip regions.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@RodrigoTorreao on GitHub · 2026-11-24 12:40 UTC · original
Test report on RDNA2 for b3c53e9 (head of this PR, unmodified).
Tested
XCL_SAMPLE_RPF,XCL_SAMPLE_DLLS,XCL_SAMPLE_TTPF,XCL_SAMPLE_BVH4set to the retail title's filesmain47efa2e,cargo test --workspace --no-fail-fast -- --test-threads=4: 738 passed, 3 failed, 41 ignored, 0 SKIPPEDplaced_title_textures_share_vram_and_preserve_pixels:3D 64x64x64 4 mips: subresource 2 mismatch(mip 2 reads as zeros)transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memoryfail only withPoisonErrorafter it; each passes when run alonecargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4: 741 passed, 0 failed, 41 ignored, 0 SKIPPED;placed_title_textures_share_vram_and_preserve_pixelspasses, including the 3D subresource 2 caseNot tested
scripts/smoke.ps1run on the retail title, so this does not answer the frame-rate drop in the description (741 vs 1,004 frames)AI use
@RodrigoTorreao on GitHub · 2026-11-24 13:10 UTC · original
Test report on RDNA2 for b3c53e9, this PR's head, unmodified.
The packed-mip test passes with this PR. Over repeated smoke runs I could not find the frame-rate drop from the description. The spread between runs of the same build is larger than any difference between builds, so this setup can neither confirm nor rule it out.
Tested
XCL_SAMPLE_RPF/DLLS/TTPF/BVH4set to the retail title's files,cargo test --workspace --no-fail-fast -- --test-threads=4.main47efa2e: 738 passed, 3 failed, 41 ignored, 0 SKIPPED.placed_title_textures_share_vram_and_preserve_pixels:3D 64x64x64 4 mips: subresource 2 mismatch. Mip 2 reads as zeros.PoisonErrorfollow-ons. Each passes when run alone.cargo build --workspace: 741 passed, 0 failed, 41 ignored, 0 SKIPPED.scripts/smoke.ps1 -Seconds 60on the retail title, DXC 1.9.2609 viaXCL_DXC_DIR, warm DXIL cache.pressed, andkeyboard_mouse = falsewas set for the interleaved rounds.Regression run
Frames shown in 60 s, all clean runs. The last three columns are interleaved rounds, in the order main → #470 → this PR.
47efa2excl-smokeblocks and logs and can paste any of them.Not tested
GetDeviceand aGetResourceTilingper map/unmap of a 3D texture, and one region per mip. I did not profile it.AI use
@JoaoPauluu on GitHub · 2026-11-24 14:22 UTC · original
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.b3c53e9as it is (merge base47efa2e) andmain47efa2e, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Twelve runs in a row,mainfirst and last, other PRs in between.title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels(--exact, one process each, lib test binary under Wine): 3 of 3 passed on this PR (its new3D 128x128x128 5 mipscase included) and 3 of 3 onmain47efa2e. vkd3d-proton implements the tile mappings itself, not an AMD driver. I did not check whether the 3D shapes were placed as tiled resources here (the tier 3 branch) or fell back to committed ones, so this does not show the RX 6800 fault or its fix on this stack.Regression run
main (first run):
this PR:
The last
mainrun: 1425 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@thiagocalile on GitHub · 2026-11-24 15:00 UTC · original
Tested commit
b3c53e98de18b2150b361303010f702ba3610f31on an AMD RX 6600 (RDNA2) wheremain(930e8b4) failsplaced_title_textures_share_vram_and_preserve_pixelswith3D 64x64x64 4 mips: subresource 2 mismatch(plus 2 cascadingPoisonErrorfailures). This PR fixes it and passes the new3D 128x128x128 5 mipsand post-retirement unmap checks.Tested
XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (26200), Rust 1.100.0 (stable-x86_64-pc-windows-msvc, debug), DXC 1.8.2502.11.XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 736 passed, 0 failed, 41 ignored (xcl --lib: 698 passed, 0 failed, 21 ignored; integration tests: 38 passed, 0 failed, 20 ignored).SKIPPED(2 tests, not coverage):test_title_draws_with_a_root_signature_under_the_debug_layer:no d3d12SDKLayers.dlluploads_start_from_each_subresources_state:no D3D12 debug layer (0x887A002D)Not tested
d3d12SDKLayers.dllnot installed) and systemxgameruntime.dll.scripts/smoke.ps1) — no game executable available here.XCL_SAMPLE_*tests on this commit, other GPUs / drivers (RDNA1/3/4, NVIDIA, Intel).AI use
@JJAutoCompare on GitHub · 2026-11-25 05:33 UTC · original
Empirical test report (325f864c)
PR #1028 was checked at
325f864cab487b2f8d7831d2bbca977a06ad81a2in a clean, detached worktree.Hardware / environment
32.0.101.9175. A separate D3D12 capability query on adapter 0 returned Tiled Resources Tier 4 and Resource Heap Tier 1.1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5 (01b62ad47). Unoptimized Cargo test profile with debug info and incremental compilation disabled.Commands and results
cargo test --workspace --no-runcompleted outside the Arc lock (exit 0).Invoke-ArcTest.ps1, ran onlyxcl-77aca8ccb20e299f.exe --exact hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelswithXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1(exit 0). The fixture selects DXGI adapter 0 directly.SKIPPEDmarker, leaving 0 completed fixture bodies.Observed behavior
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2. That branch also checks Resource Heap Tier 2. The Arc adapter's Resource Heap Tier 1 fails the check before any texture placement, mip readback, or retirement assertions.Not tested
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1028-focused.logand published.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.