Repository navigation
The fragment's shading-rate size (system register 0x84) reads 1 x 1: Nintendo Switch Sports Resort's sea is no longer black - #2103
Closed
FifteenPen wants to merge 1 commit into
Closed
FifteenPen wants to merge 1 commit into
FifteenPen wants to merge 1 commit into
Conversation
… 1 x 1 instead of 0: Nintendo Switch Sports Resort's sea, which divides by the fragment's area, is no longer black (chain cdef7a05ad69)
2 tasks done
seedds
added a commit
that referenced
this pull request
Nov 12, 2026
…so Nintendo Switch Sports Resort's sea is no longer black and its avatars' hair and clothes are no longer flat black (PR #2103): S2UR of system register 0x84 (Mesa NAK's NAK_SV_VARIABLE_RATE) is the fragment's size in pixels, X in bits 8..15 and Y in bits 16..23, which variable rate shading makes 2 or 4. The translator did not know the register and gave 0, the default for an unknown one; 612 of the game's 11,059 shaders, all pixel shaders, read it, and the sea shaders (01a6b85e2f6ea3d4, b3203175c76cda20, 2271b2e0293b3c55) divide a blend weight by the fragment's area: an infinite weight, NaN, written as 0 by blend_zero, with black dots of NaN noise spread by the auto-exposure; the avatar material c30f0edd6c669a61 takes it into a shading factor. SReg.VariableRate (132, Decoders/InstDecoders.cs) reads 0x10100 in EmitSReg (Instructions/InstEmitMove.cs), which Maxwell's S2R and Ampere's S2R / S2UR (InstEmitAmpereAlu.AS2r) both go through: the host shades every pixel. Chosen over bymaxmarc's PR #2373 (the same value in AS2r only, with the avatars' material found); FifteenPen found the black sea first. The translator was rebuilt with Microsoft's .NET SDK 10.0.404 (native_tools.sh; Homebrew's links its own OpenSSL and is refused), dmsh_chain.lock updated: chain change, DMSH_CHAIN 3856a9225d68, every game's shaders are translated again once. New reference entry (The fragment's shading-rate size reads 1 x 1), symptom index regenerated. Checked: test_dmsh_ampere_mem with DMSH_TEST_XLATE, 86 tests (ShadingRate: float(65792) for colour 0). Co-authored-by: FifteenPen <354289956+FifteenPen@users.noreply.github.com>
Owner
This was referenced Nov 12, 2026
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
Nintendo Switch Sports Resort's sea (title screen, menus) drew black: its normals were right, its colour 0.
Cause. 612 of the game's 11,059 shaders, all pixel shaders, read system register 0x84 with S2UR: the fragment's size in pixels (X in bits 8..15, Y in 16..23; Mesa NAK's
NAK_SV_VARIABLE_RATE), which variable rate shading makes 2 or 4. The translator did not know the register and gave 0. The sea shaders divide a blend weight by the fragment's area, so the colour came out NaN, whichblend_zero(dm_az) writes as 0.Change.
SReg.VariableRate(132) reads0x10100inEmitSReg: the host shades every pixel, so 1 x 1. Chain change (cdef7a05ad69): translator binaries rebuilt,dmsh_chain.lockanddmsh_chain.hupdated.Reference entry: The fragment's shading-rate size reads 1 x 1.
Checked
DMSH_TEST_XLATE=… python3 dm/gfx/tests/test_dmsh_ampere_mem.py: the newShadingRatetest passes (float(65792)); main's translator givesfloat(0). The file's threePokopiatests fail with main's committed translator as well, before this change.python3 -m unittest dm/tools/tests/test_docs.py,python3 dm/tools/docs_symptoms.py.04008E001F098000, v65536), a Mac app from a provisional profile. The tree was main 04811a6 with other PRs (the game needs NVN: account for four-byte direct indexed draws using control memory #1609, SDK 21 virtual output device properties and event-only stream open (Wonder Edition movie) #1561 and the file system and hid PRs opened beside this one to boot), with this translator change: all 11,059 shaders build, and the sea on the title screen and in the menus draws blue instead of black.regress.py impact: none of the profiles with usage manifests is affected;regress.py checkwas not run.Docs
docs/reference/<subsystem>.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)dmsh_chain.py --headerwas run anddm/gfx/nvn/dmsh_chain.his part of the change