Textures: refuse only layouts without addresses, so render-target XOR textures can upload #4442

Open
github-bot wants to merge 1 commit from github-bot/gh-4441 into main AGit
Owner

@⁠101Leafy on GitHub · 2026-11-30 20:21 UTC · original
101Leafy:nv/xor-addressable → main · +3 −1 · 1 files · 1 commits · open

Follow-up to #2879. Texture staging still refused every XOR layout, so the render-target XOR textures #2879 made addressable never uploaded their contents. It now refuses only layouts without addresses (!layout.addressable()); the other XOR modes are refused as before.

**@⁠101Leafy** on GitHub · 2026-11-30 20:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4441) `101Leafy:nv/xor-addressable` → `main` · +3 −1 · 1 files · 1 commits · open Follow-up to #2879. Texture staging still refused every XOR layout, so the render-target XOR textures #2879 made addressable never uploaded their contents. It now refuses only layouts without addresses (`!layout.addressable()`); the other XOR modes are refused as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 20:24:37 +00:00
Author
Owner

@⁠IRennie74 on GitHub · 2026-11-30 22:38 UTC · original

As far as I can see this does not change anything on main yet. staging (crates/victory-gpu/src/texture.rs around 3186) takes its layout from crate::resource::texture_layout (resource.rs:178-200), which never calls Layout::configure_xor. Layout::new gives every XOR swizzle EMPTY_PATTERN and xor: None (victory-formats/src/texture.rs around 873). So addressable() is still false for every XOR mode, and the same textures are refused, now via the new check.

The only caller of configure_xor is resource::title_texture (resource.rs around 5786), which also checks that the start is block-aligned. To make render-target XOR textures upload, staging would need to do the same: configure with crate::console::current().pipes() when the memory is block-aligned.

Once that is done, watch the card's path (VICTORY_GPU_DETILE). Layout::detile_params only checks addressable(), so a configured XOR layout passes. But DetileParams and pattern_tables() carry no XOR pattern (the tables are empty for XOR modes), so gpudetile::jobs would detile it as a plain swizzle: wrong texels rather than missing ones. Either detile_params should return None when self.xor.is_some(), or the shader needs the XOR terms.

**@⁠IRennie74** on GitHub · 2026-11-30 22:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4441#issuecomment-7294114579) As far as I can see this does not change anything on main yet. `staging` (`crates/victory-gpu/src/texture.rs` around 3186) takes its layout from `crate::resource::texture_layout` (`resource.rs:178-200`), which never calls `Layout::configure_xor`. `Layout::new` gives every XOR swizzle `EMPTY_PATTERN` and `xor: None` (`victory-formats/src/texture.rs` around 873). So `addressable()` is still false for every XOR mode, and the same textures are refused, now via the new check. The only caller of `configure_xor` is `resource::title_texture` (`resource.rs` around 5786), which also checks that the start is block-aligned. To make render-target XOR textures upload, `staging` would need to do the same: configure with `crate::console::current().pipes()` when the memory is block-aligned. Once that is done, watch the card's path (`VICTORY_GPU_DETILE`). `Layout::detile_params` only checks `addressable()`, so a configured XOR layout passes. But `DetileParams` and `pattern_tables()` carry no XOR pattern (the tables are empty for XOR modes), so `gpudetile::jobs` would detile it as a plain swizzle: wrong texels rather than missing ones. Either `detile_params` should return `None` when `self.xor.is_some()`, or the shader needs the XOR terms.
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/4442/head:github-bot/gh-4441'
git switch 'github-bot/gh-4441'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4441'
git switch 'github-bot/gh-4441'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4441'
git switch 'github-bot/gh-4441'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4441'
git switch 'main'
git merge --squash 'github-bot/gh-4441'
git switch 'main'
git merge --ff-only 'github-bot/gh-4441'
git switch 'main'
git merge 'github-bot/gh-4441'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4442
No description provided.