Mesh primitive exports: corner indices are nine bits, the edge flags dropped (upstream c0228d9)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 23:24:23 -06:00
1 parent 0d70c26014
commit 25f78a079c
3 files changed
+188 -7

No files matched your search

+6 -3
View File
@@ -11354,8 +11354,11 @@ impl<'a> Lower<'a> {
Ok(())
}
/// Mesh: `exp prim` as the lane's primitive. Bit 31 culls it (all
/// indices 0: no area).
/// Mesh: `exp prim` as the lane's primitive. Each corner takes ten
/// bits: a 9-bit vertex index and, above it, its edge flag (bits 9, 19
/// and 29), which only the console's edge-flag rasterisation reads and
/// which is no part of the index. Bit 31 culls it (all indices 0: no
/// area).
fn emit_indices(&mut self, e: &Export, guard: Option<V>) -> Result<(), Why> {
let v = e.values[0].ok_or("a primitive export without its indices")?;
let x = self.i32_of(v)?;
@@ -11388,7 +11391,7 @@ impl<'a> Lower<'a> {
});
let mut indices = [z; 3];
for (k, slot) in indices.iter_mut().enumerate() {
let (shift, mask) = (self.s.m.i32(10 * k as u32), self.s.m.i32(0x3FF));
let (shift, mask) = (self.s.m.i32(10 * k as u32), self.s.m.i32(0x1FF));
let i = self.s.m.bin(c, Bin::LShr, x, shift);
let i = self.s.m.bin(c, Bin::And, i, mask);
if let Some(n) = written {