What it costs

Measured against the BCn blocks decoded, which is what a GPU without BCn showed before, on three 512x512 photographs and two 256x256 icons with alpha, made BCn by the test's own encoders and the BC7 one (snx-test-bcn-etc2-glsl --image):

BCncolour, dBalpha, dBlost against the original picture, past what BCn lost
BC136.9 to 49.1exact0.1 to 1.4 dB
BC2, BC337.2 to 49.150.0 to 58.60.7 to 3.0 dB
BC4, BC546.5 to 63.6
BC735.8 to 48.450.2 to 53.55.5 to 11 dB

BC7 loses most: ETC2 RGBA8 holds less than BC7's partitions and 4 bit weights do, which is why BC2, BC3 and BC7 go to ASTC 4x4 where the GPU samples it (As ASTC).

Time, snx-test-astc-vulkan --bench-etc2 on a GT 1030 (the build with packed dot products), a 2048x2048 level, the dispatch alone, encoded again as ETC2 or EAC, before and after the steps of What a texel costs:

Blocksbeforenow
random BC1199 ms76 ms
random BC3178 ms82 ms
random BC455 ms11 ms
random BC5119 ms22 ms
random BC7192 ms90 ms
a Kodak crop made BC7 (--bench-etc2 FILE.rgba, 512x512 repeated)85 to 106 ms57 ms

The same picture's blocks encoded again as ASTC 4x4 take 5 ms: most of them are moved, not searched for. Random blocks take every candidate; a game's blocks of one colour or one alpha stop earlier. On llvmpipe, before these steps: BC1 105 ms, BC3 95, BC4 35, BC5 65, BC7 117. The pipeline is compiled the first time a BCn texture loads (1.3 s on the GT 1030), and kept in the pipeline cache.


Made from docs/layers/gpu/bcn.md at 69237645142c. GPL-3.0-or-later.