Repository navigation
Conversation
… shader extractor, notes
…ants a generated shader_map.tsv), extractor also sets the memory keys, notes moved to docs/
Author
|
Related to #2584. |
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 this adds
dm/tools/w4_to_glslc.py: a standalone script (needspip install zstandard) that extracts the game's shaders intoextract/<version>/glslc_capture/and sets four memory keys in the provisional profile.docs/unrailed2-w4-bringup.md: notes on the engine, the shader format and the failure chain.No engine files (
scripts/,shader_split.py) are changed, and no game files, keys or extracted shaders are included. There is no registered profile: a registered profile folder was tried and fails, because the engine then wants a generatedshader_map.tsv.Game
Unrailed 2: Back on Track, update v327680 (v925.eab7b7d5). Godot 4.4.1 (W4 Games console build, mono) on NintendoSDK 20.5.28, NVN "Forward Mobile". The RomFS is a Godot PCK with 1,138
.godot/w4_shaders/*.nvn.w4_shaderfiles.What was wrong
mainimportsglslcCompileand holds 93 GLSL sources, but the game does not compile at boot. Its shaders ship in the RomFS, and the capture boot aborts after about 3 s because no shader map exists yet..w4_shaderfile has a short header (GRSC/NVNC) followed by concatenated zstd frames, and each frame decompresses to one complete GLSLC output (magic 0x19866891, length at +0x44). There are 39,068 frames and 2,884 unique outputs.mem_stack0x100000000x100000000mem_reserve0x1400000000x230000000mem_stackmem_alias0x1180000000x118000000app_pool0xCD5000000x180000000MemoryPoolInitialize: non-virtual pool has no storage flags=0x22 size=0x8000000The stack and pool values are working guesses, larger than needed and not tuned.
How to build
pip install zstandard, thenpython3 dm/tools/w4_to_glslc.py <the _build folder> v327680.Tested
Apple M3 Max, macOS 26.6.2, Xcode 27.2. From a clean checkout of this branch with a fresh work folder, the two-step flow above finished all 8 build stages. The game then ran 5 min headless and 10 min in a window with sound, with no aborts or crashes, and reached its title screen. Gameplay beyond the title screen, controls, saves and long sessions are not checked.
[RED] texture format 0x22 has no Metal equivalentis logged once and its visual effect is unchecked.Suggested follow-ups
shader_split.py, which would make the extractor unnecessary.mainbut shipped shaders is not sent through the capture step.