[PR #461] [MERGED] xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) #512

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/461
Author: @oscarlosu-lab
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: pr/xg-texture-computer


📝 Commits (1)

  • 77f44fb xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER)

📊 Changes

4 files changed (+1418 additions, -93 deletions)

View changed files

📝 docs/runtime_imports.md (+13 -7)
📝 runtime/shims/xg_xs.cpp (+452 -38)
➕ runtime/src/console_texture_layout.h (+610 -0)
📝 runtime/test/xg_xs_test.cpp (+343 -48)

📄 Description

Claimed in the coordination issue as: RT-XG-TEXTURE-COMPUTER

Summary

Implements the console texture layout model and XGCreateTextureComputer / XGSuggestSwizzleMode in runtime/shims/xg_xs.cpp on top of a GFX10 texture layout model (runtime/src/console_texture_layout.h), replacing the previous E_NOTIMPL stubs:

  • Implements texture computer slots 0 (AddRef), 1 (Release), 2 (layout structure), 6 (element offsets), 8 (copy into subresource), 9 (copy from subresource), and 10 (64 KiB tiling), while unsupported slots log once and return E_NOTIMPL.
  • Descriptions the model cannot lay out still hand out a stub computer in *out alongside E_INVALIDARG (preserving compatibility with measured callers that ignore the HRESULT).
  • Not modelled: compression metadata planes and XOR/MSAA addressing modes (return E_NOTIMPL).

Attribution

  • Layout rules, computer vtable layout, and layout structure ported from Marvisak/VIctory (GPL-3.0), crates/victory-formats/src/texture.rs and crates/victory-hle/src/modules/xg.rs at d2a4bae1f, credited in the file headers; AMD addrlib MIT notice preserved.

Verification

  • Built full runtime (cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo --target gta6rt xg_xs_test) on Windows 11, MSVC 19.52 x64 (VS 2026): 0 warnings in the touched files.
  • xg_xs_test.exe: 106 checks, 0 failures (hand-checked addresses, mip tails, two-plane depth-stencil, bijection/round-trip across 10 layouts, and shim slot routing).
  • ctest -R xg_xs: 1/1 Test #50: xg_xs ... Passed (0.19 sec).
  • python -I scripts/check_no_game_data.py & python -I tests/test_docs_links.py: PASS (16/16 OK).

AI-assisted. No game files.


🔄 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/461 **Author:** [@oscarlosu-lab](https://github.com/oscarlosu-lab) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `pr/xg-texture-computer` --- ### 📝 Commits (1) - [`77f44fb`](https://github.com/ubiquitarianism/leonida/commit/77f44fbe3bd477727a1f5ab6d20c6dd5f40e25e8) xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) ### 📊 Changes **4 files changed** (+1418 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `docs/runtime_imports.md` (+13 -7) 📝 `runtime/shims/xg_xs.cpp` (+452 -38) ➕ `runtime/src/console_texture_layout.h` (+610 -0) 📝 `runtime/test/xg_xs_test.cpp` (+343 -48) </details> ### 📄 Description Claimed in the coordination issue as: RT-XG-TEXTURE-COMPUTER ### Summary Implements the console texture layout model and `XGCreateTextureComputer` / `XGSuggestSwizzleMode` in `runtime/shims/xg_xs.cpp` on top of a GFX10 texture layout model (`runtime/src/console_texture_layout.h`), replacing the previous `E_NOTIMPL` stubs: - Implements texture computer slots `0` (`AddRef`), `1` (`Release`), `2` (layout structure), `6` (element offsets), `8` (copy into subresource), `9` (copy from subresource), and `10` (64 KiB tiling), while unsupported slots log once and return `E_NOTIMPL`. - Descriptions the model cannot lay out still hand out a stub computer in `*out` alongside `E_INVALIDARG` (preserving compatibility with measured callers that ignore the `HRESULT`). - Not modelled: compression metadata planes and XOR/MSAA addressing modes (return `E_NOTIMPL`). ### Attribution - Layout rules, computer vtable layout, and layout structure ported from `Marvisak/VIctory` (GPL-3.0), `crates/victory-formats/src/texture.rs` and `crates/victory-hle/src/modules/xg.rs` at `d2a4bae1f`, credited in the file headers; AMD `addrlib` MIT notice preserved. ### Verification - Built full runtime (`cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo --target gta6rt xg_xs_test`) on Windows 11, MSVC 19.52 x64 (VS 2026): 0 warnings in the touched files. - `xg_xs_test.exe`: `106 checks, 0 failures` (hand-checked addresses, mip tails, two-plane depth-stencil, bijection/round-trip across 10 layouts, and shim slot routing). - `ctest -R xg_xs`: `1/1 Test #50: xg_xs ... Passed (0.19 sec)`. - `python -I scripts/check_no_game_data.py` & `python -I tests/test_docs_links.py`: PASS (`16/16 OK`). AI-assisted. No game files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:07 +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#512
No description provided.