Repository navigation
Conversation
… the shader split reads FFXII's VBF archives, whose blocks are raw LZ4, and PhyreEngine's built-in programs in main Every frame was black after the logos while music played and the game took input. The split logged "[RED] FFXII_TZA.vbf: error: Error -3 while decompressing data: incorrect header check (its shaders are left out)" (the same for FFXII_TZA_PATCH.vbf) and seven "main control section @...: no code area" lines and found 3,100 shaders, 3,028 of them in main's GLSLC outputs; the run printed "[RED] shader ... is not in the shader map" for 27 keys in the first minute and "program has no vertex shader". The SRYK archives have FFX/X-2's layout, but their compressed blocks are raw LZ4 blocks (no frame, no size prefix; gamedata/nxgamesetting.ini's block opens with the token f6 90 and then "Language="), so vbf.py's zlib stopped each archive at its first compressed block. And main holds 23 of PhyreEngine's built-in programs in Phyre's own form, the code area right before its control section, unaligned, 9 bytes between pairs, with no RYHP container; nothing points at them in a form raw_shaders follows, so the aligned ones were left out with a red line and the unaligned ones never looked at. vbf.read now takes a block that is one whole zlib stream of the block's size as before and any other compressed block as a raw LZ4 block of exactly that size (vbf.block); a block that is neither stops the member with an error. shader_split.py's phyre_main runs the existing phyre_shaders (same header, length and stage checks) on main for a game whose files are Phyre's (a .vbf archive or a .phyre effect), before raw_shaders, which then leaves those control sections alone. The split now finds 6,454 shaders (5,999 pixel, 371 vertex, 84 geometry; 3,051 from main, 3,403 from the archives and loose files); all 32 programs DM_NVN_SHDUMP saved up to the first cutscene are among them (25 in the archives, 7 in main). New profile dm/games/0100EB100AB42000 from the provisional one, with depth_mode zero (the game sets near = 0, so the bundled pipeline archive was built for the wrong depth mode) and dual_want.tsv: 20 pixel shaders blend with their output 1 as the second source, and without the dual-source entry point the menu cursor's highlight, button and character icons and most cutscene backgrounds drew nothing (listed with DM_NVN_DUAL_WANT over menus, dialogue, a cutscene and a battle). Its note and games-table row; a reference entry (LZ4 blocks in FFXII's VBF archives and Phyre programs in main). Checked: test_vbf.py (new cases: LZ4 beside zlib blocks, a block that is neither, Phyre pairs in a main-like blob read only for a Phyre game and then not reported by raw_shaders), all test_split_*, test_docs, test_game_profile. On an M3 Max: logos, title, menus, dialogue, a battle and cutscenes at 30 fps, no shader missing from the map and no dual-source red line. Not run: the iPhone, regress.py; FFX/X-2's main was not checked for such pairs (phyre_main runs for it too). Open: one texture with a blue stripe, once; "[RED] BeginRecording re-entered" about once a frame, with no visible effect.
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
FINAL FANTASY XII THE ZODIAC AGE (
0100EB100AB42000) showed a black screen after the logos (music and input worked). Two split gaps left about half its shaders out of the map:SRYKarchives match FFX/X-2's layout, but compressed blocks are raw LZ4 blocks, not zlib, sovbf.pystopped each archive at its first block (Error -3 ... incorrect header check (its shaders are left out)).vbf.readnow decodes a block as zlib when it is one whole stream of the block's size and as raw LZ4 of exactly that size otherwise (vbf.block).main.mainholds 23 PhyreEngine built-in programs as code area + control section pairs, unaligned and outside anyRYHPcontainer, whichraw_shaderscannot attribute (7 red "no code area" lines; the unaligned ones were never examined).phyre_mainruns the existingphyre_shadersonmainfor games whose files are Phyre's (.vbf/.phyre).Shaders: 3,100 → 6,454. All 32 programs
DM_NVN_SHDUMPsaved before the fix are in the new map.Also a new profile (
depth_mode zero;dual_want.tsvwith 20 dual-source pixel shaders, without which the cursor highlight, icons and cutscene backgrounds drew nothing), its note, games-table row, and the reference entry LZ4 blocks in FFXII's VBF archives and Phyre programs in main.Checked
dm/gfx/tests/test_vbf.py(new LZ4 and Phyre-in-main cases), alldm/tools/tests/test_split_*,test_docs,test_game_profile;docs_symptoms.py --check.not in the shader mapand nono dual-source entry pointlines.scripts/regress.py.phyre_mainalso runs for FFX/X-2 (it has.vbffiles); itsmainwas not checked for such pairs, as I don't have that game.Docs
docs/reference/shaders.mdentry, andpython3 dm/tools/docs_symptoms.pywas runvbf.pyandshader_split.pyare split tools, not chain tools)Open, in the game note: one texture with a blue stripe (seen once);
[RED] BeginRecording re-enteredabout once a frame, with no visible effect.