Previous Next

Texturing Requirements

This section lists requirements for texture sizes and texture filtering. There are also texture-related requirements for the IDirect3DDevice7::ValidateDevice method.

Texture Sizes

The following are requirements for texture sizes:

  1. The driver must expose its minimum and maximum texture dimensions through the dwMinTextureWidth, dwMinTextureHeight, dwMaxTextureWidth, and dwMaxTextureHeight members of the D3DDEVICEDESC7 structure. This structure is defined in the Direct3D SDK documentation.
  2. If the hardware has an aspect ratio restriction on its textures, that ratio must be present in the dwMaxTextureAspectRatio member of the D3DDEVICEDESC7 structure.
  3. If the device supports only texture dimensions that are powers of two, then it must set the dwTextureCaps member of the D3DPRIMCAPS structure to contain the D3DPTEXTURECAPS_POW2 flag for the appropriate primitive type (line or triangle).
  4. If the device can support two-dimensional (2D) textures (that is, not volume or cube textures) of an arbitrary size when the texture addressing mode for the texture stage is set to D3DTADDRESS_CLAMP, the texture wrapping for the texture stage is disabled (D3DRENDERSTATE_WRAPn set to 0), and MIP mapping is not in use, then it must set the D3DPTEXTURECAPS_NONPOW2CONDITIONAL flag.
  5. If the device only supports textures whose dimensions are equal, then it must set the dwTextureCaps member of the D3DPRIMCAPS structure to contain the D3DPTEXTURECAPS_SQUAREONLY flag for the appropriate primitive type (line or triangle).

If the device supports textures of an arbitrary size without restrictions other than those described in the first and second requirements, then it must not set any of the flags described in the third, fourth, and fifth requirements.

Texture Filtering

Filters that magnify and minify textures must be enabled and disabled through the D3DTSS_MAGFILTER and D3DTSS_MINFILTER texture stage states. This filtering must not be performed automatically when these states are disabled. For more information about the D3DTSS_Xxx texture stage states, see the D3DTEXTURESTAGESTATETYPE enumerated type in the Direct3D SDK documentation.

Texture MIP mapping must be enabled and disabled through the D3DTSS_MIPFILTER texture stage state. If this state is disabled, but the texture was created as a MIP map, the device must use only the top level of the MIP map. MIP mapped filtering must not be performed when this state is disabled.

If the device supports anisotropic filtering, the maximum anisotropy level must be exported through the value of the dwMaxAnisotropy member of the D3DDEVICEDESC7 structure (defined in the Direct3D SDK documentation). Furthermore, the device must accept any setting from 1 through dwMaxAnisotropy in the D3DTSS_MAXANISOTROPY texture stage state.

The device must be able to apply all supported filter modes to textures of any supported format. For example, if MIP mapping is supported with other texture formats, MIP map filtering of YUV textures should be able to be performed.

Note  DirectX 9.0 and later applications can use values in the D3DSAMPLERSTATETYPE enumeration to control the characteristics of sampler texture-related render states. In DirectX 8.0 and earlier, these sampler states were included in the D3DTEXTURESTAGESTATETYPE enumeration. The runtime maps user-mode sampler states (D3DSAMP_Xxx) to kernel-mode D3DTSS_Xxx values so that drivers are not required to process user-mode sampler states. For more information on D3DSAMPLERSTATETYPE, see the latest DirectX SDK documentation.

IDirect3DDevice7::ValidateDevice

If a device supports a particular combination of texture stage state blending operations and operands in a single pass, then the device must return DD_OK from a call to the IDirect3DDevice7::ValidateDevice method (described in the Direct3D SDK documentation) for each such combination.

If a device does not support a particular combination of texture stage state blending operations in a single pass, or does not support one or more of the blending operations or operands, then it must return one of the error codes allowable for the IDirect3DDevice7::ValidateDevice method. Invalid blending operations cannot silently fail the IDirect3DDevice7::ValidateDevice method.