Texture: reuse contiguous column runs across rows #60

Merged
ifBars merged 1 commit from upstream-pr/60 into main 2026-11-24 00:41:34 +00:00
ifBars commented 2026-11-24 00:00:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ifBars on 2026-11-24T00:00:21Z.


Tiling and detiling used to calculate every element's address for each row and then scan that row for contiguous runs. Moving to a new row or depth slice adds a common base to the column addresses, so the same runs can be reused throughout a subresource. Linear textures now copy one row at a time.

The synthetic tests check each tiled element against its coordinate address and verify that row and depth padding retain their original bytes. They cover odd texture dimensions, block compression, mip tails, array slices and 3D textures.

On an i5-11600K, a local release-build comparison during the startup movie measured 14.8–15.7 ms per frame in texture preparation before the change and 3.1–3.4 ms afterward. Both runs played at 30 fps. This measurement used a local integration build with the compatibility changes needed by that machine.

Validation

  • cargo test --locked -p victory-formats --lib passed all 17 active tests. Three external-fixture tests were ignored.
  • cargo check --locked --workspace and cargo xtask policy passed.
  • cargo test --locked --workspace --no-fail-fast reported two failures on Windows 10. The WinHTTP test requires a host export missing on this machine, and victory-loader --test load_probe exited with STATUS_ACCESS_VIOLATION (see #28). The remaining test targets passed.

Developed with AI assistance.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6571424289 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/60). Originally posted by [ifBars](https://github.com/ifBars) on 2026-11-24T00:00:21Z. --- Tiling and detiling used to calculate every element's address for each row and then scan that row for contiguous runs. Moving to a new row or depth slice adds a common base to the column addresses, so the same runs can be reused throughout a subresource. Linear textures now copy one row at a time. The synthetic tests check each tiled element against its coordinate address and verify that row and depth padding retain their original bytes. They cover odd texture dimensions, block compression, mip tails, array slices and 3D textures. On an i5-11600K, a local release-build comparison during the startup movie measured 14.8–15.7 ms per frame in texture preparation before the change and 3.1–3.4 ms afterward. Both runs played at 30 fps. This measurement used a local integration build with the compatibility changes needed by that machine. ### Validation - `cargo test --locked -p victory-formats --lib` passed all 17 active tests. Three external-fixture tests were ignored. - `cargo check --locked --workspace` and `cargo xtask policy` passed. - `cargo test --locked --workspace --no-fail-fast` reported two failures on Windows 10. The WinHTTP test requires a host export missing on this machine, and `victory-loader --test load_probe` exited with `STATUS_ACCESS_VIOLATION` (see #28). The remaining test targets passed. Developed with AI assistance.
upstream-sync closed this pull request 2026-11-24 06:51:08 +00:00
DaviTostes commented 2026-11-24 06:54:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:05:37Z.


Tested fc807b6 stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass (no regression only).

  • cargo test --workspace: 155 passed, 0 failed, 3 ignored; the merge with #39 is clean.
  • Scope note: the diff is crates/victory-formats/src/texture.rs only and adds no test, so this run shows the layout conversion still passes its existing cases; it does not measure the row-run reuse itself. A synthetic case whose rows contain both contiguous runs and single pixels would pin the reuse (and the odd-width/tail case).
  • No game data used.

AI-assisted (DeepSeek V4.1 Flash coding agent).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117694485 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/60#issuecomment-7117694485). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:05:37Z. --- Tested `fc807b6` stacked on **#39** on **Arch Linux x86_64, rustc 1.98.1**: **pass (no regression only)**. - `cargo test --workspace`: **155 passed, 0 failed, 3 ignored**; the merge with #39 is clean. - Scope note: the diff is `crates/victory-formats/src/texture.rs` only and adds no test, so this run shows the layout conversion still passes its existing cases; it does not measure the row-run reuse itself. A synthetic case whose rows contain both contiguous runs and single pixels would pin the reuse (and the odd-width/tail case). - No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
lordon1a commented 2026-11-24 06:54:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:17:27Z.


Verified fc807b6e7 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass.

  • cargo xtask policy: 150 files ok
  • cargo test -p victory-formats: 17 passed, 0 failed, 3 ignored (including texture::tests::addresses_are_a_bijection_and_copies_round_trip with the tightened active/padding slice assertions).

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117911649 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/60#issuecomment-7117911649). Originally posted by [lordon1a](https://github.com/lordon1a) on 2026-11-24T00:17:27Z. --- Verified `fc807b6e7` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass**. - `cargo xtask policy`: 150 files ok - `cargo test -p victory-formats`: **17 passed, 0 failed, 3 ignored** (including `texture::tests::addresses_are_a_bijection_and_copies_round_trip` with the tightened active/padding slice assertions). AI-assisted.
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!60
No description provided.