Repository navigation
A task shader's payload past Metal's 16 KB goes through a device buffer: Switch Sports Resort's six refused task / mesh shaders build - #2264
Open
FifteenPen wants to merge 1 commit into
Conversation
…er and its mesh shader reads its input from there: Nintendo Switch Sports Resort's six refused task / mesh shaders build (issue seedds#1753)
FifteenPen
added a commit
to FifteenPen/nxnative
that referenced
this pull request
Nov 10, 2026
… it), seedds#1921 on main as 30c9b16, seedds#1561 explained (aborts after the safety screen without it), its six refused shaders built by seedds#2264
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Fixes #1753: Nintendo Switch Sports Resort (
04008E001F098000, v65536) builds 11,053 of its 11,059 shaders. The other six are refused withmesh stage failed: shared memory of its own, or stage memory past Metal's limit:4d57f62a663c4cc9,3c8eaa19f720a02f,07abb052a670b8ba,8c49b3da7fd802df;d60092d7424cb5b4anda68f2301bbaceb8c.Cause. Metal allows an object function's payload up to 16 KB and a function's threadgroup memory up to 32 KB. These task shaders hand their mesh shaders 21–28 KB:
Fix. A payload past
DMSH_MESH_PAYLOAD_MAX(16 KB) goes through a device buffer:nvn_geometry.incmtk_encode): binds the buffer atDMSH_MESH_SPILL_SLOT(11) of the object and mesh tables. Word 0 holds the number of slices, followed by one slice of the payload's words per task workgroup. Metal's payload is then 16 bytes.dmsh_meshstage.to_stage): stores its payload in its workgroup's slice and passes the slice's number in Metal's payload. A workgroup past the host's slices launches no mesh workgroups.InstEmitAmpereMem.csAIsberd,ResourceManager.GetStageInputMemoryId), and the wrapper backs it with the slice. The input is therefore no longer part of the mesh shader's stage memory.dmsh_meshstage.memory).MTK_SPILL_MAX); past that the remaining workgroups launch no mesh workgroups, with a[RED]line. An indirect draw always gets 1,024, since its count is written on the GPU. The host logs the first draw that uses the buffer.Payloads up to 16 KB take the old path unchanged: the same Metal payload and stage memory layout. The task shaders' smaller stage memory (no input area) applies to every task shader.
Chain change:
eb9a3f4c3394(the translator,dmsh_meshstage.py).Checked
test_dmsh_meshstage.py(new tests):test_dmsh_ampere_mem.pyandtest_dmsh_ampere_alu.pypass with the rebuilt translator.t_geometry: 1,929 checks;t_geometry_feedback: 110;t_geometry_hazards: 61;t_geometry_mesh: 23;t_mesh_first_use: 53;test_docs.pyand the symptom index pass.lint_c.py tidy: no new findings. The three above the baseline are int_pso_archive.m, which this PR doesn't touch.Not checked
The game's profile is in #2107.