gfx10: align 4-byte display swizzle row with GFX10.3 RbPlus (x2y2) #3787

Open
Holastor wants to merge 22 commits from upstream-pr/3787 into main
Holastor commented 2026-12-01 22:06:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-12-01T22:06:36Z.


Depends on #1469

Aligns the 4-byte _D / display swizzle row with GFX10.3 / RDNA2 RbPlus (----x0x1y0y1x2y2) across both src/startup_stubs/gfx10_texture.h and src/startup_stubs/gfx10_layout.h, and restores the corresponding Mesa 25.1.0 AddrLib (supportRbPlus = 1) pins.

Changes

  • src/startup_stubs/gfx10_texture.h and src/startup_stubs/gfx10_layout.h: update 4-byte _D / display pattern to ----x0x1y0y1x2y2.
  • tests/startup_gfx10_layout_check.cpp: update 4-byte display equations (0x102, 0x106, 0x10a) to ... Y0 Y1 X2 Y2 ....
  • tests/startup_xg_gfx10_check.py and tests/xg_swizzle_select_check.cpp: restore RbPlus pins (R32 64x64 1m 256B_D AddrLib comparison).
  • docs/startup-runtime.md and docs/experiments.md: document that the 4-byte display row uses GFX10.3 RbPlus x2y2 and differs from the 4-byte standard row y2x2.

Verification (release)

  • ctest --preset release --no-tests=error -R ^(startup_xg_.*|xg_.*|startup_gfx10_layout.*)$ -V: 20/20 passed
  • docs_links_check.py, bidi_controls_check.py, gfx10_texture_roundtrip_check.py: PASS

Background & Rationale

  • In AMD Mesa AddrLib (src/amd/addrlib/src/gfx10/gfx10SwizzlePattern.h), GFX10.3 / RDNA2 hardware with supportRbPlus = 1 selects GFX10_SW_256_D_RBPLUS_PATINFO (and SW_4K_D_RBPLUS / SW_64K_D_RBPLUS), which uses pattern index 39 (----x0x1y0y1x2y2: bit 6 = x2, bit 7 = y2) for 4-byte elements, whereas non-RbPlus Navi1x uses pattern index 2 (----x0x1y0y1y2x2).
  • Keeping this change isolated in #3787 lets #1469 merge first with a single consistent equation across gfx10_texture.h and gfx10_layout.h, while updating both headers, pins, and docs atomically here once @R0Y00 confirms the GFX10.3 RbPlus row.
  • Will be rebased onto main and marked ready for review right after #1469 lands.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5595435577 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3787). Originally posted by [Holastor](https://github.com/Holastor) on 2026-12-01T22:06:36Z. --- Depends on #1469 Aligns the 4-byte `_D` / `display` swizzle row with GFX10.3 / RDNA2 RbPlus (`----x0x1y0y1x2y2`) across both `src/startup_stubs/gfx10_texture.h` and `src/startup_stubs/gfx10_layout.h`, and restores the corresponding Mesa 25.1.0 AddrLib (`supportRbPlus = 1`) pins. ### Changes - `src/startup_stubs/gfx10_texture.h` and `src/startup_stubs/gfx10_layout.h`: update 4-byte `_D` / `display` pattern to `----x0x1y0y1x2y2`. - `tests/startup_gfx10_layout_check.cpp`: update 4-byte display equations (`0x102`, `0x106`, `0x10a`) to `... Y0 Y1 X2 Y2 ...`. - `tests/startup_xg_gfx10_check.py` and `tests/xg_swizzle_select_check.cpp`: restore RbPlus pins (`R32 64x64 1m 256B_D` AddrLib comparison). - `docs/startup-runtime.md` and `docs/experiments.md`: document that the 4-byte display row uses GFX10.3 RbPlus `x2y2` and differs from the 4-byte standard row `y2x2`. ### Verification (`release`) - `ctest --preset release --no-tests=error -R ^(startup_xg_.*|xg_.*|startup_gfx10_layout.*)$ -V`: **20/20 passed** - `docs_links_check.py`, `bidi_controls_check.py`, `gfx10_texture_roundtrip_check.py`: **PASS** ### Background & Rationale - In AMD Mesa AddrLib (`src/amd/addrlib/src/gfx10/gfx10SwizzlePattern.h`), GFX10.3 / RDNA2 hardware with `supportRbPlus = 1` selects `GFX10_SW_256_D_RBPLUS_PATINFO` (and `SW_4K_D_RBPLUS` / `SW_64K_D_RBPLUS`), which uses pattern index 39 (`----x0x1y0y1x2y2`: bit 6 = `x2`, bit 7 = `y2`) for 4-byte elements, whereas non-RbPlus Navi1x uses pattern index 2 (`----x0x1y0y1y2x2`). - Keeping this change isolated in `#3787` lets `#1469` merge first with a single consistent equation across `gfx10_texture.h` and `gfx10_layout.h`, while updating both headers, pins, and docs atomically here once @R0Y00 confirms the GFX10.3 RbPlus row. - Will be rebased onto `main` and marked ready for review right after `#1469` lands.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3787:upstream-pr/3787'
git switch 'upstream-pr/3787'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3787'
git switch 'upstream-pr/3787'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3787'
git switch 'upstream-pr/3787'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3787'
git switch 'main'
git merge --squash 'upstream-pr/3787'
git switch 'main'
git merge --ff-only 'upstream-pr/3787'
git switch 'main'
git merge 'upstream-pr/3787'
git push origin 'main'
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
R0Y00/Xbox2Windows!3787
No description provided.