Skip to content

[upstream #1006] d3d12x: persistent on-disk pipeline library caching and coalesced descriptor heap staging - #124

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1006
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1006

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

This pull request implements persistent on-disk pipeline state library caching (ID3D12PipelineLibrary1) and coalesced descriptor heap staging in D3D12.X:

  1. Persistent on-disk pipeline library caching:
    In crates/xcl/src/hle/d3d12x/pipeline_library.rs, we introduce an ID3D12PipelineLibrary1 caching layer to persist driver-compiled hardware PSOs under %LOCALAPPDATA%\xcl\pso\host-pipelines.bin.
    In translated_graphics_pso and translated_compute_pso (crates/xcl/src/hle/d3d12x/real.rs), compiled pipelines are looked up by a 128-bit hash across root signatures, shader bytecodes, and rasterizer/blend state. On warm runs, LoadGraphicsPipeline and LoadComputePipeline return the precompiled driver pipeline immediately, eliminating the 50 ms to 300 ms DXIL-to-ISA driver JIT compilation stalls that cause heavy frame hitches on Intel Arc and other D3D12 hardware. Stored pipelines are serialized atomically upon window closure, process termination, and throttled presentation ticks. Empty pipeline library creation explicitly forwards a null pointer to ensure clean fallback under vkd3d-proton / Wine.

  2. Coalesced descriptor heap staging:
    In crates/xcl/src/hle/d3d12x/console_heap.rs, copy_range batches multi-slot descriptor copies by calculating destination addresses and indices directly, writing contiguous 64-byte chunks to GPU-mapped memory. In copy_console_slots, this eliminates repetitive HEAPS mutex locks and fine-grained PCIe write-combining buffer flushes across Resizable BAR.

Tested

  • Hardware: Intel Arc A770 16GB (Driver 32.0.101.9175), Windows 11 Pro 64-bit, MSVC 14.44.35207
  • Unit tests: cargo test -p xcl pipeline_library (4/4 passed), verifying deterministic name hashing, atomic serialization, and graceful empty library fallback on corrupted blobs across native Windows and Wine.
  • Descriptor heap tests: cargo test -p xcl console_heap (3/3 passed), verifying multi-slot descriptor range copying and renumbering.
  • Pipeline integration tests: cargo test -p xcl --test gpu_pso_e2e (7/7 passed) and cargo test -p xcl --test gpu_compute_e2e (2/2 passed).

Regression run
main (beaa245):

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (dfcd403):

xcl-smoke v1
commit: dfcd40343bb38df5127d2b550681a24a13303874
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1672 (PresentX 1672)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14858 MB

Not tested

  • Windows 10 versions older than build 19041

AI use

  • Claude Code and Antigravity assisted in hashing descriptor layouts and validating D3D12 pipeline library serialization lifetimes.

Mirror of xcl-dev#1006 (auto-synced, do not edit).

@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1006 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1006 branch November 25, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants