aboutsummaryrefslogtreecommitdiff
path: root/src/common/zstd_compression.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-31 18:56:53 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-31 18:56:53 -0400
commit8266a6a91b7a9aed8ec197676d9c346451eb53cd (patch)
treec614ab70fb8eb12b18747300ffe0de7acf25e2f1 /src/common/zstd_compression.cpp
parent9dca3ab2e436e786ab53e862e4d515f620a11669 (diff)
textures: ASTC opaque scan from a table of block modes
Choosing BC1 or BC3 for an ASTC texture re-compressed on the GPU scans every block of it for an alpha endpoint mode when the image is made, on the GPU thread. Each block's mode was decoded bit by bit (DecodeBlockInfo): 224 us per new ASTC texture on Mario Kart World's title screen, which streams textures in by the thousand, and ~10% of the time in its frames over 100 ms. DecodeBlockInfo reads nothing but a block's 11 mode bits, so its result for all 2048 of them is worked out once; the scan takes the partition count and endpoint modes straight from the block's first word. Same answer as before for all 2^29 values of the bits the scan reads (random data in the rest, 538M blocks). A 4 MiB opaque texture scans in 1.6 ms instead of 12 ms; the title screen's new ASTC textures in 37 us each instead of 224.
Diffstat (limited to 'src/common/zstd_compression.cpp')
0 files changed, 0 insertions, 0 deletions