Direct DXIL: s_sendmsg MSG_GS_DONE (msg == 3) silently drops emit/cut ops #2412

Open
opened 2026-11-26 05:30:11 +00:00 by github-bot · 1 comment
Owner

@⁠ahmetbagci8 on GitHub · 2026-11-25 18:07 UTC · original

Summary

In crates/xcl/src/gpu/dxil/lower_geom.rs (s_sendmsg, lines 44-52):

"s_sendmsg" => {
    // MSG_GS (2): op 1 cut, 2 emit, 3 emit + cut (stream 0); the rest: nothing
    let simm = rdna2::field_value(d.enc, &d.words, "SIMM16").unwrap_or(0);
    let (msg, op, stream) = (simm & 0xF, (simm >> 4) & 3, (simm >> 8) & 3);
    if msg == 2 && stream == 0 {
        self.gs_emit_cut(op);
    }
    Some(())
}

In RDNA2, s_sendmsg supports both MSG_GS (msg == 2) and MSG_GS_DONE (msg == 3) with the same op (SIMM16[5:4]: 0 = NOP, 1 = CUT, 2 = EMIT, 3 = EMIT_CUT) and stream (SIMM16[9:8]) fields. Compilers routinely fold the final vertex emit/cut into MSG_GS_DONE (msg == 3, op == 2 | 3). Because line 48 only checks msg == 2, any MSG_GS_DONE carrying an emit or cut op is silently ignored, dropping the final emitted vertex and its strip triangle(s).

Suggested fix

if (msg == 2 || msg == 3) && op != 0 && stream == 0 {
    self.gs_emit_cut(op);
}

Not tested

  • Read from commit 082944135cd2b96288470a595861fa608eee08dc without a new runtime test.

AI use

  • Antigravity harness (Gemini 4 Neon) audited lower_geom.rs and drafted this report; the author reviewed it before posting.
**@⁠ahmetbagci8** on GitHub · 2026-11-25 18:07 UTC · [original](https://github.com/xcl-dev/xcl/issues/2412) ### Summary In `crates/xcl/src/gpu/dxil/lower_geom.rs` (`s_sendmsg`, lines 44-52): ```rust "s_sendmsg" => { // MSG_GS (2): op 1 cut, 2 emit, 3 emit + cut (stream 0); the rest: nothing let simm = rdna2::field_value(d.enc, &d.words, "SIMM16").unwrap_or(0); let (msg, op, stream) = (simm & 0xF, (simm >> 4) & 3, (simm >> 8) & 3); if msg == 2 && stream == 0 { self.gs_emit_cut(op); } Some(()) } ``` In RDNA2, `s_sendmsg` supports both `MSG_GS` (`msg == 2`) and `MSG_GS_DONE` (`msg == 3`) with the same `op` (`SIMM16[5:4]`: 0 = NOP, 1 = CUT, 2 = EMIT, 3 = EMIT_CUT) and `stream` (`SIMM16[9:8]`) fields. Compilers routinely fold the final vertex emit/cut into `MSG_GS_DONE` (`msg == 3, op == 2 | 3`). Because line 48 only checks `msg == 2`, any `MSG_GS_DONE` carrying an emit or cut op is silently ignored, dropping the final emitted vertex and its strip triangle(s). ### Suggested fix ```rust if (msg == 2 || msg == 3) && op != 0 && stream == 0 { self.gs_emit_cut(op); } ``` ### Not tested - Read from commit `082944135cd2b96288470a595861fa608eee08dc` without a new runtime test. ### AI use - Antigravity harness (Gemini 4 Neon) audited `lower_geom.rs` and drafted this report; the author reviewed it before posting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:30:11 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 07:59 UTC · original

Claiming independent Native Windows RX 7800 XT verification for PR #2485 at 45e70181, focused on synthetic geometry emit/cut in both Direct DXIL and HLSL with an exact-parent control.
AI use: Codex (gpt-6.2-sol) for coordination and Claude Code (Claude Sonnet 5.5) for planned verification.

**@⁠oni-swr** on GitHub · 2026-11-26 07:59 UTC · [original](https://github.com/xcl-dev/xcl/issues/2412#issuecomment-7186064606) Claiming independent Native Windows RX 7800 XT verification for PR #2485 at 45e70181, focused on synthetic geometry emit/cut in both Direct DXIL and HLSL with an exact-parent control. AI use: Codex (gpt-6.2-sol) for coordination and Claude Code (Claude Sonnet 5.5) for planned verification.
This discussion has been locked. Commenting is limited to contributors.
No description provided.