demo · v139
Texture Compression Benchmark
Probe every BC and ASTC format supported by your GPU, then time how long it takes to create and upload a 256×256×16 3D texture in each format. Compression ratios vs uncompressed RGBA8 are calculated from format block sizes.
WebGPU required. If unavailable, a static reference table with typical desktop GPU numbers is shown below instead.
Click "Probe GPU adapter" to begin.
| format group | block (px) | bits/px | 3D (sliced) — v139 | typical use |
|---|---|---|---|---|
| probe not run yet | ||||
benchmark results
Each supported format: 256×256×16 3D texture created and written with a placeholder buffer. Times measured with performance.now().
—
—
run benchmark
the code
const adapter = await navigator.gpu.requestAdapter();
// Probe 3D compressed format support (new in Chrome 139)
const hasBC3D = adapter.features.has('texture-compression-bc-sliced-3d');
const hasASTC3D = adapter.features.has('texture-compression-astc-sliced-3d');
const device = await adapter.requestDevice({
requiredFeatures: [
...(hasBC3D ? ['texture-compression-bc-sliced-3d'] : []),
...(hasASTC3D ? ['texture-compression-astc-sliced-3d'] : []),
],
});
// Create a 256×256×16 BC1 3D texture (compressed)
const t0 = performance.now();
const tex = device.createTexture({
size: [256, 256, 16],
format: 'bc1-rgba-unorm',
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST,
dimension: '3d',
});
console.log('create:', performance.now() - t0, 'ms');
// Upload a layer
const blockBytes = 8; // BC1 = 8 bytes per 4×4 block
const bytesPerRow = (256 / 4) * blockBytes;
device.queue.writeTexture(
{ texture: tex, origin: [0, 0, 0] },
new Uint8Array(bytesPerRow * (256 / 4) * 16),
{ bytesPerRow, rowsPerImage: 256 / 4 },
[256, 256, 16],
);