gpu(native): map 24 additional DXGI texture formats to Metal #24

Closed
github-bot wants to merge 1 commit from gh-pr/24/head into gh-pr/24/base
Owner

@⁠claytonblythe on GitHub · 2026-11-26 09:38 UTC · original
claytonblythe:feat/metal-dxgi-texture-formats → main · +116 −9 · 3 files · 1 commits · closed without merging

Summary

Maps 24 exact 1:1 DXGI texture formats observed in live GTA VI Series S runs to Metal MTLPixelFormats across victory-backend, victory-metal, and victory-gpu:

  • sRGB block-compressed: BC1_UNORM_SRGB (72), BC2_UNORM_SRGB (75), BC3_UNORM_SRGB (78), BC7_UNORM_SRGB (99)
  • HDR & packed color: R10G10B10A2_UNORM (24), R11G11B10_FLOAT (26), R9G9B9E5_SHAREDEXP (67)
  • Float / normalized: R16G16B16A16_UNORM (11), R16G16B16A16_SNORM (13), R32G32_FLOAT (16), R16G16_FLOAT (34), R16G16_UNORM (35), R8G8_UNORM (49), R8G8_SNORM (51), R16_TYPELESS (53), R16_FLOAT (54)
  • Integer: R32G32B32A32_UINT (3), R32G32_UINT (17), R8G8B8A8_UINT (30), R16G16_UINT (36), R32_UINT (42), R8G8_UINT (50), R16_UINT (57), R8_UINT (62)

Eliminates 22 of the 24 "a title texture format the host does not represent" warnings seen on boot/menu runs.

Testing

  • cargo test --target x86_64-apple-darwin -p victory-gpu --lib native::descriptors (3/3 passed, including new dxgi_formats_map_with_expected_block_sizes test verifying every DXGI code and block size).
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings (0 warnings).
  • cargo xtask policy (363 files ok).
**@⁠claytonblythe** on GitHub · 2026-11-26 09:38 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/24) `claytonblythe:feat/metal-dxgi-texture-formats` → `main` · +116 −9 · 3 files · 1 commits · closed without merging ## Summary Maps 24 exact 1:1 DXGI texture formats observed in live GTA VI Series S runs to Metal `MTLPixelFormat`s across `victory-backend`, `victory-metal`, and `victory-gpu`: - **sRGB block-compressed**: `BC1_UNORM_SRGB` (72), `BC2_UNORM_SRGB` (75), `BC3_UNORM_SRGB` (78), `BC7_UNORM_SRGB` (99) - **HDR & packed color**: `R10G10B10A2_UNORM` (24), `R11G11B10_FLOAT` (26), `R9G9B9E5_SHAREDEXP` (67) - **Float / normalized**: `R16G16B16A16_UNORM` (11), `R16G16B16A16_SNORM` (13), `R32G32_FLOAT` (16), `R16G16_FLOAT` (34), `R16G16_UNORM` (35), `R8G8_UNORM` (49), `R8G8_SNORM` (51), `R16_TYPELESS` (53), `R16_FLOAT` (54) - **Integer**: `R32G32B32A32_UINT` (3), `R32G32_UINT` (17), `R8G8B8A8_UINT` (30), `R16G16_UINT` (36), `R32_UINT` (42), `R8G8_UINT` (50), `R16_UINT` (57), `R8_UINT` (62) Eliminates 22 of the 24 "a title texture format the host does not represent" warnings seen on boot/menu runs. ## Testing - `cargo test --target x86_64-apple-darwin -p victory-gpu --lib native::descriptors` (3/3 passed, including new `dxgi_formats_map_with_expected_block_sizes` test verifying every DXGI code and block size). - `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` (0 warnings). - `cargo xtask policy` (363 files ok).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:42:49 +00:00
github-bot closed this pull request 2026-11-26 14:42:49 +00:00
Author
Owner

@⁠claytonblythe on GitHub · 2026-11-26 09:41 UTC · original

