Reporting Capabilities for Shader 3 Support

The DirectX 9.0 version driver for a display device that supports pixel or vertex shader version 3.0 and later must indicate that it supports the following capabilities:

Vertex shader 3.0 and later

If a device supports vertex shader 3.0 and later, its driver must set the members of the D3DCAPS9 structure to the following values:

VS20Caps
Set the following members of the D3DVSHADERCAPS2_0 structure:

DynamicFlowControlDepth set to 24.

NumTemps set to 32.

StaticFlowControlDepth set to 4.

Caps set to the D3DVS20CAPS_PREDICATION bit to indicate that predication is supported.

GuardBandLeft, GuardBandTop, GuardBandRight, GuardBandBottom
Set each to 8K.

VertexShaderVersion
Set to 3.0.

MaxVertexShaderConst
Set to 256.

MaxVertexShader30InstructionSlots
Set to 512.

RasterCaps
Set the D3DPRASTERCAPS_FOGVERTEX bit for fog support.

VertexTextureFilterCaps
Set the following filter capabilities:

D3DPTFILTERCAPS_MINFPOINT

D3DPTFILTERCAPS_MAGFPOINT

DevCaps2
Set the D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET bit to indicate that vertex elements in a vertex declaration can share the same stream offset.

DeclTypes
Set the following bits to indicate the vertex data types supported by the device:

D3DDTCAPS_UBYTE4

D3DDTCAPS_UBYTE4N

D3DDTCAPS_SHORT2N

D3DDTCAPS_SHORT4N

D3DDTCAPS_FLOAT16

D3DDTCAPS_FLOAT16

Pixel shader 3.0 and later

If a device supports pixel shader 3.0 and later, its driver must set the members of the D3DCAPS9 structure to the following values:

PS20Caps
Set the following members of the D3DPSHADERCAPS2_0 structure:

DynamicFlowControlDepth set to 24.

NumTemps set to 32.

StaticFlowControlDepth set to 4.

NumInstructionSlots set to 512.

Caps set to the following bits:

D3DPS20CAPS_ARBITRARYSWIZZLE to indicate that arbitrary swizzles is supported.

D3DPS20CAPS_GRADIENTINSTRUCTIONS to indicate that gradient instructions is supported.

D3DPS20CAPS_PREDICATION to indicate that predication is supported.

D3DPS20CAPS_NODEPENDENTREADLIMIT to indicate no dependent read limit.

D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT to indicate no limit on the mix of texture and math instructions.

MaxTextureWidth, MaxTextureHeight
Set each to 4K.

MaxTextureRepeat
Set to 8K.

MaxAnisotropy
Set to 16.

PixelShaderVersion
Set to 3.0.

MaxPixelShader30InstructionSlots
Set to 512.

PrimitiveMiscCaps
Set the following bits:

D3DPMISCCAPS_MASKZ

All the cull modes: D3DPMISCCAPS_CULLNONE, D3DPMISCCAPS_CULLCW, D3DPMISCCAPS_CULLCCW.

D3DPMISCCAPS_COLORWRITEENABLE

D3DPMISCCAPS_CLIPPLANESCALEDPOINTS

D3DPMISCCAPS_CLIPTLVERTS

D3DPMISCCAPS_BLENDOP

D3DPMISCCAPS_FOGINFVF

RasterCaps
Set the following bits:

D3DPRASTERCAPS_MIPMAPLODBIAS

D3DPRASTERCAPS_ANISOTROPY

D3DPRASTERCAPS_COLORPERSPECTIVE

D3DPRASTERCAPS_SCISSORTEST

Full depth support: D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS, D3DPRASTERCAPS_DEPTHBIAS

ZCmpCaps
Set the following bits for a full set of comparisons for stencil, depth and alpha test:

D3DPCMPCAPS_NEVER

D3DPCMPCAPS_LESS

D3DPCMPCAPS_EQUAL

D3DPCMPCAPS_LESSEQUAL

D3DPCMPCAPS_GREATER

D3DPCMPCAPS_NOTEQUAL

D3DPCMPCAPS_GREATEREQUAL

D3DPCMPCAPS_ALWAYS:

