Adaptive Scalable Texture Compression

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Adaptive Scalable Texture Compression (ASTC) provides developers with greater control over the size verses quality tradeoff with textures. ASTC is a lossy format, but one that is designed to provide an inexpensive route to greater quality textures. The idea is that a developer can choose the optimum format without having to support multiple compression schemes.

Note  ASTC functionality is not available in the current release of the SDK.

  • Overview
  • API support for ASTC
  • Related topics

Overview

Using ASTC a texture is divided into blocks, where the block size can be one of the following (width in pixels x height in pixels):

  • 4 x 4
  • 5 x 4
  • 5 x 5
  • 6 x 5
  • 6 x 6
  • 8 x 5
  • 8 x 6
  • 10 x 5
  • 10 x 6
  • 8 x 8
  • 10 x 8
  • 10 x 10
  • 12 x 10
  • 12 x 12

The list is shown in decreasing order of memory footprint. The smaller the size of the blocks by which a texture is divided, the higher the quality of the resulting compressed image, and the greater the storage requirement for it. Setting a block size of 4 x 4 will give the highest quality, and 12 x 12 has the greatest compression.

Each encoded block has a fixed memory footprint of 16 bytes (128 bits), representing varying numbers of texels. Decoding one texel requires only the data from the single block, reducing bandwidth and improving encoding and decoding.

The following images show how an input image would be compressed using the 12 pixel width x 10 pixel height compression format. The yellow numbers show the block indexes. In Direct3D 12, the block that contains the data for the top left is the first block in the reference data, index 0. The blocks progress in raster order, moving scan line by scan line from the top left to the bottom right. Other ASTC implementations may not follow the top-left rule.

The source image, a 128 x 128 RGB texture:

Dn903790.astc_chocolate(en-us,VS.85).png

The ASTC blocks; each 12 by 10 pixels (or parts at the end of each row and column):

Dn903790.chocolate_astc_12x10(en-us,VS.85).png

ASTC does not apply to 1D textures. 3D textures are compressed as an array of 2D textures, similar to other Direct3D texture compression systems. ASTC textures can only be shader resources, never render targets. Typically, most ASTC textures will be pre-computed and stored as ASTC resources.

API support for ASTC

A range of formats is available in the DXGI_FORMAT enumeration to support ASTC. Each of the block sizes in the preceding list has three associated format definitions, for example:

  • DXGI_FORMAT_ASTC_4X4_TYPELESS : the typeless format follows the same runtime conventions as any other typeless format, which allows for multiple, different resource views to be created on a single texture. Valid typeless view creations are confined to only formats that share the same block dimensions (for example, 4x4_TYPELESS to 4X4_UNORM and not 5X4_UNORM).
  • DXGI_FORMAT_ASTC_4X4_UNORM : The UNORM formats represent a linear decoding mode. This decoding mode uses the error color magenta (1.0, 0.0, 1.0, 1.0) when a non-valid ASTC block is decoded.
  • DXGI_FORMAT_ASTC_4X4_UNORM_SRGB : The UNORM_SRGB formats represent an SRGB decoding mode. This decoding mode also uses the error color magenta when a non-valid ASTC block is decoded.

If resource tiling is used, then each ASTC tile is 64 x 64 blocks.

The following table shows the tile width and height in pixels for each block size, along with the bits per texel and the percentage increase in memory footprint over the next smallest size.

Block Width Block Height Tile Width in Pixels Tile Height in Pixels Bits per texel Size increase
4 4 256 256 8 25%
5 4 320 256 6.4 25%
5 5 320 320 5.12 20%
6 5 384 320 4.27 20%
6 6 384 384 3.56 14%
8 5 512 320 3.2 20%
8 6 512 384 2.67 5%
10 5 640 320 2.56 20%
10 6 640 384 2.13 7%
8 8 512 512 2 25%
10 8 640 512 1.6 25%
10 10 640 640 1.28 20%
12 10 768 640 1.07 20%
12 12 768 768 0.89 ~

 

The following enum references ASTC support:

The following methods could be used with ASTC textures:

ASTC formats support copying to R32G32B32A32 formats, similar to BC7 support (where block compressed formats may be the source resource if a R32G32B32A32 format is the destination). This operation is accessed through the CopyResource method.

ASTC formats are marked as shareable: the D3D11_FORMAT_SUPPORT2_SHAREABLE flag is set when the CheckFeatureSupport method is called. If ASTC is supported the runtime will treat all ASTC textures as shareable.

Resource Binding