Live-tested on a 16 GB Apple M4 (--console series-s, VICTORY_GUESS_GRAPHICS=1, 55 s headless):

  • Dropped unknown-format warnings from 24 down to 2 (only format=86 B5G5R5A1 and format=115 B4G4R4A4 remain).
  • 0 no host texture creation errors across all 24 newly mapped formats.
  • Reached frame 1024 (recorded=1604 encoded=1604, 0 dropped draws, 0 OOMs).
**@⁠claytonblythe** on GitHub · 2026-11-26 09:41 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/24#issuecomment-7188341600) Live-tested on a 16 GB Apple M4 (`--console series-s`, `VICTORY_GUESS_GRAPHICS=1`, 55 s headless): - Dropped unknown-format warnings from 24 down to 2 (only `format=86` `B5G5R5A1` and `format=115` `B4G4R4A4` remain). - **0** `no host texture` creation errors across all 24 newly mapped formats. - Reached frame 1024 (`recorded=1604 encoded=1604`, 0 dropped draws, 0 OOMs).
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 10:09 UTC · original · requested changes

Thanks for this! The native/join-2 work that just landed on main (a2940ab) already maps 23 of these 24 formats, so this now conflicts. The one that's still missing is BC2_UNORM_SRGB (75). Could you rebase onto main and cut this down to that format (backend, Metal and the descriptors mapping), plus your dxgi_formats_map_with_expected_block_sizes test, updated to main's format names (e.g. Rgb10a2Unorm, Rg11b10Float, Rgb9e5Float)? The test is worth keeping, since it covers every mapped code. One more detail: main maps 53 (R16_TYPELESS) separately from 56, so please keep it that way.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 10:09 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/24#pullrequestreview-6072144401) · **requested changes** Thanks for this! The native/join-2 work that just landed on main (a2940ab) already maps 23 of these 24 formats, so this now conflicts. The one that's still missing is **BC2_UNORM_SRGB (75)**. Could you rebase onto main and cut this down to that format (backend, Metal and the descriptors mapping), plus your `dxgi_formats_map_with_expected_block_sizes` test, updated to main's format names (e.g. `Rgb10a2Unorm`, `Rg11b10Float`, `Rgb9e5Float`)? The test is worth keeping, since it covers every mapped code. One more detail: main maps 53 (R16_TYPELESS) separately from 56, so please keep it that way.
Author
Owner

@⁠claytonblythe on GitHub · 2026-11-26 10:10 UTC · original

Superseded by 4a4d844 and f834ddc on main (which also added B5G5R5A1/B4G4R4A4 and integer-target blend disabling). Note: in 4a4d844, DXGI 50 is R8G8_UINT and 51 is R8G8_SNORM (currently mapped as Rg8Unorm and Rg8Uint), and 75 (BC2_UNORM_SRGB) is still unmapped — happy to send a small follow-up if helpful.

**@⁠claytonblythe** on GitHub · 2026-11-26 10:10 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/24#issuecomment-7189000959) Superseded by 4a4d844 and f834ddc on main (which also added B5G5R5A1/B4G4R4A4 and integer-target blend disabling). Note: in 4a4d844, DXGI 50 is `R8G8_UINT` and 51 is `R8G8_SNORM` (currently mapped as `Rg8Unorm` and `Rg8Uint`), and 75 (`BC2_UNORM_SRGB`) is still unmapped — happy to send a small follow-up if helpful.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 10:16 UTC · original

Good catch, thank you. You're right: main has 50 as Rg8Unorm and 51 as Rg8Uint, but DXGI 50 is R8G8_UINT and 51 is R8G8_SNORM. Yes please, send the small follow-up: fix 50/51, add 75 (BC2_UNORM_SRGB), and include your block-size table test so this can't drift again.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 10:16 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/24#issuecomment-7189148608) Good catch, thank you. You're right: main has 50 as `Rg8Unorm` and 51 as `Rg8Uint`, but DXGI 50 is R8G8_UINT and 51 is R8G8_SNORM. Yes please, send the small follow-up: fix 50/51, add 75 (BC2_UNORM_SRGB), and include your block-size table test so this can't drift again.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.