Home -> ITextureBuffer -> SetTextureFormat

Description

The SetTextureFormat method specifies the hardware image format and data format requested for a texture allocation. The image format describes the component layout, while the data format describes how each component or compressed block is encoded.

The requested format controls how the texture may be sampled, bound as a framebuffer attachment, used as a depth or stencil target, and populated from CPU source data. Applications can query basic device support for a format pair with IsTextureFormatSupported.

ImportantImportant

This method must be called before AllocateMemory. After allocation, the actual created format can be queried with AllocatedImageFormat and AllocatedDataFormat.

Usage

void SetTextureFormat(ImageFormat imageFormat, DataFormat dataFormat);

Argument list

imageFormat [ImageFormat]
The component layout and broad interpretation requested for the texture.
dataFormat [DataFormat]
The hardware data encoding requested for the texture.

See also