Repository navigation
Recompiler: handle MSG_GS_DONE emit and cut ops in geometry shaders (#2412) - #2494
ChalanaGimhanaX wants to merge 1 commit into
Conversation
…cl-dev#2412) RDNA2 geometry shaders can fold the final emit and/or cut into s_sendmsg MSG_GS_DONE (msg == 3, op in 1..=3), which was previously ignored by both the Direct DXIL lowering (lower_geom.rs) and the HLSL geometry backend (emit.rs). Update both backends to execute emit/cut for msg 2 or 3 when op != 0 on stream 0, keeping op == 0 as a no-op. Verified with new CPU codegen/validation and GPU mesh_draw tests (plus existing geometry_tests and gpu_geometry_mode_es_gs_strip suites), confirming 0x33 produces 4 vertices and 2 strip triangles per primitive instead of 3 vertices and 1 triangle.
|
AMD native wave64 run (listed as untested), plus an RTX 3060: the new GPU test passes on both, with the direct translator on. Head
For reference: #2485 covers the same Not tested: retail geometry shaders, Intel, Linux / Wine. |
Tested
Not tested
AI use
|
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
|
Handle
s_sendmsgMSG_GS_DONE(msg == 3) emit and cut operations (op1..=3 on stream 0) in geometry shaders instead of silently dropping them, in both Direct DXIL (lower_geom.rs) and HLSL (emit.rs) backends. RDNA2 compilers fold the final vertex emit/cut intoMSG_GS_DONE; keepingop == 0as a no-op preserves plain termination messages.Fixes #2412. Part of #1833.
What is in it
crates/xcl/src/gpu/dxil/lower_geom.rs: processs_sendmsgonmsg == 2 | 3whenop != 0 && stream == 0.crates/xcl/src/gpu/recomp/emit.rs: apply the sameMSG_GS/MSG_GS_DONE(op1..=3) handling in the HLSL geometry backend.crates/xcl/src/gpu/dxil/geometry_tests.rs: added CPU codegen/DXIL-validation tests (0x33,0x23,0x03) and a GPUmesh_drawtest verifying both backends emit all 4 vertices and 2 strip triangles per primitive (before the fix, the test fails with 3 vertices / 1 triangle).Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release build.cargo test -p xcl --lib gpu::dxil::geometry_tests -- --test-threads=1(pre-rebase debug): 5 passed, 0 failed;cargo test -p xcl --lib gpu_geometry_mode_es_gs_strip -- --test-threads=1: 2 passed, 0 failed.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(3da50b0): 1425 passed, 0 failed, 46 ignored.SKIPPEDGPU/adapter tests (26): 21 no wave64, 3 refused f16 forms (#1426), 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required for driver cache disable).cargo test --release -p xcl --test e2e -- --test-threads=1(3da50b0): 4 passed, 0 failed.Regression run
main (
6d051da):this PR (
3da50b0):Not tested
split = falseGPU execution path), AMD / Intel GPUs, Linux / Wine, and retail gameplay beyond the 60-second menu smoke run.AI use
MSG_GS_DONEemit/cut fix across both backends and tests, ran the test suite and regression smoke runs, and drafted this description.