Texture: reuse contiguous column runs across rows #60

Manually merged
github merged 1 commit from gh-pr/60/head into gh-pr/60/base 2026-11-26 03:48:48 +00:00
Owner

@⁠ifBars on GitHub · 2026-11-24 00:00 UTC · original
ifBars:perf/reuse-texture-row-spans → main · +46 −51 · 1 files · 1 commits · merged 2026-11-24 00:41 UTC

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.

**@⁠ifBars** on GitHub · 2026-11-24 00:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/60) `ifBars:perf/reuse-texture-row-spans` → `main` · +46 −51 · 1 files · 1 commits · merged 2026-11-24 00:41 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:47 +00:00
github manually merged commit fc807b6e76 into gh-pr/60/base 2026-11-26 03:48:48 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:05 UTC · original

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).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/60#issuecomment-7117694485) 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).
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:17 UTC · original

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.

**@⁠lordon1a** on GitHub · 2026-11-24 00:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/60#issuecomment-7117911649) 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.
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/Marvisak--VIctory!60
No description provided.