在WinXP下,即使GPU支持D3D10+,也只能用D3D9的API。但实际上各个厂商都对D3D9做了一些扩展,把部分D3D10+的特性暴露给了D3D9 API。以下是一些特殊的纹理格式,通过FOURCC的方式来使用。通过CheckDeviceFormat可以检测是否支持该格式,在CreateTexture的时候传入即可。下表的源头是各厂商的GPU文档,经过Unity的Aras整理而来:
Usage列:DS=DepthStencil,RT=RenderTarget;Resource列:tex=texture,surf=surface。越绿表示越多硬件支持。
In WinXP, even a GPU supports D3D10+ can only uses D3D9 API. Actually, most GPU vendors have their extensions, some D3D10+’s features are exposed to D3D9 API. For example, here’s a list of special texture formats, which are used through FOURCC. You can use CheckDeviceFormat to detect whether its available, and pass it to CreateTexture. The original source of the table below is vendors GPU document. Aras from Unity assemble them up:
Usage column: DS=DepthStencil, RT=RenderTarget; Resource column: tex=texture, surf=surface. More green means more hardware support.
Format | Usage | Resource | Description | NVIDIA GeForce | ATI Radeon | Intel |
---|---|---|---|---|---|---|
Shadow mapping | ||||||
D3DFMT_D16 | DS | tex | Sample depth buffer directly as shadow map. | 3+ | HD 2xxx+ | 965+ |
D3DFMT_D24X8 | DS | tex | 3+ | HD 2xxx+ | 965+ | |
Depth Buffer As Texture | ||||||
DF16 | DS | tex | Read depth buffer as texture. | 9500+ | G45+ | |
DF24 | DS | tex | X1300+ | |||
INTZ | DS | tex | 8+ | HD 4xxx+ | G45+ | |
RAWZ | DS | tex | 6 & 7 | |||
Anti-Aliasing related | ||||||
RESZ | RT | surf | Resolve MSAA’d depth stencil surface into non-MSAA’d depth texture. | HD 4xxx+ | G45+ | |
ATOC | 0 | surf | Transparency anti-aliasing. | 7+ | ||
SSAA | 0 | surf | 7+ | |||
All ATI SM2.0+ hardware | 9500+ | |||||
n/a | Coverage Sampled Anti-Aliasing | 8+ | ||||
Texturing | ||||||
ATI1 | 0 | tex | ATI1n & ATI2n texture compression formats. | 8+ | X1300+ | G45+ |
ATI2 | 0 | tex | 6+ | 9500+ | G45+ | |
DF24 | DS | tex | Fetch 4: when sampling 1 channel texture, return four touched texel values. Check for DF24 support. | X1300+ | ||
Misc | ||||||
NULL | RT | surf | Dummy render target surface that does not consume video memory. | 6+ | HD 4xxx+ | |
NVDB | 0 | surf | Depth Bounds Test. | 6+ | ||
R2VB | 0 | surf | Render into vertex buffer. | 6 & 7 | 9500+ | |
INST | 0 | surf | Geometry Instancing on pre-SM3.0 hardware. | 9500+ |
完整的GPU扩展功能,请看:
Complete GPU extensions, please see: