Mesh outputs: a primitive's cull starts false (changes translation output) #55
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!55
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/55/head"
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?
@Sr-0w on GitHub · 2026-11-26 05:04 UTC · original
Sr-0w:shaders/mesh-cull-written-once→main· +18 −9 · 3 files · 1 commits · merged 2026-11-26 06:49 UTCFixes #54.
What
A direct-export mesh program initialises every primitive of its count right after
SetMeshOutputCounts(MeshDeclarations.InitialPrimitives). The initialSV_CullPrimitivevalue is nowfalseinstead oftrue. A primitive is still initialised as the degenerate triangle(0, 0, 0), which covers no pixel, so a primitive the program never exports still draws nothing. Every primitive also stays initialised, which keeps the VIctory #587 guard against NVIDIA's hang. The cut epilogue, which writestruelater, is unchanged.Why
AMD's driver (RX 7800 XT, 64-lane mesh waves) keeps a primitive culled once its
SV_CullPrimitivehas been writtentrue. A laterfalseis lost, while a latertrueis kept. Every translated mesh program wrotetruefirst and the real value at its export, so on this GPU no mesh primitive ever reached the rasterizer.It reproduces without the game, with the existing cases run on the GPU (
FIVESTAR_TEST_ADAPTER=hardware):MeshShaderTests+MeshRoundBoundTestson the RX 7800 XTmsfb_*)The rule was narrowed by editing the translated
ms_ngg_strips. Primitive counts at the clipper, versus WARP's 15:cull = truebefore the exportcull = falsecull = trueinitialised, indices notA hand-written mesh shader with no rewrite draws on the same GPU, and its counters are right (clipper 1, PS 256).
In game (a retail game, RX 7800 XT, world frame, main
6c87fd14+ #52 + #53)The presented image of the traced runs above is black before and after the fix, but that comes from the draw trace (
--d3d12-trace-drawswith target dumps): an untraced run with the fix shows the night city on the horizon, with the terrain now drawn as a dark foreground in front of it (its albedo is still black, as in Status.md), at about 9 fps on the in-game counter.Tests
MeshRoundBoundTestsnow checks that the initial write istris = (0,0,0)withcull = false, and that nocull = trueappears before the export.docs/shader-translation.mdis updated.🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-26 07:30 UTC · original
this is a great find, and the repro table without the game makes it really convincing
the degenerate (0,0,0) init still covers the NVIDIA hang guard, so I'm happy with it. it went in with the translator batch, booting it here now to check nothing regresses on our side
thanks for chasing this down