Skip to content

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

Backlog

Description

@ahmetbagci8

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.

Activity

  1. added 2 commits that reference this issue on Nov 25, 2026
    c256c7e
    45e7018
  2. oni-swr commented on Nov 26, 2026

    @oni-swr
    Contributor

    Claiming independent Native Windows RX 7800 XT verification for PR #2485 at 45e7018, 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions