D3D12.X: fix null UAV fallback and MSAA/typeless companion SRVs #2511
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!2511
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2511"
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?
@ChalanaGimhanaX on GitHub · 2026-11-25 21:10 UTC · original
ChalanaGimhanaX:d3d12x/uav-null-desc-and-companion-srv→main· +307 −10 · 1 files · 1 commits · openFix invalid null UAV fallback dimensions in
dev_create_uav_checked_xand invalid MSAA /*_TYPELESScompanion SRV descriptors inuav_companion_srv, preventingDXGI_ERROR_INVALID_CALL(0x887A0001) device removals when console titles create image UAVs on unsupported formats, MSAA textures, or non-depth typeless textures.Part of #2461 and #1833.
What is in it
crates/xcl/src/hle/d3d12x/real.rs:dev_create_uav_checked_x: reusenull_uav_desc(desc.as_ref(), Some(&rd))instead ofD3D12_UNORDERED_ACCESS_VIEW_DESC { ..Default::default() }whenpc_typed_uav_supportedreturns false, avoiding zeroArraySize/WSizeonTexture1DArray,Texture2DArray, andTexture3Dnull UAV fallbacks.null_uav_desc: ignoreViewDimension == UNKNOWN (0)so it falls back tord, and map MSAA 2DArray (7) toTexture2DArraywithArraySize = 1.uav_companion_srv+concrete_srv_format: accept MSAA dimensions (6/7) fromresource_dim_to_viewwhendesc == None, emitD3D12_SRV_DIMENSION_TEXTURE2DMS/D3D12_SRV_DIMENSION_TEXTURE2DMSARRAYwhenrd.SampleDesc.Count > 1(preventingCREATESHADERRESOURCEVIEW_INVALIDDESCandID3D12Device::RemoveDevice), and normalize any remaining*_TYPELESSor depth-only format to a concrete same-family SRV format (preventingCREATESHADERRESOURCEVIEW_INVALIDFORMAT).uav_companion_srv_tests: added unit testuav_companion_srv_msaa_typeless_and_null_uav_dimensionsand D3D12 debug-layer testgpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layer.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11, release build.uav_companion_srv_msaa_typeless_and_null_uav_dimensionsfailed (MSAA 2D default companion SRVreturnedNone).gpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layerfailed underD3D12SDKLayers.dllwithID3D12Device::CreateShaderResourceView: The base resource was created as a multisample resource. You must specify D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY or D3D12_SRV_DIMENSION_TEXTURE2DMS.followed byID3D12Device::RemoveDevice(DXGI_ERROR_INVALID_CALL).ba93ea4):cargo test --release -p xcl --lib hle::d3d12x::real::uav_companion_srv_tests:: -- --test-threads=1 --nocaptureon RTX 3060: 4 passed, 0 failed, 0 skipped (0 D3D12 debug-layer errors).XCL_ADAPTER=warp): 4 passed, 0 failed, 0 skipped (0 D3D12 debug-layer errors).cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1425 passed, 0 failed, 46 ignored across 37 test binaries.SKIPPEDlines (26): 21no wave64(RTX 3060 is 32-lane), 3 per-lane refused f16/f32 forms (#1426), 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required), 1heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).cargo test --release -p xcl --test e2e -- --test-threads=1: 4 passed, 0 failed.Regression run
main (
6d051da):this PR (
ba93ea4):Not tested
AI use
real.rsnull UAV fallback and MSAA/typeless companion SRV fixes and tests, ran the failing-first check, targeted GPU/WARP tests, full workspace test suite, e2e tests, and smoke run, and drafted this PR description.@SlopTart on GitHub · 2026-11-25 21:21 UTC · original
gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of the new companion-SRV tests (
uav_companion_srv_msaa_typeless_and_null_uav_dimensionsand helpers): 4 passed. Thegpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layere2e entry ran to completion (ok) inside the suite run, no SKIPPED lines in this log, andgpu_uav_companion_srv_and_null_image_viewsis ok as well.@DavidM1911 on GitHub · 2026-11-25 21:24 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@emirduran707 on GitHub · 2026-11-25 21:29 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
ba93ea4418e3b8440fc563ad3b270e4f328cd166(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1423 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::real::uav_companion_srv_tests::uav_companion_srv_msaa_typeless_and_null_uav_dimensionsandgpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layer.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@DarkPanda69 on GitHub · 2026-11-25 22:32 UTC · original
On a machine without the D3D12 debug layer,
gpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layershows as passed with noSKIPPEDline in a normal test run, so it is easy to count it as coverage when it tested nothing.Head
ba93ea4applied onmain6d12f58, RX 9070 XT, Windows 11 Pro 26200, nod3d12SDKLayers.dllinstalled:cargo test -p xcl --lib -- gpu_uav_null_fallback_and_msaa_typeless_companion_srv_debug_layer --nocaptureprintsSKIPPED ...: no D3D12 debug layer (...)and then... ok.--nocapture(and the whole-suite runs CONTRIBUTING.md asks for) prints only... ok, with noSKIPPEDline.The cause is the forwarding loop in the parent test:
libtest captures
eprintln!output of a passing test, so the child'sSKIPPEDline is dropped.runner::skip_testwrites withwriteln!(std::io::stderr(), ...), which is not captured, and that is why other skips do show up. Writing the forwarded line the same way would keep it visible:I have not built or run that change.
AI use: Claude Code (Claude Opus 5.5) found this while testing the PR on this machine and wrote this comment.
@luckyteagirl on GitHub · 2026-11-26 07:19 UTC · original · reviewed
Could the companion SRV and the console T# use the same normalized descriptor? For a 4x MSAA texture with an explicit TEXTURE2D UAV descriptor, the new code publishes a TEXTURE2DMS SRV, but
dev_create_uav_xstill builds the T# from the original UAV dimension and labels it non-MSAA. With a default UAV descriptor, the T# gets the MSAA type but hardcodes one mip, which encodes LAST_LEVEL=0 instead of 2 for four samples.The existing
srv_tsharp_from_deschelper can build the metadata from the normalized native SRV and the actual sample count. A focused fixture could check the published SRV dimension and decoded T# type and sample count for both descriptor forms. Exact-head source review ofba93ea4418e3b8440fc563ad3b270e4f328cd166. No GPU run. AI-assisted review with Codex.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.