Microsoft DirectX 8.0 (Visual Basic)

Determining Pixel Shader Support

You can query members of D3DCAPS8 to determine the level of support for operations involving pixel shaders. The following table lists the device capabilities related to programmable pixel processing in Microsoft® DirectX® 8.0.

Device capability Description
MaxPixelShaderValue Maximum value of pixel shader arithmetic component.
MaxSimultaneousTextures Number of texture declaration instructions supported.
MaxTextureBlendStages Number of instructions supported.
PixelShaderVersion Level of support for pixel shaders.

The MaxSimultaneousTextures and MaxTextureBlendStages capabilities only apply to fixed-function pixel blending(using multi-texture).

The PixelShaderVersion capability indicates the level of pixel shader supported. Only pixel shaders with version numbers equal to or less than this value will be successfully created when calling the method Direct3DDevice8.CreatePixelShader. The major version number is encoded in the second byte of PixelShaderVersion. The low byte contains a minor version number. The pixel shader version is indicated by the first token in each shader.

Pixel shader applications do not need to check the MaxSimultaneousTextures and MaxTextureBlendStages device capabilities.

Each implementation sets the PixelShaderVersion member to indicate the maximum pixel shader version that it can fully support. This implies that implementations should never fail the creation of a valid shader of the version less than or equal to the version reported by PixelShaderVersion.

The following table summarizes the supported pixel shader versions and the associated level of functionality and register counts.

Version Functionality tn rn cn vn
1.0 DirectX 8.0 4 2 8 2
1.1 DirectX 8.0 4 2 8 2

Version 1.0 supports all the operations documented in the Instructions reference topic for pixel shaders. A maximum of four texture address operations and a total of eight instructions are supported. In this version the texture registers tn are read-only, and only one can be used in a given instruction.

Version 1.1 supports instructions, with limits of four address operations and eight blending operations. In this version the texture registers are read/write, and two can be used as inputs in a single instruction.