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

Merged
robot00f merged 1 commit from upstream-pr/1018 into main 2026-11-29 14:38:45 +00:00
robot00f commented 2026-11-24 16:58:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-24T16:58:59Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5476654382 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1018). Originally posted by [robot00f](https://github.com/robot00f) on 2026-11-24T16:58:59Z. --- 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)
PierreEbele commented 2026-11-25 14:28:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:28:33Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165335544 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1018#issuecomment-7165335544). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:28:33Z. --- 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
zmasi commented 2026-11-29 00:08:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:08:08Z.


#1018 | head cad4ceecfa (merged cleanly onto origin/main 829530dbd0) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11)

  • Diff & safety audit: Inspected 100% of the diff (+43/-0 in docs/d3d12_vulkan.md) adding the <a id="xg-swizzle-linear-path"></a> subsection (XG-SWIZZLE-LINEAR-PATH) under §4.2. Contains only static call-site offsets, register/argument shapes, and consumer branch behavior; python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md passed (rc=0).
  • Merge & doc suite checks on #1018 + origin/main (829530dbd0):
    • Clean 3-way merge onto origin/main (829530dbd0), and clean combined 3-way merge alongside open PR #1125 (docs/d3d12_vulkan.md).
    • Scoped tests/test_docs_links.py and tests/test_docs_cli_flags.py checks on docs/d3d12_vulkan.md: 0 broken links/anchors (including [textures.md](textures.md) and <a id="xg-swizzle-linear-path"></a>) and 0 unknown CLI flags.
    • python -I tests/test_docs_table_rows.py (2/2), tests/test_docs_repo_paths.py (5/5, confirming runtime/src/gfx10_tiling.h exists), tests/test_docs_encoding.py (1/1), tests/test_docs_list_items.py (3/3), and tests/test_docs_repeated_lines.py (3/3) all passed (OK).
  • Source cross-check against runtime/shims/xg_xs.cpp on current main:
    • The static call-site contract recorded here — XGSuggestSwizzleMode(desc, 0, &desc->tileMode) across 2 call sites writing 0x100 | mode when known, and XGCreateTextureComputer callers invoking computer vtable slots 2, 8 (+0x40), and 10 — matches the call-site summary at the top of runtime/shims/xg_xs.cpp.
    • Context note: on current origin/main, runtime/shims/xg_xs.cpp now implements two-model swizzled layout selection (XGSuggestSwizzleMode writes kSwizzled | select_mode(d) and XGCreateTextureComputer backs slots 0, 1, 2, 6, 8, 9, 10 via xg_xs_layout.h and runtime/src/console_texture_layout.h), so the "What a shim can do with that" paragraph documents a minimal linear fallback option rather than what xg_xs.cpp currently returns by default.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247899610 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1018#issuecomment-7247899610). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T00:08:08Z. --- #1018 | head cad4ceecfabde9cc219a63373677ab1c8df0d277 (merged cleanly onto origin/main 829530dbd0) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11) - **Diff & safety audit**: Inspected 100% of the diff (`+43/-0` in `docs/d3d12_vulkan.md`) adding the `<a id="xg-swizzle-linear-path"></a>` subsection (`XG-SWIZZLE-LINEAR-PATH`) under §4.2. Contains only static call-site offsets, register/argument shapes, and consumer branch behavior; `python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md` passed (`rc=0`). - **Merge & doc suite checks on `#1018 + origin/main` (`829530dbd0`)**: - Clean 3-way merge onto `origin/main` (`829530dbd0`), and clean combined 3-way merge alongside open PR `#1125` (`docs/d3d12_vulkan.md`). - Scoped `tests/test_docs_links.py` and `tests/test_docs_cli_flags.py` checks on `docs/d3d12_vulkan.md`: `0` broken links/anchors (including `[textures.md](textures.md)` and `<a id="xg-swizzle-linear-path"></a>`) and `0` unknown CLI flags. - `python -I tests/test_docs_table_rows.py` (`2/2`), `tests/test_docs_repo_paths.py` (`5/5`, confirming `runtime/src/gfx10_tiling.h` exists), `tests/test_docs_encoding.py` (`1/1`), `tests/test_docs_list_items.py` (`3/3`), and `tests/test_docs_repeated_lines.py` (`3/3`) all passed (`OK`). - **Source cross-check against `runtime/shims/xg_xs.cpp` on current `main`**: - The static call-site contract recorded here — `XGSuggestSwizzleMode(desc, 0, &desc->tileMode)` across 2 call sites writing `0x100 | mode` when known, and `XGCreateTextureComputer` callers invoking computer vtable slots `2`, `8` (`+0x40`), and `10` — matches the call-site summary at the top of `runtime/shims/xg_xs.cpp`. - Context note: on current `origin/main`, `runtime/shims/xg_xs.cpp` now implements two-model swizzled layout selection (`XGSuggestSwizzleMode` writes `kSwizzled | select_mode(d)` and `XGCreateTextureComputer` backs slots `0, 1, 2, 6, 8, 9, 10` via `xg_xs_layout.h` and `runtime/src/console_texture_layout.h`), so the *"What a shim can do with that"* paragraph documents a minimal linear fallback option rather than what `xg_xs.cpp` currently returns by default.
enlight3d commented 2026-11-29 08:59:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T08:59:01Z.


Validation run of this pull request.

  • PR head: cad4ceecfa. main: 54b2a81e95. Merged cleanly (git merge --no-edit --no-ff pr-1018, no conflicts). The merge changes only docs/d3d12_vulkan.md (43 lines added).
  • Documentation only: no ctest test covers it, so there is no red/green to run, and none was invented. No source file changes, so gta6rt was not rebuilt (same sources as main; no new imports possible from this change).
  • What was run on the merge:
    • python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md: exit 0.
    • python -m unittest tests.test_docs_env_vars tests.test_docs_list_items tests.test_docs_repeated_lines tests.test_docs_table_ids: 14 tests, OK.
  • Not checked: the accuracy of the static analysis the note reports (addresses and call sites of the retail executable). That needs the title's executable and a disassembler and was out of scope here.
  • Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253457867 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1018#issuecomment-7253457867). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T08:59:01Z. --- Validation run of this pull request. - PR head: cad4ceecfabde9cc219a63373677ab1c8df0d277. main: 54b2a81e95c470c953ddee6177fd6255cbaf041d. Merged cleanly (`git merge --no-edit --no-ff pr-1018`, no conflicts). The merge changes only `docs/d3d12_vulkan.md` (43 lines added). - Documentation only: no ctest test covers it, so there is no red/green to run, and none was invented. No source file changes, so `gta6rt` was not rebuilt (same sources as main; no new imports possible from this change). - What was run on the merge: - `python -I scripts/check_no_game_data.py docs/d3d12_vulkan.md`: exit 0. - `python -m unittest tests.test_docs_env_vars tests.test_docs_list_items tests.test_docs_repeated_lines tests.test_docs_table_ids`: 14 tests, OK. - Not checked: the accuracy of the static analysis the note reports (addresses and call sites of the retail executable). That needs the title's executable and a disassembler and was out of scope here. - Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.
MoonEyes commented 2026-11-29 14:38:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:38:48Z.


Merged at head cad4cee. Docs-only (docs/d3d12_vulkan.md), reviewed on this head by PierreEbele, enlight3d, zmasi; no test applies. AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257465189 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1018#issuecomment-7257465189). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:38:48Z. --- Merged at head cad4cee. Docs-only (docs/d3d12_vulkan.md), reviewed on this head by PierreEbele, enlight3d, zmasi; no test applies. AI-assisted: yes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1018
No description provided.