D3D12.X: match default depth views to MSAA textures #1087
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!1087
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1087"
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?
@gloger2003 on GitHub · 2026-11-24 11:25 UTC · original
gloger2003:fix/d3d12-msaa-depth-view→main· +47 −5 · 2 files · 1 commits · openMinecraft Preview 1.18.3064.0 lost the D3D12 device on the RX 7800 XT during its first depth/stencil clears. A first-parent bisection found
38b05b7as the first failing commit (956a476worked). That commit started creating typed default views for typeless depth textures. The generated default view used TEXTURE2D or TEXTURE2DARRAY regardless of the sample count.What is in it
Tested
Windows 11 26300.9974, Radeon RX 7800 XT (32.0.32029.2010), Ryzen 7 5700X, Rust 1.100.0 MSVC and DXC 1.9.2602.17.
The focused descriptor test failed before the change on a 4x resource and passed with the change.
Workspace build and cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output on the PR commit: 742 passed, 0 failed, 41 ignored, no explicit GPU capability skips.
Minecraft Preview reached the main menu and drew 3,420 frames in the 60-second run. Both release runs below used a fresh data root and the same frame-capture interval.
A repeat 60-second run on the same PR head drew 3,411 frames with no device removal or crash (peak commit 3,525 MiB). The pre-regression main commit
956a476exited cleanly after 60 seconds, but only drew 718 frames and stopped presenting after roughly 16 seconds.Supplemental 12-second runs with fresh data roots compared
956a476with this PR head. They drew 617 and 615 frames respectively, both with zero removals and crashes. External 500 ms samples of the XCL host process showed peak private bytes of 2,800 and 3,165 MiB respectively (+13.1%). This comparison spans other changes on main and does not measure the patch's isolated memory cost.Native D3D12 debug-layer probe on the same RX 7800 XT, with standalone 4x R24G8_TYPELESS resources (one and three array slices). The corrected TEXTURE2DMS and TEXTURE2DMSARRAY descriptors created D24S8 views without debug messages or removal. The original TEXTURE2D and TEXTURE2DARRAY descriptors each triggered CREATEDEPTHSTENCILVIEW_INVALIDDESC (46), followed by DXGI_ERROR_INVALID_CALL (0x887a0001). This isolates the descriptor failure from title startup.
With the D3D12 debug layer enabled inside XCL, both title builds hit an earlier access violation in D3D12Core before reaching this check. The 60-second runs below have the debug layer disabled.
Current-main follow-up on Radeon RX 7800 XT: at
b9b6ea6, a clean profile and a matched 4x MSAA profile each lost the device before presenting. Merging only this PR into that main (615da26) let both profiles reach the menu, with 575 and 597 frames in 12 s and no device removal. The matched 1x profile also reached the menu onb9b6ea6(602 frames). These comparison runs used release builds with the D3D12 debug layer disabled.Regression run
Matched 60-second runs on the RX 7800 XT with identical Minecraft Preview profiles, using the title setting gfx_msaa:1 to isolate the regression comparison from the 4x startup crash. Both reached the menu. The last frame samples had 124,513 and 124,514 non-dark pixels out of 129,600.
Separate 4x defect verification with the default setting: main
47efa2elost the D3D12 device (0x887a0001) after 2.7 seconds, with one removal, one crash, and 2,341 MiB peak commit. The exact PR heade6484dbshowed 3,420 frames across the full 60 seconds, with zero removals, zero crashes, and 3,511 MiB peak commit. The two 4x runs provide crash-fix evidence and end at different points in startup.main (1x):
PR (1x):
Not tested
AI use
@futurepro62 on GitHub · 2026-11-24 14:17 UTC · original · edited 2026-11-24 14:30 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
e6484db(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.default_dsv_matches_depth_resource_sample_count_and_array_size.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@KaniaKrzysztof on GitHub · 2026-11-24 19:21 UTC · original
Independent NVIDIA validation — Ada & Turing
Tested the exact PR head
e6484dbd15fa3a7c9792d0ab853ef909c3065dffon two physical NVIDIA GPUs.Test title: Minecraft Preview 1.18.3064.0
Both GPUs successfully rendered the main menu and completed a 60-second smoke test with stable presentation at 60 presents/s in the final samples, zero crashes, zero device removals, and zero shader compilation or pipeline failures.
MSAA depth-view validation
Both traces recorded a 1920×1080 four-sample
R24G8_TYPELESSdepth resource and four-sampleD24_UNORM_S8_UINTgraphics pipelines with depth testing enabled.The original multisampled depth-view creation error (D3D12 message ID 46), observed during earlier pre-fix testing, was absent from both PR-head logs.
The RTX 4090 retained six resource-state validation errors (message IDs 527 and 538). Comparison against retained pre-fix logs confirmed identical diagnostic messages, counts, and ordering. These errors predate this PR.
No evidence of a regression introduced by this PR was found in the tested paths.
RTX 4090 — full smoke report and environment
Hardware and runtime
Shader and pipeline statistics
Frame verification
All six full-resolution 1920×1080 BMP captures were inspected directly using pixel analysis. All contained non-dark rendered output.
Captured frames: 20, 620, 1220, 1820, 2420 and 3020.
Main-menu rendering was also verified visually.
RTX 2070 — full smoke report and environment
Hardware and runtime
Shader and pipeline statistics
Frame verification
All six full-resolution 1920×1080 BMP captures contained non-dark rendered output.
The final captured frame (3020) contained 1,992,631 pixels with an RGB sum above 30, out of 2,073,600 pixels (approximately 96.1%).
Main-menu rendering was verified visually.
No matching D3D12 validation callback diagnostics were found in the retained XCL log or stderr.
D3D12 debug-layer diagnostics and pre-fix comparison
The RTX 4090 retained the following diagnostics:
Message ID 527
A resource barrier declared subresource 0's before-state as
COMMON/PRESENT(0x0), while debug tracking recordedRENDER_TARGET(0x4).Message ID 538
ClearRenderTargetViewrequired theRENDER_TARGETstate, while the affected subresource was tracked asCOMMON/PRESENT.All six errors match the retained pre-fix diagnostics in message content, count, and ordering after normalizing timestamps, thread IDs, and process-local addresses.
The PR-head frame trace maps the affected resources to 1920×1080 single-sample
R8G8B8A8_UNORMcolor buffers presented by the title, rather than the multisampled depth resources addressed by this PR.Message ID 1477
The graphics PSO declares
D24_UNORM_S8_UINTwhile depth and stencil testing are disabled and the pixel shader has noSV_Depthoutput.Code inspection confirms that the relevant PSO descriptor path is unchanged by this PR. The reason this warning appeared only in the retained PR-head log remains inconclusive.
These diagnostics did not prevent successful completion of either smoke test.
The original MSAA depth-view creation error (message ID 46) was present in the pre-fix log and absent from the PR-head logs.
Additional finding — DXC and Agility SDK compatibility on Windows 10
The RTX 2070 initially completed a 60-second smoke test without crashing but presented entirely black frames.
The initial environment used:
The run recorded 12 fresh DXIL compilations, all rejected by XCL's container validation, and zero successfully translated graphics pipelines.
A separate CPU-only synthetic comparison reproduced the DXIL container rejection independently of Minecraft and GPU execution.
vs_6_6, position onlyvs_6_6, position and TEXCOORD0ps_6_6, constant colorThe first failing predicate was
off & 3 != 0. DXC 1.6 emitted unalignedPSV0chunk offsets in two synthetic shaders, although the corresponding Microsoft validator accepted all six generated blobs.The original failing Minecraft DXIL blobs were unavailable, so their exact failing offsets were not established.
Using matching application-local runtime dependencies resolved the black-screen issue:
dxcompiler.dll: 1.9.2602.17dxil.dll: 1.9.2602.17D3D12Core.dll: 1.620.1.0 in the separate runtime probesSeparate probes confirmed Shader Model 6.9 and successful creation of a synthetic SM 6.6 graphics PSO (
S_OK) on both GPUs.The subsequent cold-cache Minecraft smoke on the RTX 2070 successfully compiled all required shaders, built translated graphics pipelines, and rendered nonblack frames.
No XCL source modifications, operating system upgrades, or system DLL replacements were required to resolve the issue.
The DXIL validation finding appears independent of this PR and may warrant separate investigation.
AI disclosure: OpenAI Codex assisted with test preparation, diagnostic analysis, executable integrity verification, synthetic probes, frame pixel analysis, and report preparation. Both retail smoke tests were launched manually, and visual results were checked by the tester.
The results support the effectiveness of the MSAA depth-view fix on both NVIDIA Ada and Turing hardware, including Windows 10 with the appropriate application-local runtime dependencies.
Thanks for the fix!
@DavidM1911 on GitHub · 2026-11-25 08:36 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main(README.md) — needs a rebase before it can be tested.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.