shader: mask primitive edge flags in staged mesh exports #3766

Manually merged
github merged 3 commits from github-bot/gh-3764 into gh-pr/3764/base 2026-12-02 01:54:31 +00:00 AGit
Owner

@⁠R0Y00 on GitHub · 2026-12-01 17:03 UTC · original
R0Y00:codex/mesh86-primitive-edge-flags → main · +7 −2 · 2 files · 3 commits · merged 2026-12-02 01:49 UTC

Refs #3765 and #3643.

Mesh primitive exports pack each 9-bit index alongside a separate edge flag. Mask the index consistently in both emission paths. Exercise the staged path with all three edge flags set while retaining the allocation and emission ordering checks.

Local validation: the related Mesh86 CTest selection passed 24/24 on the combined local tree. This PR carries only the primitive-index change and its regression case. The isolated PR head still needs CI. Geometry production and visible output are tracked separately.

Additional local reproduction on the combined Release build, with the same regression-test blob as this PR head:

ctest --test-dir out/build/mesh86-main-retest --no-tests=error -j 1 -R '^(native_direct_mesh|startup_mesh86_)'

16 passed, 0 failed, 0 skipped. Windows 11 x64, RTX 4060 Laptop GPU, NVIDIA driver 616.56, including WARP and hardware tests. Isolated PR-head CI is pending.

**@⁠R0Y00** on GitHub · 2026-12-01 17:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3764) `R0Y00:codex/mesh86-primitive-edge-flags` → `main` · +7 −2 · 2 files · 3 commits · merged 2026-12-02 01:49 UTC Refs #3765 and #3643. Mesh primitive exports pack each 9-bit index alongside a separate edge flag. Mask the index consistently in both emission paths. Exercise the staged path with all three edge flags set while retaining the allocation and emission ordering checks. Local validation: the related Mesh86 CTest selection passed 24/24 on the combined local tree. This PR carries only the primitive-index change and its regression case. The isolated PR head still needs CI. Geometry production and visible output are tracked separately. Additional local reproduction on the combined Release build, with the same regression-test blob as this PR head: ```powershell ctest --test-dir out/build/mesh86-main-retest --no-tests=error -j 1 -R '^(native_direct_mesh|startup_mesh86_)' ``` 16 passed, 0 failed, 0 skipped. Windows 11 x64, RTX 4060 Laptop GPU, NVIDIA driver 616.56, including WARP and hardware tests. Isolated PR-head CI is pending.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 17:05:14 +00:00
Author
Owner

@⁠lukaslw-lab on GitHub · 2026-12-01 20:41 UTC · original · approved these changes

Reviewed 66513d80 by reading the diff; not built or run.

Verdict: approve. The staged path no longer culls flagged triangles.

  • Before: with meshPackedIndices staged, the mask was 1023. Any index with its edge flag set (bits 9/19/29) became >= 512, hit the uge vertex_count check and culled the triangle (gfx1013_direct_mesh.inl:234-243). With 511, both paths read the same 9-bit index. Bit 31 still culls through slt packed, 0.
  • Fixture word 0x20280600 decodes to indices 0, 1 and 2, each with its flag set. mesh-masked-outputs reaches the staged branch (@meshPackedIndices is asserted). Under the old code it emits three and …, 1023, so the new not 1023 assertion fails there: the case is a working control.
  • No MUST, SHOULD or NIT.

Tests: native_direct_mesh (in the pr filter) carries the case, and CI ran it: Windows, gfx1013 and Linux jobs green at this head.

**@⁠lukaslw-lab** on GitHub · 2026-12-01 20:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3764#pullrequestreview-6139786914) · **approved these changes** Reviewed `66513d80` by reading the diff; not built or run. **Verdict: approve.** The staged path no longer culls flagged triangles. - Before: with `meshPackedIndices` staged, the mask was `1023`. Any index with its edge flag set (bits 9/19/29) became `>= 512`, hit the `uge vertex_count` check and culled the triangle (`gfx1013_direct_mesh.inl:234-243`). With `511`, both paths read the same 9-bit index. Bit 31 still culls through `slt packed, 0`. - Fixture word `0x20280600` decodes to indices 0, 1 and 2, each with its flag set. `mesh-masked-outputs` reaches the staged branch (`@meshPackedIndices` is asserted). Under the old code it emits three `and …, 1023`, so the new `not 1023` assertion fails there: the case is a working control. - No MUST, SHOULD or NIT. Tests: `native_direct_mesh` (in the `pr` filter) carries the case, and CI ran it: Windows, gfx1013 and Linux jobs green at this head.
github-bot changed target branch from main to gh-pr/3764/base 2026-12-02 01:54:19 +00:00
github manually merged commit 66513d8023 into gh-pr/3764/base 2026-12-02 01:54:23 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.