Compress (ID3D11Device*, const Image&, 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 &srcImage,
         DXGI_FORMAT format,
         ScratchImage &image
)  

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.

srcImage
Type: Image 

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

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:

image
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.