docs(d3d12_vulkan): the title already supports the linear tile path (XG-SWIZZLE-LINEAR-PATH) #1018

Open
github-bot wants to merge 1 commit from github-bot/gh-1018 into main AGit
Owner

@⁠robot00f on GitHub · 2026-11-24 16:58 UTC · original
robot00f:docs/agent5 → main · +43 −0 · 1 files · 1 commits · open

Item: XG-SWIZZLE-LINEAR-PATH (claimed in #14).

What

Adds a short, anchored note to docs/d3d12_vulkan.md (end of section 4.2, before 4.3) recording that the title already has a linear tile path, measured statically from the shipped executable:

  • XGSuggestSwizzleMode is the xg_xs.dll IAT thunk at 0x145F3FF50. Its two call sites (0x140C4B030 at 0x140C4B3CE, 0x144ECC940 at 0x144ECCCA2) load the description's tile-class byte [desc+8], compare it with 0xFF, and only then call with RDX = 0 and R8 = desc+0x2C, i.e. XGSuggestSwizzleMode(desc, NULL, &desc->tileMode).
  • Both helpers zero the block at +0x28 first, so the mode field is 0 unless a class is known; known classes write 0x100 | class (with 0x102/0x10A special cases) and never 0.
  • The four consumers branch on CMP x,0x100 / BT x,9 and take the linear arithmetic on 0: 0x14555E9E0 (0x14555EA2C → 0x14555EA45), 0x14193DE10 (0x14193DE73 → 0x14193DE9E, which calls 0x1416F7100 at 0x14193DF4B), 0x1404F4210 (0x1404F448A → 0x1404F44E4), and 0x145121690's non-0x980 path.
  • Notes the shim consequence (write 0, return S_OK; the computer can be an identity that passes offsets through and reports the linear row span), the 0x145121980 cache key, and what remains unmeasured (whether 0x102/0x10A are meant to be tiled).

Why

The current xg_xs shim returns E_NOTIMPL and models no layout, so two XGCreateTextureComputer callers fail cleanly and textures are never laid out. The title's own linear path means a shim does not need a tiled layout at all to make progress: returning 0 is a mode the game already understands, and the texture computer only has to be an identity.

Tested

  • python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md → exit 0.
  • python -m compileall -q make_game.py tools tests → exit 0.
  • Decompilation/disassembly read from a local Ghidra project of the retail executable; nothing executed.

GPUs tested: n/a

AI-assisted: yes (OpenCode)

**@⁠robot00f** on GitHub · 2026-11-24 16:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1018) `robot00f:docs/agent5` → `main` · +43 −0 · 1 files · 1 commits · open Item: **XG-SWIZZLE-LINEAR-PATH** (claimed in #14). ## What Adds a short, anchored note to `docs/d3d12_vulkan.md` (end of section 4.2, before 4.3) recording that the title already has a linear tile path, measured statically from the shipped executable: - `XGSuggestSwizzleMode` is the `xg_xs.dll` IAT thunk at `0x145F3FF50`. Its two call sites (`0x140C4B030` at `0x140C4B3CE`, `0x144ECC940` at `0x144ECCCA2`) load the description's tile-class byte `[desc+8]`, compare it with `0xFF`, and only then call with `RDX = 0` and `R8 = desc+0x2C`, i.e. `XGSuggestSwizzleMode(desc, NULL, &desc->tileMode)`. - Both helpers zero the block at `+0x28` first, so the mode field is 0 unless a class is known; known classes write `0x100 | class` (with `0x102`/`0x10A` special cases) and never 0. - The four consumers branch on `CMP x,0x100` / `BT x,9` and take the linear arithmetic on 0: `0x14555E9E0` (`0x14555EA2C` → `0x14555EA45`), `0x14193DE10` (`0x14193DE73` → `0x14193DE9E`, which calls `0x1416F7100` at `0x14193DF4B`), `0x1404F4210` (`0x1404F448A` → `0x1404F44E4`), and `0x145121690`'s non-`0x980` path. - Notes the shim consequence (write 0, return `S_OK`; the computer can be an identity that passes offsets through and reports the linear row span), the `0x145121980` cache key, and what remains unmeasured (whether `0x102`/`0x10A` are meant to be tiled). ## Why The current `xg_xs` shim returns `E_NOTIMPL` and models no layout, so two `XGCreateTextureComputer` callers fail cleanly and textures are never laid out. The title's own linear path means a shim does not need a tiled layout at all to make progress: returning 0 is a mode the game already understands, and the texture computer only has to be an identity. ## Tested - `python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md` → exit 0. - `python -m compileall -q make_game.py tools tests` → exit 0. - Decompilation/disassembly read from a local Ghidra project of the retail executable; nothing executed. GPUs tested: n/a AI-assisted: yes (OpenCode)
XG-SWIZZLE-LINEAR-PATH: record that XGSuggestSwizzleMode is only called with a NULL second argument and &desc->tileMode when byte 8 is 0xFF, that 0 is the linear mode, and where the consumers branch on it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:33:48 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:28 UTC · original

Reviewed cad4ceecf: docs-only section; ran the docs tests in the sandbox on both trees (links, list items,
repeated lines, table ids/rows, repo paths — all OK) and check_no_game_data.py — clean. No reproduced
finding. Two notes: "a shim writes 0" is an alternative to the shipped XGSuggestSwizzleMode, which writes
0x100|mode — the section should say the shipped behaviour differs; and "linear everywhere" is measured at
four consumers while the layout word's recorded meaning is "pick one" (the section concedes the nuance).
AI-assisted review.
Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 14:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1018#issuecomment-7165335544) Reviewed cad4ceecf: docs-only section; ran the docs tests in the sandbox on both trees (links, list items, repeated lines, table ids/rows, repo paths — all OK) and `check_no_game_data.py` — clean. No reproduced finding. Two notes: "a shim writes 0" is an alternative to the shipped `XGSuggestSwizzleMode`, which writes `0x100|mode` — the section should say the shipped behaviour differs; and "linear everywhere" is measured at four consumers while the layout word's recorded meaning is "pick one" (the section concedes the nuance). AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1018/head:github-bot/gh-1018'
git switch 'github-bot/gh-1018'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1018'
git switch 'github-bot/gh-1018'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1018'
git switch 'github-bot/gh-1018'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1018'
git switch 'main'
git merge --squash 'github-bot/gh-1018'
git switch 'main'
git merge --ff-only 'github-bot/gh-1018'
git switch 'main'
git merge 'github-bot/gh-1018'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.