Microsoft DirectX 8.0 (C++)

Decompressing Compressed Textures

As with compressing a texture surface, decompressing a compressed texture is performed through Microsoft® Direct3D® copying services.

If the driver supports the creation of compressed video-memory surfaces, then the driver can also decompress copies from a compressed video-memory surface to an uncompressed video- or system-memory surface.

Copies from compressed system-memory surfaces to uncompressed video-memory surfaces are largely unsupported and should not be attempted, even when the driver supports compressed textures. This does not mean that it is impossible to decompress a compressed system-memory surface and move its contents into a video-memory surface; it merely requires an additional step.

To decompress a system-memory surface into video memory

  1. Create an uncompressed, off-screen plain surface in system memory of the desired dimensions and pixel format.
  2. Copy from the compressed system-memory surface to the uncompressed system-memory surface.
  3. Copy the uncompressed surface to the uncompressed video-memory surface.