SrcBlendCaps, DestBlendCaps
Set the following source and destination blending modes except where noted:

D3DPBLENDCAPS_ZERO

D3DPBLENDCAPS_ONE

D3DPBLENDCAPS_SRCCOLOR

D3DPBLENDCAPS_INVSRCCOLOR

D3DPBLENDCAPS_SRCALPHA

D3DPBLENDCAPS_INVSRCALPHA

D3DPBLENDCAPS_DESTALPHA

D3DPBLENDCAPS_INVDESTALPHA

D3DPBLENDCAPS_DESTCOLOR

D3DPBLENDCAPS_INVDESTCOLOR

D3DPBLENDCAPS_SRCALPHASAT (not set for DestBlendCaps)

D3DPBLENDCAPS_BOTHSRCALPHA (not set for DestBlendCaps)

D3DPBLENDCAPS_BOTHINVSRCALPHA (not set for DestBlendCaps)

D3DPBLENDCAPS_BLENDFACTOR

TextureCaps
Set the following texture capabilities:

D3DPTEXTURECAPS_PERSPECTIVE

D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE

D3DPTEXTURECAPS_PROJECTED

D3DPTEXTURECAPS_CUBEMAP

D3DPTEXTURECAPS_VOLUMEMAP

D3DPTEXTURECAPS_MIPMAP

D3DPTEXTURECAPS_MIPVOLUMEMAP

D3DPTEXTURECAPS_MIPCUBEMAP

TextureFilterCaps, VolumeTextureFilterCaps, CubeTextureFilterCaps
Set the following filter capabilities for each except where noted:

D3DPTFILTERCAPS_MINFPOINT

D3DPTFILTERCAPS_MINFLINEAR

D3DPTFILTERCAPS_MINFANISOTROPIC (not required for VolumeTextureFilterCaps and CubeTextureFilterCaps)

D3DPTFILTERCAPS_MIPFPOINT

D3DPTFILTERCAPS_MIPFLINEAR

D3DPTFILTERCAPS_MAGFPOINT

D3DPTFILTERCAPS_MAGFLINEAR

TextureAddressCaps
Set the following texture address modes to indicate support at vertex and pixel stages:

D3DPTADDRESSCAPS_WRAP

D3DPTADDRESSCAPS_MIRROR

D3DPTADDRESSCAPS_CLAMP

D3DPTADDRESSCAPS_BORDER

D3DPTADDRESSCAPS_INDEPENDENTUV

D3DPTADDRESSCAPS_MIRRORONCE

StencilCaps
Set the following bits to indicate support of stencil operations:

D3DSTENCILCAPS_KEEP

D3DSTENCILCAPS_ZERO

D3DSTENCILCAPS_REPLACE

D3DSTENCILCAPS_INCRSAT

D3DSTENCILCAPS_DECRSAT

D3DSTENCILCAPS_INVERT

D3DSTENCILCAPS_INCR

D3DSTENCILCAPS_DECR

D3DSTENCILCAPS_TWOSIDED

FVFCaps
Set the D3DFVFCAPS_PSIZE capability to indicate that the device supports point size per vertex.

TextureCaps
Indicate that the device supports either full support or conditional nonpow-of-2 texture support. For more information, see Reporting Capabilities for Shader 2 Support.

Must not set the D3DPTEXTURECAPS_SQUAREONLY bit. That is, the device cannot be limited to square textures only.

If the device supports Rendering to Multiple Targets Simultaneously (that is, the NumSimultaneousRTs member is set to greater than 1), its driver must set the members of the D3DCAPS9 structure to the following values:

PrimitiveMiscCaps
Set the following bits:

D3DPMISCCAPS_INDEPENDENTWRITEMASKS

D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS

D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING

MaxUserClipPlanes
If vertex shader 3.0 and later is supported, set to 6.

DeclTypes
Set the following bits to indicate the vertex formats that the device supports if vertex shader 3.0 and later is supported:

D3DDTCAPS_SHORT2N

D3DDTCAPS_SHORT4N

D3DDTCAPS_UDEC3

D3DDTCAPS_DEC3N