Formats: recover texel coordinates in configured XOR texture layouts #2468
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2468"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-29T13:20:30Z.
GetTexelCoordinate rejects valid byte offsets in standard mips of configured pipe/bank XOR textures on both Series S and Series X. The forward mapping added in #932 and the inverse API added in #1510 meet here. The inverse currently searches the non-XOR address tables, which are empty for these layouts.
This change recovers the unknown in-block coordinate bits from the same parity equations used by the forward path. The block and array/depth slice supply the known high bits. A final forward-address check rejects padding. All 120 current pattern/element-size combinations resolve in at most three passes over the equations.
Validation on
829188e9Reproduce the new regression with
cargo test --release --locked -p victory-formats coordinates_invert_configured_xor_standard_blocks. All test inputs are generated.The BCPack reference failures are also addressed separately by #2236 and #2419. Both correct the BC7 dictionary test oracle.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-29T13:23:50Z.
Review: APPROVED
Tested locally merged onto
main(829188e9).crates/victory-formats/src/texture.rs.cargo test -p victory-formats --lib texture::passed (36 passed; 0 failed, includingcoordinates_invert_configured_xor_standard_blocksandcoordinates_invert_offsets).cargo clippy -p victory-formats --lib -- -D warningspassed with 0 warnings.Clean inverse texel-coordinate recovery for configured XOR texture layouts. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).