Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method reports the device's ability to render the current texture-blending operations and arguments in a single pass.

Syntax

HRESULT ValidateDevice(
  DWORD* 
pNumPasses
);

Parameters

pNumPasses

[out] Pointer to a DWORDvalue to fill with the number of rendering passes needed to complete the desired effect through multipass rendering.

Some drivers will break down complex texture cascades into multiple passes. In these cases, *pNumPasseswill contain the number of passes. Other drivers will fail texture cascades that they cannot render in one pass. In these cases, * pNumPasseswill always be 1 for any supported texture cascade.

Return Value

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be one of the following D3DMERR Values.

  • D3DMERR_CONFLICTINGTEXTUREFILTER

  • D3DMERR_CONFLICTINGTEXTUREPALETTE

  • D3DMERR_TOOMANYOPERATIONS

  • D3DMERR_UNSUPPORTEDALPHAARG

  • D3DMERR_UNSUPPORTEDALPHAOPERATION

  • D3DMERR_UNSUPPORTEDCOLORARG

  • D3DMERR_UNSUPPORTEDCOLOROPERATION

  • D3DMERR_UNSUPPORTEDFACTORVALUE

  • D3DMERR_UNSUPPORTEDTEXTUREFILTER

  • D3DMERR_WRONGTEXTUREFORMAT

Remarks

The IDirect3DMobileDevice::ValidateDevicemethod should be used to validate scenarios only when other capabilities are deficient. For example, in a multistage texturing scenario, you could query the MaxTextureBlendStagesand MaxSimultaneousTexturesmembers of a D3DMCAPSstructure to determine if multistage texturing is possible on the device.

Current hardware does not necessarily implement all possible combinations of operations and arguments. You can determine whether a particular blending operation can be performed with given arguments by setting the desired blending operation and then calling the IDirect3DMobileDevice::ValidateDevicemethod.

The IDirect3DMobileDevice::ValidateDevicemethod uses the current render states, textures, and texture-stage states to perform validation at the time of the call. Changes to these factors after the call invalidate the previous result and the method must be called again before rendering a scene.

Using diffuse iterated values, such as D3DMTA_DIFFUSE (see D3DMTA Values) or D3DTOP_BLENDDIFFUSEALPHA (see D3DMTEXTUREOP0), either as an argument or as an operation is rarely supported on current hardware. Most hardware can introduce iterated color data only at the last texture operation stage.

Try to specify the texture (D3DTA_TEXTURE) for each stage as the first argument, rather than the second argument.

Many cards do not support use of diffuse or scalar values at arbitrary texture stages. Often, these are available only at the first or last texture-blending stage.

Many cards do not have a blending unit associated with the first texture that is capable of more than replicating alpha to color channels or inverting the input. Therefore, your application might need to use only the second texture stage, if possible. On such hardware, the first unit is presumed to be in its default state, which has the first color argument set to D3DTA_TEXTURE with the D3DTOP_SELECTARG1 operation.

Operations on the output alpha that are more intricate than, or substantially different from, the color operations are less likely to be supported.

Some hardware does not support simultaneous use of D3DTA_TFACTOR and D3DTA_DIFFUSE.

Many cards do not support simultaneous use of multiple textures and mipmapped tri-linear filtering. If tri-linear filtering has been requested for a texture involved in multitexture blending operations and validation fails, turn off tri-linear filtering and revalidate. In this case, you might want to perform multipass rendering instead.

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also