Shader model comparison
(详见:http://en.wikipedia.org/wiki/High_Level_Shader_Language)
Pixel shader comparison
Pixel shader version | 1.0 to 1.3 | 1.4 | 2.0 | 2.0a | 2.0b | 3.0 | 4.0 |
---|---|---|---|---|---|---|---|
Dependent texture limit | 4 | 6 | 8 | Unlimited | 8 | Unlimited | Unlimited |
Texture instruction limit | 4 | 6*2 | 32 | Unlimited | Unlimited | Unlimited | Unlimited |
Position register | No | No | No | No | No | Yes | Yes |
Instruction slots | 8+4 | 8+4 | 32 + 64 | 512 | 512 | ≥ 512 | ≥ 65536 |
Executed instructions | 8+4 | 6*2+8*2 | 32 + 64 | 512 | 512 | 65536 | Unlimited |
Texture indirections | 4 | 4 | 4 | No limit | 4 | No Limit | No Limit |
Interpolated registers | 2 + 8 | 2 + 8 | 2 + 8 | 2 + 8 | 2 + 8 | 10 | 32 |
Instruction predication | No | No | No | Yes | No | Yes | No |
Index input registers | No | No | No | No | No | Yes | Yes |
Temp registers | 2 | 6 | 12 to 32 | 22 | 32 | 32 | 4096 |
Constant registers | 8 | 8 | 32 | 32 | 32 | 224 | 16x4096 |
Arbitrary | No | No | No | Yes | No | Yes | Yes |
Gradient instructions | No | No | No | Yes | No | Yes | Yes |
Loop count register | No | No | No | No | No | Yes | Yes |
Face register (2-sided lighting) | No | No | No | No | No | Yes | Yes |
Dynamic flow control | No | No | No | No | No | 24 | Yes |
Bitwise Operators | No | No | No | No | No | No | Yes |
Native Integers | No | No | No | No | No | No | Yes |
- PS 2.0 = DirectX 9.0 original Shader Model 2 specification.
- PS 2.0a = NVIDIA -optimized model.
- PS 2.0b = ATI shader model, DirectX 9.0b.
- PS 3.0 = Shader Model 3.
- PS 4.0 = Shader Model 4.
"32 + 64" for Executed Instructions means "32 texture instructions and 64 arithmetic instructions."
Vertex shader comparison
Vertex shader version | VS 1.1 | VS 2.0 | VS 2.0a | VS 3.0 | VS 4.0 |
---|---|---|---|---|---|
# of instruction slots | 128 | 256 | 256 | ≥ 512 | 4096 |
Max # of instructions executed | ????? | 65536 | 65536 | 65536 | 65536 |
No | No | Yes | Yes | Yes | |
Temp registers | 12 | 12 | 13 | 32 | 4096 |
# constant registers | ≥ 96 | ≥ 256 | ≥ 256 | ≥ 256 | 16x4096 |
Static Flow Control | ??? | Yes | Yes | Yes | Yes |
Dynamic Flow Control | No | No | Yes | Yes | Yes |
Dynamic Flow Control Depth | No | No | 24 | 24 | Yes |
Vertex Texture Fetch | No | No | No | Yes | Yes |
# of texture samplers | N/A | N/A | N/A | 4 | 128 |
support | No | No | No | Yes | Yes |
Bitwise Operators | No | No | No | No | Yes |
Native Integers | No | No | No | No | Yes |
- VS 2.0 = DirectX 9.0 original Shader Model specification.
- VS 2.0a = NVIDIA -optimized model.
- VS 3.0 = Shader Model 3.
- Note that ATI X1000 series cards (e.g. X1900) does not support Vertex Texture Fetch, hence it does not fully comply with the VS 3.0 model. Instead, they offer a feature called "Render to Vertex Buffer (R2VB)" that provides functionality that is a superset of Vertex Texture Fetch.
- VS 4.0 = Shader Model 4.