Pixel Shader Differences
These are the differences between the pixel shader versions.
Version | Maximum number of instructions |
---|
1_x | 8 for version 1_1.
12 for versions 1_2 and 1_3.
14 for version 1_4. |
2_0 | 64 arithmetic and 32 texture instructions. |
2_0 Extended | 96 minimum, up to 512 maximum. The exact number is specified by D3DCAPS9.PS20Caps.MaxPixelShaderInstructionSlots. See D3DCAPS9. |
3_0 | 512 minimum, up to the number of slots in the D3DCAPS9.MaxPixelShader30InstructionSlots (not more than 32768). See D3DCAPS9. |
New Features
New features for each version include the following:
Version 3_0
- Static flow control instructions: call, callnz, else, end, endif, endloop, endrep, if, label, loop, rep, ret
- Static flow control nesting depth
- Number of temporary registers
- Dynamic flow control instructions: break, breakc, ifc
- Predication: setp instruction, p# register
New registers: constant integer, constant Boolean, loop counter, predicate
New modifiers: arbitrary swizzle
Version 2_0 Extended
- New static flow control instructions (with a cap set): call, callnz, else, end, endif, endloop, endrep, if, label, loop, rep, ret
- Static flow control nesting depth
- Number of temporary registers
- Dynamic flow control instructions: break, breakc, ifc
- Gradient instructions: dsx and dsy
- Texture instructions: texldd
- Predication - setp instruction, p# register
New registers: constant integer, constant Boolean, loop counter, predicate
New modifiers (with a cap set): arbitrary swizzle
Version 2_0
New instructions:
- Setup instructions: def, ps
- Arithmetic instructions: add, cmp, cnd, dp3, dp4, lrp, mad, mov, mul, nop, sub
- Macros: exp, frc, log, m3x2, m3x3, m3x4, m4x3, m4x4
- Texture instructions:
- Added: texldb, texldp
- Removed: tex, texbem, texbeml, texcoord, texcrd, texdepth, texdp3, texdp3tex, texm3x2depth, texm3x2pad, texm3x2tex, texm3x3, texm3x3pad, texm3x3tex, texm3x3spec, texm3x3vspec, texreg2ar, texreg2gb, texreg2rgb
New registers: constant float, sampler, output color, output depth
New modifiers: negate, partial precision, saturate
Removed co-issuing of instructions
Version 1_X
New instructions:
- Setup instructions: def, ps
- Arithmetic instructions: add, cmp, cnd, dp3, dp4, lrp, mad, mov, mul, nop, sub
- Macros: exp, frc, log, m3x2, m3x3, m3x4, m4x3, m4x4
- Texture instructions: tex, texbem, texbeml, texcoord, texcrd, texdepth, texdp3, texdp3tex, texkill, texld, texm3x2depth, texm3x2pad, texm3x2tex, texm3x3, texm3x3pad, texm3x3tex, texm3x3spec, texm3x3vspec, texreg2ar, texreg2gb, texreg2rgb
New registers: constant, temporary, texture, color
New modifiers: instruction modifiers, register modifiers, source register selectors, register write masks