Pixel Shader Differences
Instruction Slots
Each version supports a different number of maximum instruction slots.
Version | Maximum number of instruction slots |
---|
ps_1_1 | 4 texture + 8 arithmetic |
ps_1_2 | 4 texture + 8 arithmetic |
ps_1_3 | 4 texture + 8 arithmetic |
ps_1_4 | 6 texture + 8 arithmetic per phase |
ps_2_0 | 32 texture + 64 arithmetic |
ps_2_x | 96 minimum, and up to the number of slots in D3DCAPS9.PS20Caps.NumInstructionSlots. See PS20Caps. |
ps_3_0 | 512 minimum, and up to the number of slots in D3DCAPS9.MaxPixelShader30InstructionSlots. See PS20Caps. |
For information about the limitations of software shaders, see Software Shaders.
Flow Control Nesting Limits
ps_1_x Features
New instructions:
See ps_1_1, ps_1_2, ps_1_3, ps_1_4 Instructions.
New registers:
See ps_1_X Registers.
ps_2_0 Features
New features:
New instructions:
- Setup instructions - dcl, dcl_samplerType
- Arithmetic instructions - abs, crs, dp2add, exp, frc, log, m3x2, m3x3, m3x4, m4x3, m4x4, max, min, nrm, pow, rcp, rsq, sincos
- Texture instructions - texld (different syntax), texldb, texldp
New registers:
ps_2_x Features
New features (See PS20Caps.):
- Dynamic flow control
- Static flow control
- Nesting for dynamic and static flow control instructions
- Number of Temporary Registers (r#) increased
- Arbitrary source swizzle
- Gradient instructions
- Predication
- No dependent texture read limit
- No texture instruction limit
New instructions:
- Static flow control instructions - if bool, call, callnz bool, else, endif, rep, endrep, label, ret
- Dynamic flow control instructions - break, break_comp, breakp, callnz pred, if_comp, if pred, setp_comp - ps
- Arithmetic instructions - dsx, dsy
- Texture instruction - texldd
New registers:
ps_3_0 Features
New features:
New instructions:
New registers: