D3D12.X: depth+UAV buffers on the PC fallback paths start as depth writes #1343

Merged
emirduran707 merged 1 commit from upstream-pr/1353 into main 2026-11-24 15:57:38 +00:00
emirduran707 commented 2026-11-24 15:08:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T15:08:49Z.


pc_resource_desc drops ALLOW_UNORDERED_ACCESS from console depth buffers, since the PC does not allow it together with ALLOW_DEPTH_STENCIL. Only CreatePlacedResourceX (#44) also moved such a buffer's initial state off UNORDERED_ACCESS, to DEPTH_WRITE. Three other paths that use the same converted description only masked the state:

  • the committed fallback of CreateCommittedResource (#27 / #76 / #127), taken when the texture cannot be placed in unified memory;
  • the PC-way retry and committed fallback of CreatePlacedResource (#29);
  • own_memory_if_larger_on_the_pc.

So a console texture created as depth + unordered access in the UNORDERED_ACCESS state was refused there with E_INVALIDARG (D3D12 allows that state only with ALLOW_UNORDERED_ACCESS), or fell back to COMMON.

A helper, pc_initial_state, now does what #44 did (mask, then UNORDERED_ACCESS → DEPTH_WRITE for a depth buffer), and all four sites use it.

What is in it

  • crates/xcl/src/hle/d3d12x/device_x.rs:
    • pc_initial_state, used at #44 (same result as before);
    • unit test depth_buffers_created_for_unordered_access_start_as_depth;
    • GPU test gpu_depth_buffer_created_for_unordered_access_is_placed. It places a 256x256 D16 depth + UAV texture: with the masked state the PC refuses it, and with pc_initial_state's state it is created.
  • crates/xcl/src/hle/d3d12x/real.rs: the three other sites.

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo test --workspace -- --test-threads=4 on 5383506: 753 passed, 0 failed, 41 ignored; no SKIPPED GPU tests; the GPU test ran on this adapter and shows both the refusal and the fix
  • the unit test against the mask alone (the old behaviour): left: 8, right: 16; with the helper it passes

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1530 (PresentX 1530)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18961 MB

this PR:

xcl-smoke v1
commit: 538350681e4aac86b4dd5595a0ac229077b07979
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1551 (PresentX 1551)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16754 MB

Not tested

  • A title texture taking one of these fallback paths; the smoke title's run is a regression check only.
  • #1063 registers depth twins only on the #44 path; resources from the fallback paths are made in DEPTH_WRITE now but are not tracked by it.
  • NVIDIA and Intel GPUs.

AI use

  • Claude Code with Claude Opus 5.5: found the problem, wrote the change, the tests and this description; I reviewed the diff and ran the tests and smoke runs above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6584909131 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1353). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-24T15:08:49Z. --- `pc_resource_desc` drops `ALLOW_UNORDERED_ACCESS` from console depth buffers, since the PC does not allow it together with `ALLOW_DEPTH_STENCIL`. Only `CreatePlacedResourceX` (#44) also moved such a buffer's initial state off `UNORDERED_ACCESS`, to `DEPTH_WRITE`. Three other paths that use the same converted description only masked the state: - the committed fallback of `CreateCommittedResource` (#27 / #76 / #127), taken when the texture cannot be placed in unified memory; - the PC-way retry and committed fallback of `CreatePlacedResource` (#29); - `own_memory_if_larger_on_the_pc`. So a console texture created as depth + unordered access in the `UNORDERED_ACCESS` state was refused there with `E_INVALIDARG` (D3D12 allows that state only with `ALLOW_UNORDERED_ACCESS`), or fell back to COMMON. A helper, `pc_initial_state`, now does what #44 did (mask, then `UNORDERED_ACCESS` → `DEPTH_WRITE` for a depth buffer), and all four sites use it. **What is in it** - `crates/xcl/src/hle/d3d12x/device_x.rs`: - `pc_initial_state`, used at #44 (same result as before); - unit test `depth_buffers_created_for_unordered_access_start_as_depth`; - GPU test `gpu_depth_buffer_created_for_unordered_access_is_placed`. It places a 256x256 D16 depth + UAV texture: with the masked state the PC refuses it, and with `pc_initial_state`'s state it is created. - `crates/xcl/src/hle/d3d12x/real.rs`: the three other sites. **Tested** - AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release - `cargo test --workspace -- --test-threads=4` on 5383506: 753 passed, 0 failed, 41 ignored; no SKIPPED GPU tests; the GPU test ran on this adapter and shows both the refusal and the fix - the unit test against the mask alone (the old behaviour): `left: 8`, `right: 16`; with the helper it passes **Regression run** main: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1530 (PresentX 1530) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18961 MB ``` this PR: ``` xcl-smoke v1 commit: 538350681e4aac86b4dd5595a0ac229077b07979 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1551 (PresentX 1551) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16754 MB ``` **Not tested** - A title texture taking one of these fallback paths; the smoke title's run is a regression check only. - #1063 registers depth twins only on the #44 path; resources from the fallback paths are made in `DEPTH_WRITE` now but are not tracked by it. - NVIDIA and Intel GPUs. **AI use** - Claude Code with Claude Opus 5.5: found the problem, wrote the change, the tests and this description; I reviewed the diff and ran the tests and smoke runs above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 16:06:27 +00:00
futurepro62 commented 2026-11-24 16:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:15:56Z.


Full-suite run, since this PR has no test report yet. Tested exact head 5383506 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: depth_buffers_created_for_unordered_access_start_as_depth, gpu_depth_buffer_created_for_unordered_access_is_placed.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7135733743 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1353#issuecomment-7135733743). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:15:56Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `5383506` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **753 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `depth_buffers_created_for_unordered_access_start_as_depth`, `gpu_depth_buffer_created_for_unordered_access_is_placed`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **753 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Mischief8713 commented 2026-11-24 16:07:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Mischief8713 on 2026-11-24T15:55:08Z.


GPU run of 5383506 on Windows (NVIDIA GTX 1660 Ti, Turing): 709 passed, 0 failed; the new test passes

Tested

  • NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64)
  • main at 930e8b4 on the same machine: lib 707 passed, 0 failed, 21 ignored; e2e 3 passed
  • The head contains current main.
  • lib: 709 passed, 0 failed, 21 ignored. hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed ran on the GPU and passed (it did not print SKIPPED).

Not tested

  • No retail title and no scripts/smoke.ps1 run, so no regression run
  • AMD GPUs; only Turing was run here

AI use

  • Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
<!-- greyfinch-sync:ivall/xcl:comment:7136829668 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1353#issuecomment-7136829668). Originally posted by [Mischief8713](https://github.com/Mischief8713) on 2026-11-24T15:55:08Z. --- **GPU run of `5383506` on Windows (NVIDIA GTX 1660 Ti, Turing): 709 passed, 0 failed; the new test passes** **Tested** - NVIDIA GeForce GTX 1660 Ti 6 GB (Turing, driver 32.0.16.2114), Ryzen 5 2600X, Windows 11 (10.0.26300), rustc 1.100.0, debug build - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64) - `main` at `930e8b4` on the same machine: lib 707 passed, 0 failed, 21 ignored; `e2e` 3 passed - The head contains current `main`. - lib: 709 passed, 0 failed, 21 ignored. `hle::d3d12x::device_x::tests::gpu_depth_buffer_created_for_unordered_access_is_placed` ran on the GPU and passed (it did not print SKIPPED). **Not tested** - No retail title and no `scripts/smoke.ps1` run, so no regression run - AMD GPUs; only Turing was run here **AI use** - Claude Code with Claude Sonnet 5.5 ran the commands and wrote this report. I checked the output.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1343
No description provided.