Formats: reject invalid GFX10 swizzle modes for 1D textures #1606

Closed
zhaibingye wants to merge 1 commit from upstream-pr/1607 into main
zhaibingye commented 2026-11-24 19:43:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by zhaibingye on 2026-11-24T19:43:55Z.


Main gives a 128-texel R32 1D array (3 slices) a 12,288-byte layout with SW_256B_S. AMD Addr2ComputeSurfaceInfo rejects it. Enforce the GFX10 1D mask for explicit layouts. The regression test covers IDs 0 through 27 and a height-one 2D control, with sizes verified against Navi 21 addrlib.

AMD reference: github.com/GPUOpen-Drivers/pal@c5e800072a/src/core/imported/addrlib/src/gfx10/gfx10addrlib.h (L109-L141)

The 1D expectation in pending PR #315 assumes every known mode is valid and would need updating if both land.

Verified red on main. Formats tests: 24 passed, 4 ignored. Clippy and asset policy passed. Linux HLE tests are blocked by the existing Windows-only host_resource definition.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589984244 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1607). Originally posted by [zhaibingye](https://github.com/zhaibingye) on 2026-11-24T19:43:55Z. --- Main gives a 128-texel R32 1D array (3 slices) a 12,288-byte layout with SW_256B_S. AMD Addr2ComputeSurfaceInfo rejects it. Enforce the GFX10 1D mask for explicit layouts. The regression test covers IDs 0 through 27 and a height-one 2D control, with sizes verified against Navi 21 addrlib. AMD reference: https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib/src/gfx10/gfx10addrlib.h#L109-L141 The 1D expectation in pending PR #315 assumes every known mode is valid and would need updating if both land. Verified red on main. Formats tests: 24 passed, 4 ignored. Clippy and asset policy passed. Linux HLE tests are blocked by the existing Windows-only host_resource definition.
DenRakEiw commented 2026-11-24 20:02:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T19:56:53Z.

Review: APPROVED


Verified locally merged onto origin/main (Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-formats — 24 passed, 0 failed (4 ignored), including one_dimensional_textures_accept_only_gfx10_1d_swizzles
  • cargo clippy -p victory-formats --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean validation rejecting invalid GFX10 swizzle modes for 1D textures with targeted unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6046368476 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1607#pullrequestreview-6046368476). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T19:56:53Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-formats` — 24 passed, 0 failed (4 ignored), including `one_dimensional_textures_accept_only_gfx10_1d_swizzles` - `cargo clippy -p victory-formats --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean validation rejecting invalid GFX10 swizzle modes for 1D textures with targeted unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
upstream-sync closed this pull request 2026-11-24 23:04:48 +00:00

Pull request closed

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
Marvisak/VIctory!1606
No description provided.