Repository navigation
packing/shader_split: read loose .nvn program files - #2669
Open
bensaadmucret wants to merge 1 commit into
Open
bensaadmucret wants to merge 1 commit into
bensaadmucret wants to merge 1 commit into
Conversation
Vengeance Hunters keeps its eight shaders as loose *_vs.nvn / *_fs.nvn
files in the RomFS, each one NVN program behind a 16-byte header
{control length, control offset, code length, code offset}. The file
has no magic, so the generic prefilter dropped it before scan_blob
could look inside, and the split stopped with 'found no shaders in
main or the RomFS'.
scan_file_in now tries nvn_loose on every file it loads: the header's
two {length, offset} pairs must stay in the file and name a control
section and a code area of the right magic, the stage from the SPH as
usual. The programs are single-stage; '#NVN@' keys pair through the
pixel-input cover like the other single-stage sources.
Checked: build_ipa_from_nsp.py on Vengeance Hunters splits its 8
shaders (1 vertex, 7 pixel) and the packed Mac app reaches its frame
loop at 60 fps with no red line; test_split_nvn covers each stage,
non-minimal offsets and the four rejection shapes.
Found on Vengeance Hunters (01008EF020C98000), no profile yet.
bensaadmucret
force-pushed
the
pr-nvn-loose
branch
from
November 14, 2026 12:59
b2a3f2b to
c539cee
Compare
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
A reader for loose
.nvnprogram files: one compiled NVN program behind a 16-byte header{control length, control offset, code length, code offset}, then the control section and the code area it names.Why
Vengeance Hunters (
01008EF020C98000) ships its eight shaders as loose*_vs.nvn/*_fs.nvnfiles in the RomFS. The file has no magic, so the generic prefilter dropped it beforescan_blobcould look inside, and the split stopped with[RED] the shader split found no shaders in main or the RomFS.scan_file_innow triesnvn_looseon every file it loads: the header's two {length, offset} pairs must stay in the file and name a control section and a code area of the right magic; the stage comes from the SPH as usual, andcheckstill verifies the control's own code length. The programs are single-stage, so'#NVN@'keys pair through the pixel-input cover like the other single-stage sources.Checked
build_ipa_from_nsp.pyon Vengeance Hunters splits its 8 shaders (1 vertex, 7 pixel) and the packed Mac app reaches its frame loop at 60 fps with no red linetest_split_nvn.py: a synthetic.nvnper stage, non-minimal offsets, and the four rejection shapes (control or code magic absent, offset out of the file, short file)test_split_*suite: 87 tests pass;test_docs: 6/6Docs
docs/reference/shaders.md: new entry "Loose.nvnprogram files";docs_symptoms.pyrun (index regenerated)Found on Vengeance Hunters (
01008EF020C98000), no profile yet; tracked at LNPANDY/NX2Apple#1309.