dxil: emit MSAA textureLoad before getDimensions to avoid amdxc64 crash #1900
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!1900
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1900/head"
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?
@raylitebull on GitHub · 2026-11-24 22:48 UTC · original
raylitebull:fix/amd-msaa-and-driver-crashes→main· +56 −2 · 2 files · 1 commits · merged 2026-11-24 23:08 UTCFixes the
amdxc64.dllnull-pointer dereference (0xc0000005at+0x85f80fonamdxc64.dll 32.0.32015.2008) duringCreateComputePipelineStateon dynamically indexed descriptor-heapTexture2DMS/Texture2DMSArrayshaders introduced in #1679 (gpu_direct_msaa_image_loads).Follow-up to #1679.
What is in it
CreateComputePipelineStatewhendx.op.getDimensionsprecedesdx.op.textureLoadon a dynamically indexed descriptor-heapTexture2DMS/Texture2DMSArrayinside the same basic block (reproduced even on DXC 1.8 HLSL, withnonUniformIndex=false,WaveSize(32), or separatecreateHandleFromHeap/annotateHandlecalls; does not crash whentextureLoadprecedesgetDimensionsin the same block, when they are in different blocks, or when the heap index is constant).crates/xcl/src/gpu/dxil/lower_image.rs(mimg_msaa): emit alltexture_load_samplecalls beforeget_dimensions(tex.handle, None)inside each guarded format branch (+6/-2, zero extra blocks or branches).crates/xcl/src/gpu/dxil/msaa_tests.rs: add CPU DXIL disassembly regression testdirect_msaa_loads_precede_get_dimensionsverifyingdx.op.textureLoadprecedesdx.op.getDimensionsin every generated MSAA load basic block.Tested
amdxc64.dll 32.0.32015.2008), Windows 11 x64 (10.0.22631.0),rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased onto689f2db.cargo test -p xcl --lib gpu::dxil::msaa_tests -- --ignored --include-ignored(live RX 9070 XT GPU + CPU): 5 passed, 0 failed (0.15 s), includinggpu_direct_msaa_image_loads(previously0xc0000005),msaa_texture_ops_run, anddirect_msaa_loads_precede_get_dimensions.cargo check --workspace --tests: passed.Regression run
main:
PR:
Not tested
scripts/smoke.ps1withXCL_DIRECT_DXIL=1enabled, fullcargo test --workspacerun on425b869, NVIDIA and Intel GPUs, wave32-only adapters, and Linux/Wine/vkd3d-proton.AI use
@eizispark on GitHub · 2026-11-24 22:56 UTC · original
Hardware test report — commit
425b869Verified
425b86920b43d26a670cc0090787fc946976bce3(rebased ontomain689f2db477c3c062cf162649781640ef8a977c18, clean merge): pass — confirms the#16790xc0000005(amdxc64.dll) crash ingpu_direct_msaa_image_loadsis resolved on RX 9070 XT.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4(no--skipneeded):974 passed, 2 failed, 45 ignored(8 skipped), running to completion without crashingxcl --lib:5/5gpu::dxil::msaa_testspassed on RX 9070 XT (gpu_direct_msaa_image_loads,msaa_texture_ops_run,render_target_sample_ops_validate,direct_msaa_store_is_rejected,direct_msaa_loads_precede_get_dimensions)main689f2dbfuzz tests failed (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3);0new failures8 skipped: 6gpu::recomp::lower_dxil::testsf16/f32 direct-DXIL per-lane cases refused where#1426semantics differ from the console's;shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required,0x887A002D);heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) passedRegression run (
scripts/smoke.ps1, 60 s, warm shader/driver cache)main(689f2db477c3c062cf162649781640ef8a977c18):PR (
425b86920b43d26a670cc0090787fc946976bce3):Not tested
AI use
@upipibi on GitHub · 2026-11-24 23:04 UTC · original
NVIDIA counterpart to the RX 9070 XT run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
425b869onmain689f2db. The reordering doesn't change the result on NVIDIA. Tests matchingmsaa, includingdirect_msaa_loads_precede_get_dimensionsandgpu_direct_msaa_image_loads: 6 passed, 0 failed, with and withoutXCL_DIRECT_DXIL=1.AI-assisted (Claude Code). Synthetic tests only.
@DavidM1911 on GitHub · 2026-11-25 02:07 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!