dxil: emit InnerCoverage, ShadingRate, MeshDerivatives, and 64UAVs flags in graphics shaders #2451
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!2451
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2451"
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?
@Decodere on GitHub · 2026-11-25 19:24 UTC · original
Decodere:fix-dxil-graphics-flags→main· +145 −2 · 2 files · 1 commits · openEmit four DXIL shader-flag and
SFI0feature bits inShader::try_finish_graphicsthatdxil.dllrequires when the corresponding graphics features are used:InnerCoverage,ShadingRate,DerivativesInMeshAndAmpShaders, and64UAVs. Part of #1401. Part of #1833.What is in it
crates/xcl/src/gpu/dxil/graphics.rs(Shader::try_finish_graphics):self.bindingswithResClass::Uav) and emit64UAVs(flags |= 1 << 15,sfi0 |= 0x8) across vertex, pixel, and mesh shaders whenever more than 8 static UAVs are bound (while preservingUavsAtEveryStage1 << 16/0x4for vertex shaders with any static UAV).ShadingRate(flags |= 1 << 24,sfi0 |= 0x8_0000) whenStage::Vertexoutputs orStage::Pixelinputs containSemKind::ShadingRate(excludingStage::Meshprimitive outputs, matching DXC).optimize()instructions onStage::PixelandStage::Meshto emitInnerCoverage(flags |= 1 << 10,sfi0 |= 0x400) whendx.op.innerCoverage.(op 92) survives, andDerivativesInMeshAndAmpShaders(flags |= 1 << 29,sfi0 |= 0x100_0000) when mesh derivative or implicit-LOD ops (dx.op.unary.ops83..=86,dx.op.sample.op60,dx.op.sampleBias.op61,dx.op.sampleCmp.op64,dx.op.calculateLOD.op81) survive; eliminated calls in unreachable blocks and dead-code-eliminated derivatives do not emit spurious flags.crates/xcl/src/gpu/dxil/graphics_tests.rs:ps_inner_coverage_sets_flag_only_when_live,shading_rate_sets_flag_for_vs_and_ps_but_not_ms,ms_derivatives_and_implicit_lod_set_flag_but_explicit_lod_does_not,graphics_64_uavs_flag_tracks_static_uav_count) assertingvalidate::validate, exactSFI0values, disassembly metadata flags, and negative guards (unreachable inner coverage, mesh primitive shading rate, explicitsample_leveland DCE'd mesh derivative, 8 static UAVs, and a single UAV at registeru8).Tested
dxil.dll1.9.2609.5, release build.graphics.rsfix (onorigin/main943043e): all 4 new tests failed (0 passed, 4 failedon missingSFI0bits).cargo test --release -p xcl --lib -- gpu::dxil::graphics::tests:: --nocapture:29 passed, 0 failed, 0 ignored(0.28 s,0skipped).XCL_ADAPTER=warp:29 passed, 0 failed, 0 ignored(0.03 s;0skipped on the 4 new tests,2pre-existing draw tests skipped:no wave64).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(RTX 4060):1367 passed, 0 failed, 46 ignoredacross24test binaries (184/184gpu::dxil::*passed;29pre-existingSKIPPEDGPU/environment checks:21no wave64,3per-lane wave32 refused,3no D3D12 debug layer,1no heap windows,1cannot disable driver cache;0skipped ingpu::dxil::graphics::tests).Regression run
main:
PR:
Not tested
d3d12SDKLayers.dll.AI use
graphics.rs, wrote the DXC-validated tests ingraphics_tests.rs, ran the test/smoke suites, and drafted this PR description.@emirduran707 on GitHub · 2026-11-25 19:41 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
2e6e6ab8d6d8e453947020d777ca335630d85940(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: 1365 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). Allgpu::dxil::graphics_testsand native wave64 GPU tests ran and passed.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
@SlopTart on GitHub · 2026-11-25 20:02 UTC · original
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. The four are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, depth-buffer state refusal, andgpu_promoted_uav_clear_values_pass_create_committed_resource(report); none caused by this PR.@DavidM1911 on GitHub · 2026-11-25 20:21 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!
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.