Repository navigation
D3D12.X: ask for tiled support before making a GPU-owned texture reserved (#940) - #951
Conversation
…rved (xcl-dev#940) R32G8X24_TYPELESS depth (and its 4x MSAA) has no TILED support on some drivers: CreateReservedResource was refused, an error in the debug layer, before the arena fallback. Check FORMAT_SUPPORT2_TILED and tiled MSAA quality levels first and go to the arena directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified One small edge in Verification assisted by OpenAI Codex (GPT-6.2 Astra). |
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on Two more passing tests than the baseline; asking for tiled support before making a GPU-owned texture changes no verdict. Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
|
Tested New tests: New path: here the driver reports no TILED support for R32G8X24_TYPELESS (1 and 4 samples; a temporary, uncommitted Whole suite (
The failures are not from the PR: main's run 2 fails the same 5 tests as the PR's run 2. They are Not tested: AI use: Claude Code, Claude Sonnet 5.5, ran the tests and wrote this report. |
|
Hardware check of Tested
Regression run PR ( Not tested
AI use
|
|
Linux / AMD RDNA3 datapoint. Merged state: head Full suite, Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Looks very close — just two small items to tidy up before merge: (1) return |
…he MSAA query says Review point on #951 (ettehn, raylitebull): with TILED clear in the format's support, the multisample quality query still ran, and if that query failed, reservable() said yes, so CreateReservedResource was tried and refused again. The format's answer now decides first.
|
Merged in 6828e07 – thanks. On top of it, 24d8b92 takes the review point of @ettehn and @raylitebull: with TILED clear, |
|
The inputs of this gate, measured on a macOS / D3DMetal host - and this host is exactly the shape your change guards against. Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal (the adapter reports "AMD Compatibility Mode"), Rosetta 2. A plain D3D12 program (no XCL, no game content), cross-built with LLVM-MinGW (clang 23.1.6), run under Wine. Feature level requested 12_1, Device (
So Per-format
The MSAA half is the permissive part, which is what your ordering change fixes: One thing this host shows that is worth keeping in mind for the rest of the VRAM work: the two gates disagree here. The device says Not tested here: a title actually creating reserved resources or tiled MSAA textures; no native-Windows or AMD-driver comparison (I have no host where Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for the run. The probe is a ~300-line plain D3D12 PE with no XCL in it and it reads no files. AI use: GPT-6 Luna wrote and ran the probe and drafted this comment; the codes, masks and tier values are from that run. |
Part of #940. Some drivers have no
TILEDsupport forR32G8X24_TYPELESSdepth, at 1 or 4 samples. Todayplace_on_pagesstill callsCreateReservedResource, gets refused (debug layer errors 738 / 723), and only then falls back to an arena. This PR asks the device first and goes to the arena directly. The result is the same arena texture, without the failed call or the debug-layer error.If a query itself fails,
reservablereturns yes, so creation decides as before. This does not address 1422 (first RT/DS use without Discard/Clear), 538 or 824 from the issue. Those need a separate change.What is in it
vram.rs:can_reserve(pure) andreservable(device query), checked beforeCreateReservedResource. The arena log line now gives the reason.reserved_needs_tiled_format_and_tiled_msaa(unit) andreservable_agrees_with_the_driver(GPU, or WARP if no hardware adapter). The second checks thatreservablematches whatCreateReservedResourceactually does for R32G8X24_TYPELESS ×1/×4, R32_TYPELESS and RGBA8. Both failed to compile before the fix and pass after it.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 3 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware: no wave64)placed_title_textures_share_vram_and_preserve_pixels(cubemap page count under parallel tests), thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory(poisonedVRAM_TEST_LOCK). Main 077ce40 fails the same 3, twice in a row. All 3 pass with--test-threads=1on this branch.d32s8_targets_…now logsformat 19 … not reserved (no tiled support for its format or sample count): in an arena, so the new path is exercised.Regression run
I have no retail title to run. Both runs below use the repo's own test title (
tests/data/testgame+xcl_testtitle.exe, assembled as ine2e.rs). It stops at itsargvcheck becausesmoke.ps1passes no--hello, and it behaves the same on both builds.main:
PR:
Not tested
XCL_D3D12_DEBUG=1, which is what would confirm 738/723 are gone. The test title never creates these depth targets.AI use
Two-way door: one early return in front of an existing fallback. The blast radius is GPU-owned texture placement only.
🤖 Generated with Claude Code