upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/bcpack.cpp
diff options
context:
space:
mode:
authorbobcatchris <83428450+bobcatchris@users.noreply.github.com>2026-11-30 06:01:21 -0600
committerbobcatchris <83428450+bobcatchris@users.noreply.github.com>2026-11-30 06:01:21 -0600
commitf536b3d508d8a47ed58f6838f0a34a2657fb21cd (patch)
tree3cc6874d93cc7cf1df0f53d3560ce6359791f159 /runtime/src/bcpack.cpp
parentd367675c705c758f731ae9eb603839a4ebb2283c (diff)
leonida-formats: eight-byte-wide BC1/BC3/BC4/BC5 block post-processing (D3D12-FORMATS-BCN-POST-SWAR)
After the rANS lanes the plain formats' block loop did its arithmetic a byte at a time: a per-element wrapping add and width mask for each of 8 endpoints and 32 indices, 16 scattered byte stores per quad/pair residual, a table lookup and shift per index to build the BC1/BC4 code words, and two 4-step folds per interleave(). - Widths holds the masks of the elements' bits (a word for the endpoints, four for the indices); endpoints and indices are summed with their references eight bytes at a time (top bits added apart for the 8-bit endpoints, masked sums for the at most 7-bit indices). - quads() takes a 256-entry const table and fills the four 4-pixel rows as words; pairs() builds eight pixels at a time. - BC1 and BC4 index codes are computed for eight indices at once (bc1_codes, bc4_codes) and packed by shifts (pack2, pack3). - interleave() reads a 16-entry const table. Output is unchanged: a copy of the previous loop is kept in the tests as the reference, and plain_blocks_match_the_reference compares the two byte for byte for BC1, 3, 4 and 5 on the shipped tables and on tables whose ranks and dictionaries hold any byte (history wrapping). index_codes_are_the_tables and index_codes_pack_by_position check the new code words and packers against the code tables for every byte. AI-assisted: Claude Sonnet 5.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'runtime/src/bcpack.cpp')
0 files changed, 0 insertions, 0 deletions