textures: reject invalid BC7 mode and negative partition indices #560
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/566"
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 R0Y00/Xbox2Windows. Originally posted by Neoplayer on 2026-11-22T12:47:23Z.
Change
Reject negative, boolean, and out-of-range
modeorpartitionarguments intools/bc7_blocks.py(subsets,anchors,layout,pack,fixture_fields) via_mode_entry()and_check_partition(). Previouslysubsets(1, -1)silently indexedPARTITIONS_2[-1](partition 63) andlayout(-1)indexedMODES[-1]before failing withAssertionErroronassert offset == 128. Adds negative controls intests/bc7_blocks_check.py.Verification
d3586ddarm64), Python 3.12.13 (out/pe-env)./out/pe-env/bin/python -B tests/bc7_blocks_check.py->Ran 10 tests in 0.125s,OK (skipped=2)(the 2 skips are optionalBCPACK_REFERENCE_TOOLSandtexture2ddecoder)./out/pe-env/bin/python -B tests/bcpack_check.py->Ran 8 tests in 0.074s,OK./out/pe-env/bin/python -B tests/bc7_tiles_check.py->Ran 6 tests in 0.008s,OK./out/pe-env/bin/python -B tests/bidi_controls_check.py->Self-test passed. Checked 549 tracked source, script and build/CI files: no bidirectional controls.git diff --check-> exit 0bc7_draw_*) require x64 Windows and are deferred to CI (build-and-test).Evidence and follow-up
All new negative controls in
tests/bc7_blocks_check.pyare pure-Python unit assertions overtools/bc7_blocks.pywith no external inputs or game assets.Checklist
AI-assisted.