Compress (ID3D11Device, const Image, size_t, const TexMetadata&, DXGI_FORMAT, ScratchImage&)

Compresses one or more images to a block compression (BC) format, for the specified device, using DirectCompute.

Syntax

HRESULT Compress(
         ID3D11Device *pDevice,
         const Image *srcImages,
         size_t nimages,
         const TexMetadata &metadata,
         DXGI_FORMAT format,
         ScratchImage &cImages
)  

Parameters

pDevice
Type: ID3D11Device *

[in] The device, as a pointer to an ID3D11Device. Must be a Direct3D 11 device with Feature Level 10.0 or greater that supports DirectCompute.

srcImages
Type: Image *

[in] Pointer to one or more Image structures in a memory buffer.

nimages
Type: size_t 

[in] The number of images.

metadata
Type: TexMetadata 

[in] The metadata, as the address of a TexMetadata structure.

format
Type: DXGI_FORMAT 

[in] One member of the DXGI_FORMAT enumeration. This is a DirectCompute-based overload of Compress, so only the following enumeration constants are supported:

cImages
Type: ScratchImage 

[out] Pointer to a ScratchImage class instance.

Return value

Type: HRESULT 

Success or error code.

Remarks

Performs BC6H/BC7 Compression using DirectCompute 4, based on the implementation in the BC6HBC7EncoderCS sample.

Requirements

Header: Declared in directxtex.h.