xg_xs: implement XGSuggestSwizzleMode export #358

Open
github-bot wants to merge 2 commits from github-bot/gh-358 into main AGit
Owner

@⁠FilimonEnc on GitHub · 2026-11-24 05:43 UTC · original
FilimonEnc:feat/xg-suggest-swizzle-mode → main · +77 −1 · 3 files · 2 commits · open

Adds export ordinal 24 XGSuggestSwizzleMode to crates/compat/xg_xs:

  • Selects appropriate texture swizzle / tiling mode based on width, height, format, and flags.
  • Updates exports.txt and adds regression unit tests.
  • Verified with pr_gate.py (0 problems).
**@⁠FilimonEnc** on GitHub · 2026-11-24 05:43 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/358) `FilimonEnc:feat/xg-suggest-swizzle-mode` → `main` · +77 −1 · 3 files · 2 commits · open Adds export ordinal 24 XGSuggestSwizzleMode to crates/compat/xg_xs: - Selects appropriate texture swizzle / tiling mode based on width, height, format, and flags. - Updates exports.txt and adds regression unit tests. - Verified with pr_gate.py (0 problems).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:20:05 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:51 UTC · original

Thanks. Please cite the source of this signature (it differs from the one in #292), add a console-oracle or unit test of the result, and update the export count in exports_table.rs, whose test fails with the new line.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:51 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/358#issuecomment-7164384657) Thanks. Please cite the source of this signature (it differs from the one in #292), add a console-oracle or unit test of the result, and update the export count in exports_table.rs, whose test fails with the new line.
Author
Owner

@⁠FilimonEnc on GitHub · 2026-11-25 15:41 UTC · original

Thanks for catching that. I re-checked the actual call sites in game_scarlett_master.exe (IAT 0x6793f68, thunk 0x5f3ff50, callers at RVA 0xc4b3ce and 0x4eccca2), and they indeed pass const D3D12_RESOURCE_DESC* in RCX, 0 in RDX, and &desc->Layout in R8, expecting an HRESULT in EAX — confirming the signature in #292.

I've updated the PR with:

The verified (desc: *const u8, flags: usize, out: *mut u32) -> i32 signature reusing D3D12Desc::read + optimal_swizzle rules (writing 0x100 | mode).
exports.txt updated to pending with the call-site provenance.
exports_table.rs export count updated from 23 to 24.
Unit test suggest_swizzle_mode_rules covering Texture2D (default/RTV/DSV/UAV), invalid dimensions (E_INVALIDARG), and non-zero flags (E_NOTIMPL).

(If you'd prefer to merge #292 directly since it already covers this, feel free to close this one in favor of #292.)

**@⁠FilimonEnc** on GitHub · 2026-11-25 15:41 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/358#issuecomment-7167227336) Thanks for catching that. I re-checked the actual call sites in game_scarlett_master.exe (IAT 0x6793f68, thunk 0x5f3ff50, callers at RVA 0xc4b3ce and 0x4eccca2), and they indeed pass const D3D12_RESOURCE_DESC* in RCX, 0 in RDX, and &desc->Layout in R8, expecting an HRESULT in EAX — confirming the signature in #292. I've updated the PR with: The verified (desc: *const u8, flags: usize, out: *mut u32) -> i32 signature reusing D3D12Desc::read + optimal_swizzle rules (writing 0x100 | mode). exports.txt updated to pending with the call-site provenance. exports_table.rs export count updated from 23 to 24. Unit test suggest_swizzle_mode_rules covering Texture2D (default/RTV/DSV/UAV), invalid dimensions (E_INVALIDARG), and non-zero flags (E_NOTIMPL). (If you'd prefer to merge #292 directly since it already covers this, feel free to close this one in favor of #292.)
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/358/head:github-bot/gh-358'
git switch 'github-bot/gh-358'

Merge

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