D3D12.X: title textures are detiled on the GPU #1513
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!1513
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@oishigeso on GitHub · 2026-11-24 17:10 UTC · original
oishigeso:detile-2-gpu→main· +553 −26 · 5 files · 2 commits · draftPart 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
@DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original
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!
@ZekkJJ on GitHub · 2026-11-25 00:22 UTC · original
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.
@LANgmas on GitHub · 2026-11-25 05:48 UTC · original
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.
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.