xshader: count components, not elements, in a mesh's output budget #612
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/612"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T08:02:31Z.
A translated mesh program declares as many vertices as its outputs fit in the 32 KiB a mesh shader may write, and drops a group with more. The budget charged 16 bytes for each signature element, but DXC charges four bytes for each component, for vertices and primitives rounded up to a multiple of 32. A program with many narrow outputs was capped below what DXC accepts, so a meshlet with more vertices was dropped whole, silently: holes in the surface, the same in every target.
Refs #533.
What it fixes
In a title we traced, characters' surfaces had polygonal holes, identical in albedo, normals and material targets, at the same places in every run and camera; the position-only pass of the same mesh, which has no such cap (128), was complete in depth. Its G-buffer programs declare 96, 101 or 119 vertices. In one run of an integration build with this change (and other open PRs), the main character's face, which had these holes, was complete; I don't claim it for this change alone.
Measured
wide-128in the translated-mesh check (128 vertices, position and eighteen float3): on an RTX 5090 the old translator draws 0 of 64 words and the check fails; with this it passes (2,560 words). On the AMD iGPU (1002:13c0, RADV) it passes; the old translator wasn't run there.widest-128(position and twenty float3 = 64 components, exactly 32,768 bytes with no primitive outputs), at the limit itself: it passes on both cards (translated-mesh: 42 mesh draws, 2,688 words).python tuxbox.py checkofcc3604fb(GE-Proton11-15): RTX 5090 (10de:2b85, 620.70.10) 208 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 207 pass, 0 fail.Evidence: TuxBox check of
cc3604fb7a, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not runEvidence: TuxBox check of
cc3604fb7a, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not runNot covered
🤖 Generated with Claude Code