Table of contents
GDI
TOC
Collapse the table of content
Expand the table of content

Reporting Support for 2D Operations Using Surface Formats

Last Updated: 2/14/2017

The driver specifies flags in the dwOperations member of the DDPIXELFORMAT structure for a surface's format to indicate that it can perform 2D operations using that format.

For example, the driver can indicate that it can copy to or from and color fill to a surface by setting the D3DFORMAT_OP_OFFSCREENPLAIN flag.

When the driver uses vendor-supplied codes or codes from the D3DFORMAT enumerated type to set the dwFourCC member of DDPIXELFORMAT and assign the format for a surface, the driver can also use the D3DFORMAT_OP_CONVERT_TO_ARGB and D3DFORMAT_MEMBEROFGROUP_ARGB flags to indicate whether color conversion can be performed between source and target surfaces. That is, a target surface that has the D3DFORMAT_MEMBEROFGROUP_ARGB flag set indicates that its color format can be converted from any source surface that has the D3DFORMAT_OP_CONVERT_TO_ARGB flag set.

The driver can only specify the D3DFORMAT_MEMBEROFGROUP_ARGB flag for target surface formats with at least 5 bits of color information per channel. That is, the D3DFMT_A1R5G5B5 format set in the dwFourCC member of DDPIXELFORMAT is valid. However, the D3DFMT_A4R4G4B4 format is invalid. The driver is also constrained to certain source surface formats when specifying the D3DFORMAT_OP_CONVERT_TO_ARGB flag. Source formats can be any format that is valid for the D3DFORMAT_MEMBEROFGROUP_ARGB flag or a FOURCC surface format.

Note that although D3DFORMAT_OP_CONVERT_TO_ARGB and D3DFORMAT_MEMBEROFGROUP_ARGB indicate ARGB formats, the runtime also lets the driver specify surfaces with XRGB formats (for example, D3DFMT_X1R5G5B5). If the driver specifies D3DFORMAT_MEMBEROFGROUP_ARGB or D3DFORMAT_OP_CONVERT_TO_ARGB with an invalid format, the runtime prevents the Direct3D HAL from loading.

Send comments about this topic to Microsoft

© 2017 Microsoft