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

Closed
opened 2026-11-25 18:07:27 +00:00 by ahmetbagci8 · 1 comment
ahmetbagci8 commented 2026-11-25 18:07:27 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by ahmetbagci8 on 2026-11-25T18:07:27Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:6610687646 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2412). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-11-25T18:07:27Z. --- ### 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.
oni-swr commented 2026-11-26 08:04:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T07:59:47Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7186064606 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2412#issuecomment-7186064606). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-26T07:59:47Z. --- 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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2402
No description provided.