Repository navigation
The back face's stencil reference value reaches Metal: Mario Golf: Super Rush's ground decals draw - #2351
Closed
secretlemur28 wants to merge 1 commit into
Closed
The back face's stencil reference value reaches Metal: Mario Golf: Super Rush's ground decals draw#2351secretlemur28 wants to merge 1 commit into
secretlemur28 wants to merge 1 commit into
Conversation
…e served both faces, so a draw of back faces that compares against its own value passed nowhere (Mario Golf: Super Rush's ground decals: the driving range's scoring target was missing) SetStencilRef takes a face and the replay keeps both values, but enc_r_stencil_ref sent the front one for both (setStencilReferenceValue:). The game's decals are volumes drawn twice: front faces mark stencil bit 0x80 where the volume lies behind the ground, then back faces draw the colour where stencil & 0x90 equals the back value 0x10, the ground's mark, with a front value of 0. Both values now go to Metal (setStencilFrontReferenceValue:backReferenceValue: when they differ), the per-encoder cache compares both, and the deferred recorder's RO_R_SREF carries both. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
seedds
added a commit
that referenced
this pull request
Nov 12, 2026
SetStencilRef takes a face and the replay kept both values, but enc_r_stencil_ref sent Metal the front one for both faces, while the depth-stencil state already gave each face its own compare function, operations and masks. A back face therefore tested the front value. Mario Golf: Super Rush's ground decals draw their volumes' back faces where stencil & 0x90 equals the back value 0x10 with a front value of 0, so the driving range's target was never drawn. Both values now go to Metal (setStencilFrontReferenceValue: backReferenceValue:), the per-encoder state cache compares both, and the deferred recorder's RO_R_SREF carries both, as the Vulkan layer already did. Reference entry: "Front and back stencil reference values" in docs/reference/rendering.md. Checked: regress.py check on Bastion (screenshots move by its known animation noise only, no new red line, frame time unchanged) and a Bastion boot with DM_NVN_ENC_THREAD=1. Mario Golf was checked by the PR author on their branch. Co-authored-by: secretlemur28 <354896836+secretlemur28@users.noreply.github.com>
Owner
|
Landed on main as 2fb8200, with you as co-author. Thanks for the clear diagnosis. Changes from the PR:
Checked here: |
This was referenced Nov 12, 2026
dsi-hub
pushed a commit
to dsi-hub/nxnative
that referenced
this pull request
Nov 15, 2026
…ds#2351) SetStencilRef takes a face and the replay kept both values, but enc_r_stencil_ref sent Metal the front one for both faces, while the depth-stencil state already gave each face its own compare function, operations and masks. A back face therefore tested the front value. Mario Golf: Super Rush's ground decals draw their volumes' back faces where stencil & 0x90 equals the back value 0x10 with a front value of 0, so the driving range's target was never drawn. Both values now go to Metal (setStencilFrontReferenceValue: backReferenceValue:), the per-encoder state cache compares both, and the deferred recorder's RO_R_SREF carries both, as the Vulkan layer already did. Reference entry: "Front and back stencil reference values" in docs/reference/rendering.md. Checked: regress.py check on Bastion (screenshots move by its known animation noise only, no new red line, frame time unchanged) and a Bastion boot with DM_NVN_ENC_THREAD=1. Mario Golf was checked by the PR author on their branch. Co-authored-by: secretlemur28 <354896836+secretlemur28@users.noreply.github.com> (cherry picked from commit 2fb8200)
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
Mario Golf: Super Rush (
0100C9C00E25C000, 4.0.0, #814): the driving range's scoring target in Golf Adventure (a ring with a blue centre on the fairway) is not drawn, in the normal view or the top view, and nothing in the log says why.SetStencilReftakes a face and the replay keeps both values (S.st_ref[0],[1]), butenc_r_stencil_refsent Metal the front one for both faces (setStencilReferenceValue:). The game's ground decals are volumes drawn twice: front faces mark stencil bit 0x80 where the volume lies behind the ground, then back faces draw the colour wherestencil & 0x90equals the back value 0x10 (the terrain's mark), with a front value of 0. Tested against the front value, the colour draw passed nowhere on the ground.Both values now reach Metal (
setStencilFrontReferenceValue:backReferenceValue:when they differ), the per-encoder state cache compares both, and the deferred recorder'sRO_R_SREFcarries both.Reference entry: "Front and back stencil reference values" in
docs/reference/rendering.md, with its line in the symptom index.Checked
secretlemur28/nxnative@golf-tess, commit8ff8ae1b): the target (pass with fragment shader6f91c05c60985a33, four draws of 384 indices: two decals, two draws each) shows in the top view and from the tee, where it was missing before.mainat47607fe0with this change (and A subsdk a provisional profile gains from the NRO collection also goes into its build rows #2215, cra.py reads the 2021 layout of Camelot's archive (Mario Golf: Super Rush 4.0.0) #2216, which the game needs to build): the host builds and the Rookie Course's first tee draws and runs as before (frame time p50 16.67 ms). Not rerun on the range onmain: reaching it needs a save well into Golf Adventure.regress.pyreport; the graphics test suite; iOS. Any game whose front and back reference values differ now draws differently, which is the point, but it is a path every game takes.Docs
docs/reference/rendering.md, andpython3 dm/tools/docs_symptoms.pywas run🤖 Generated with Claude Code