D3D12.X: title textures are detiled on the GPU #1503
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1513"
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 ghost on 2026-11-24T17:10:05Z.
Part 2 of 2 for #1511, stacked on #1512 (only the top commit belongs here). The tiled bytes and the layout's tables (only the entries the texture reaches) go to the upload buffer as they are. A compute shader (
detile_gpu, DXCcs_6_0, root constants + root SRV / UAV) writes each subresource's rows into the uploader's scratch UAV buffer at itsGetCopyableFootprintsplace, and the copies into the texture read from there. Same formula asLayout::offset_z; reads out of range give 0.The CPU path stays for
XCL_GPU_DETILE=0, without DXC or the pipeline, for a texture the plan cannot take, and while tracing frames (that looks at the detiled bytes).What is in it
crates/xcl/src/gpu/detile_gpu.rs(new): the plan, the shader and its pipelinecrates/xcl/src/gpu/texture.rs:upload_batch_withdispatches it before the copiescrates/xcl/src/hle/d3d12x/title_textures.rs:plan_gpuper texture, the rest on the CPU as beforecrates/xcl/src/gpu/tiling.rs:Layout::tables, the offset tables for the shader;crates/xcl/src/gpu/mod.rs: the modulegpu_detile_matches_the_cpu: 78 textures (every 2D mode × element size, mips, 2 slices, tiled bytes cut short, 3D) read back byte-identical against the CPU detile494 changed lines, over the ~400 target: about half is the new module and its test, and the shader, its plan and the upload change don't work apart.
Tested
cargo test -p xcl --lib detile -- --test-threads=1: 7 passed, 0 failed (detile_level_runs_match_elements,detile_level_matches_element_by_element,linear_levels_detile_by_rows_as_by_elements,tile_then_detile_round_trips_with_partial_blocks,gpu_detile_matches_the_cpu,a_batch_detiled_on_several_threads_matches_one_thread,retail_ttpf_textures_detile_with_their_mip_chains). Run before the rebase onto930e8b4, which had no conflictsXCL_GPU_DETILE=0showed no difference in memoryRegression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:51:58Z.
Review: COMMENTED
The focused detile tests are useful. CONTRIBUTING.md also requires the full workspace suite to run on a GPU, with pass/fail/ignored counts and skipped-test names. This description reports only the detile tests. Please add the full-suite result before merge. AI-assisted review; I checked the Tested section against the guide.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:53:50Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-25T00:22:54Z.
I’m profiling host-side texture upload memory on a 16 GiB Windows system with an RTX 4060 Laptop GPU. On main
80f4819, one retail upload needed 132.3 MiB of copy footprints. The synchronous uploader grew its mapped buffer from 128 MiB to 256 MiB while the previous buffer remained live. The two staging buffers and the 131.5 MiB of detiled output overlapped at 515.5 MiB. The 256 MiB buffer then stayed cached through loading artwork. These are ownership-counter measurements at the allocation sites.@oishigeso @Cattn I’m considering a separate change in the synchronous
Uploader::stagingpath. Keep the existing small size classes, round larger requests in 16 MiB steps, and release the previous buffer after its existing fence has completed and before allocating the replacement. Keep the upload batch and waits as they are. The intended scope is independent of GPU detiling and the in-flight allocator and staging lifetime in #455.Does this overlap work you have underway, or is there a compatibility constraint in #1513 or #455 that I should account for? I’m validating an isolated experiment with readback and matched retail runs first.
AI use: Codex (GPT-6) instrumented and analyzed the local run.
Imported from ivall/xcl. Originally posted by LANgmas on 2026-11-25T05:48:05Z.
Independent dual-adapter validation — PR head
82bd5bc: PASSNVIDIA RTX 3050 Laptop GPU
gpu_detile_matches_the_cpuexecuted the actual GPU detile, dispatch and readback path.GPU detile matched the CPU in 78 textures.test_title_runs_and_game_folder_is_untouched(no retail title available).Intel Iris Xe
GPU detile matched the CPU in 78 textures.Test-selection note
The test helper's
device()usesD3D12CreateDevice(NULL, ...)and does not honorXCL_ADAPTER. I initially observed the default Intel adapter even when settingXCL_ADAPTER=nvidia. For the NVIDIA run, I used temporary per-application Windows GPU preference steering; an independent adapter probe confirmed RTX 3050 selection. The temporary preference was removed after testing.Limitations
9e3831e) is behind current upstreammain(6020a33). This is not a rebase or integration test against current main.This adds independent RTX 3050 full-suite evidence and Intel Iris Xe GPU-detiling validation beyond the existing AMD and RTX 3060 Ti reports.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:58:06Z.
Triage (#1607) – head
82bd5bcStacked on #1512 (only the top commit, the GPU detile, is new); no other open or merged PR detiles title textures on the GPU.
#1512's part is already on main in another form (
95f12a04: Chain::detile_level now uses Layout::detile_2d with contiguous run copies), so this needs rebasing onto main without #1512; the CPU fallback and gpu_detile_matches_the_cpu should then compare against main's detile_2d.XCL_GPU_DETILE defaults to on (detile_gpu.rs:enabled), so every title texture upload changes path by default; the evidence is one AMD RX 6700 XT, nothing on NVIDIA or wave32.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed