Commit Graph

13 Commits

Author SHA1 Message Date
e61aadda9f swizzle_search, tex_mode_probe: say numpy is missing in one line, as tile_probe does 2026-11-24 16:11:23 +01:00
90f3524ee4 tests: skip test_tex_mode_probe when numpy is unavailable 2026-11-23 00:25:41 +02:00
59fae18000 Merge pull request #3075 from Marco Luzzaro 2026-11-22 15:14:36 -05:00
b46397dba9 Merge pull request #2996 from Vonsek 2026-11-22 15:13:54 -05:00
c9fc49c57e tex_mode_probe: report invalid texture indexes cleanly 2026-11-22 20:17:15 +01:00
ba8e78b2f6 fix(assets): report distinct texture probe placements
A single-mip texture puts the first and last candidates at the same offset. The duplicate was displayed as a second candidate, obscuring the distinction between actual alternatives.
2026-11-22 20:03:40 +01:00
2066459c82 fix(tools): size probed texture mips by their full tile grid
Rounding the linear byte count can undercount partially occupied tiles on both axes. Use the same tile shape for mip sizes and swizzled offsets.
2026-11-22 17:54:41 +01:00
9c6708dac5 test(tools): add unit tests for tex_mode_probe tiling mode detection 2026-11-22 16:16:49 +01:00
41c57974ba tex_mode_probe: read the whole GPU blob chain, and count skipped textures
The probe opened only the first carved file of a texture's GPU blob (`t["gpu"]`) and ignored
`gpu_chain`, which tex_export.py joins. A texture whose data runs into a later part fit no
candidate and was dropped from the ranking without a line. gpu_blob() now reads every part in
order, as tex_export does; a texture that still fits no candidate prints a "skipped" line, and the
run ends with "probed N of M textures; K skipped".

Real data (counts only), my 1.0.2.1 texture index, all textures of 256 px or more:
- BC1: main ranks 33 of 42 (23 of the 42 have a multi-part chain); this change ranks 42 of 42.
  The 9 added winners are 4K_S last x6, 4K_S first x2, 4K_S3 first x1.
- BC3: main 65 of 66, now 66 of 66.
Every row main printed is unchanged (33/33, 65/65).

Tests: test_probe_reports_available_candidates gains blobs split over 2 and 3 carved files
(main: no candidate, the texture vanishes); the expected output of the existing cases now ends
with the probed/skipped total.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:29:39 -03:00
81a07034da Fix tex_mode_probe reporting with a single candidate
Show 2nd n/a when only one layout/placement fits, and cover zero,
one, and two viable candidates with synthetic buffers.

AI-assisted (Codex).
Claim: https://github.com/ItsNotRexed/Leonida/issues/634#issuecomment-7073565207
2026-11-22 11:30:58 +08:00
0a36334401 tex_mode_probe.py: --n must be at least 1
--n was a plain int used as texs[: a.n]: --n 0 probed nothing and
printed "winners: []" as if it had run, and a negative --n silently
dropped the last textures. --n is now a positive whole number, an
argparse error otherwise, before the addrlib tables are loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:12:43 +01:00
d74b25bf4c tex_mode_probe: document and test format prefix filtering 2026-11-22 00:48:17 +01:00
286f365cc3 tex_mode_probe.py: reject formats without a supported color scorer 2026-11-22 00:20:29 +01:00