[PR #303] [CLOSED] make_game: extract and translate the retail executable's 10 embedded shaders (exe stage) #355

Closed
opened 2026-11-26 20:17:36 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/303
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/10036


📝 Commits (1)

  • 98eb113 make_game: extract and translate the retail executable's 10 embedded shaders into shaders/exe

📊 Changes

4 files changed (+480 additions, -2 deletions)

View changed files

📝 docs/embedded_shaders.md (+10 -0)
📝 make_game.py (+84 -1)
📝 tests/test_bvh_shaders_stage.py (+1 -1)
➕ tests/test_exe_shaders_stage.py (+385 -0)

📄 Description

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).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/303 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/10036` --- ### 📝 Commits (1) - [`98eb113`](https://github.com/ubiquitarianism/leonida/commit/98eb113e2610ce9f1990d8966bb601434b992a48) make_game: extract and translate the retail executable's 10 embedded shaders into shaders/exe ### 📊 Changes **4 files changed** (+480 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/embedded_shaders.md` (+10 -0) 📝 `make_game.py` (+84 -1) 📝 `tests/test_bvh_shaders_stage.py` (+1 -1) ➕ `tests/test_exe_shaders_stage.py` (+385 -0) </details> ### 📄 Description > 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 <work>/shaders/exe, unpacks and disassembles the FSSM programs, translates them into <work>/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 <shaders>/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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:36 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#355
No description provided.