vulkan_headless (tests/vulkan_astc_later.inc) holds the BC7 images made between frames to the CPU encoder's
blocks over the RGBA8 texels the texture showed first, byte for byte: a 1024x768 texture in three frames of 32768,
32768 and 3 blocks, the RGBA8 image freed after them; a 2D array of sides on no block in one frame and one encode
for its 7 levels, written whole after and made BC7 again from the new texels; the 9 levels of a 256x256 texture in
one encode with the barriers (vk_astc_barriers) of one strip of a level, where an encode a level took 9 times
them; a texture written between its two frames,
started over; an array of 40 layers and a 3D texture of 40 slices, cut between two frames; pieces of a BC7 one,
straight to BC7 for a block and whole as RGBA8 for 55296 blocks; a texture written 3 frames after its write before
queued, 2 after held Exact out of the queue, and queued again once read 30 frames unwritten, not 29; pieces of a BC7
one, straight to BC7 3 frames after its write before and whole as RGBA8, held Exact, the next frame; and a texture
freed while it is made. It also times the encoder: a 1024x1024 texture held as BC7 at load adds its first level,
one dispatch of a megatexel, to the sums once its submission is done, where the queue writes timestamps, and its
smaller levels nothing; and it follows Auto: a texture loads RGBA8 with room, a trim under a budget lowered to the
caches' use turns the next one BC7 and opens the game's BC7 cache, and the budget back turns the third RGBA8 again.
astc_bc_suggest (ctest, no GPU) holds the modes and Auto with budgets given: BC7 from a trim, Exact again only
past the band, a trim never bringing it back by itself over a grid of uses and frees, one switch over 200 trims of a
sawtooth where no band makes 399, and the size from the times given (the start until as many texels are timed, five
times faster five times bigger, sums of unlike costs).
astc_vulkan and astc_vulkan_pieces also upload very large levels (astc_quick_mtexels=1 there, a megatexel):
bands of block rows of 4x4 and 6x6 blocks (whose bands step 3 rows) and pieces of several layers, once with the
background on the CPU and once on the GPU. The first upload's image is the quick build of the CPU decoder's texels,
byte for byte, and the level goes to the background; once it is done (vk_astc_background_drain), the next upload
copies the pieces, which are the fast build of the whole level byte for byte:
the CPU's and the GPU's pieces are the same. A hit out of time (g_vk_astc_hit_ns 0) encodes quickly and loads the
pieces into the image after it. An image kept alive while the background runs ends up with the fast build too, from
the pieces it copied into it. On the GPU, a background stopped after one piece leaves it in the cache, and the next
makes only the others. These cases keep the setting's size (vk_astc_quick_measure(0)). Then a 1536x768 level
with the quick encode off adds its one dispatch of the fast build to the sums; with 2 megatexels the start, another
takes the fast build while the setting's size holds, and the quick build once times of a GPU twice as slow as the
890M make the size a megatexel, its quick strip and its background's pieces adding nothing to the sums.
The CPU decoder was also compared with ARM's astcenc 5.7.0 (astcenc -dl and -dH, Apache-2.0, a release binary
used only as a tool), on the same kind of random blocks for every footprint. Every texel agreed within one step of
rounding (astcenc's 8 bit output rounds differently), and every block one rejects the other rejects too. In the LDR
profile astcenc also rejects HDR endpoint modes, which this decoder decoded then. After HDR endpoints became the
error color, the CPU decoder was compared with Amberlith's LDR profile reference decoder (source/astcref.c, held
to astcenc by Amberlith's reference suite) on 20,000 random blocks for each of the 14 footprints: every texel was
one of the two bytes the reference allows, error blocks included. The sRGB decode mode was checked
the same way against astcenc -cs and -ds on five footprints: every byte agreed, alpha included.
Made from docs/layers/gpu/astc.md at 69237645142c. GPL-3.0-or-later.