Skip to content

make_game: extract and translate the retail executable's 10 embedded shaders (exe stage) - #303

Closed
Andretuta wants to merge 1 commit into
mainfrom
old-pr/10036
Closed

Andretuta wants to merge 1 commit into
mainfrom
old-pr/10036

Conversation

@Andretuta

Copy link
Copy Markdown
Collaborator

Carried over from old PR 10036 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10036, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

Rebased cleanly on current main; supersedes #7746 and #8303 closed during org migration (Python half only).

What

  • make_game.py: new exe_shaders() step in the shaders stage, after bvh_shaders(). It extracts the 10 DXBC containers embedded in game_scarlett_master.exe (1 VS + 9 PS) into /shaders/exe, unpacks and disassembles the FSSM programs, translates them into /shaders/spirv/exe, and writes exe/index.json plus exe_build.json (inputs, so a second run is skipped). It skips cleanly, and drops stale output, when there is no executable.
  • docs/embedded_shaders.md: section 2 describes the step.
  • tests/test_exe_shaders_stage.py: 11 tests on synthetic PSV0 containers, no game data, including a run of the real tools.
  • tests/test_bvh_shaders_stage.py: the fake FSPX index in the stage-order test now carries fspx_code_sha256, which fspx_cache_complete requires. That test already failed on main.

Why

The retail boot has an untranslated vertex shader that is one of the executable's 10 embedded shaders. Nothing in the build produced them.

Not in this PR

The runtime change (ShaderLibrary::load reading /exe) is C++ and is not included; docs say so.

Tested

  • python3 -I -m pytest tests/test_exe_shaders_stage.py tests/test_bvh_shaders_stage.py tests/test_make_game*.py: 447 passed, 4 skipped.
  • docs link, path and repeated-line tests: 23 passed with the exe tests.
  • Negative control: on origin/main, test_exe_shaders_stage.py gives 11 failed; test_bvh_shaders_stage.py gives 1 failed (fixed here).

@aslan2142

Copy link
Copy Markdown
Collaborator

Thanks for carrying this over. We're going with #387 (#387) for the executable's embedded shaders, so I'm closing this one.

AI-assisted (Claude Code, Claude Opus 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants