formats: reject XOR layouts in detile_params and invert them in coordinate #496

Open
ahmetbagci8 wants to merge 1 commit from upstream-pr/496 into main
ahmetbagci8 commented 2026-12-01 17:45:00 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-12-01T17:45:00Z.


Summary

  • \Layout::detile_params: return \None\ when \self.xor.is_some(). After \configure_xor, \ddressable()\ is \ rue\ while \pattern_tables()\ are empty (&EMPTY_PATTERN), so returning \Some(DetileParams)\ caused an out-of-bounds panic in \DetileParams::address\ and passed empty pattern tables to GPU detiling (\gpudetile.rs).
  • \Layout::coordinate: handle \self.xor.is_some()\ for non-tail mips by searching the single block containing the offset, instead of indexing the empty \self.pattern\ and always returning \None.

Verification

  • \cargo test -p vice-tay-formats --lib texture::tests\ (36 passed, including new regression tests for configured XOR layouts in \detile_params\ and \coordinate).
<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5591191937 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/496). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-12-01T17:45:00Z. --- ## Summary - \Layout::detile_params\: return \None\ when \self.xor.is_some()\. After \configure_xor\, \ddressable()\ is \ rue\ while \pattern_tables()\ are empty (\&EMPTY_PATTERN\), so returning \Some(DetileParams)\ caused an out-of-bounds panic in \DetileParams::address\ and passed empty pattern tables to GPU detiling (\gpudetile.rs\). - \Layout::coordinate\: handle \self.xor.is_some()\ for non-tail mips by searching the single block containing the offset, instead of indexing the empty \self.pattern\ and always returning \None\. ## Verification - \cargo test -p vice-tay-formats --lib texture::tests\ (36 passed, including new regression tests for configured XOR layouts in \detile_params\ and \coordinate\).
Aniseto commented 2026-12-01 17:59:51 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Aniseto on 2026-12-01T17:59:51Z.


Ran the named texture::tests group at aa62ce13 on an NVIDIA Blackwell desktop part with 16 GB of VRAM.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q --locked -p vice-tay-formats --lib texture::tests -- --test-threads=1
36 passed; 0 failed; 0 ignored; 55 filtered out      (exit 0)

The group passes here, including the new regression tests for configured XOR layouts in detile_params and coordinate. These are CPU-side layout tests; no title was run and no GPU detiling path was exercised.

Not tested: the full workspace suite, a retail title with XOR-configured layouts, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7320216827 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/496#issuecomment-7320216827). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-12-01T17:59:51Z. --- Ran the named `texture::tests` group at `aa62ce13` on an NVIDIA Blackwell desktop part with 16 GB of VRAM. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q --locked -p vice-tay-formats --lib texture::tests -- --test-threads=1 36 passed; 0 failed; 0 ignored; 55 filtered out (exit 0) ``` The group passes here, including the new regression tests for configured XOR layouts in `detile_params` and `coordinate`. These are CPU-side layout tests; no title was run and no GPU detiling path was exercised. Not tested: the full workspace suite, a retail title with XOR-configured layouts, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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/496:upstream-pr/496'
git switch 'upstream-pr/496'

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/496'
git switch 'upstream-pr/496'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/496'
git switch 'upstream-pr/496'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/496'
git switch 'main'
git merge --squash 'upstream-pr/496'
git switch 'main'
git merge --ff-only 'upstream-pr/496'
git switch 'main'
git merge 'upstream-pr/496'
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
TaynanGT/Vice-Tay!496
No description provided.