Introduction to the DirectX 9 Shader Models - Nvidia
Introduction to the DirectX 9 Shader Models - Nvidia Introduction to the DirectX 9 Shader Models - Nvidia
Declarations Stream 0 Stream1 Stream 0 Vertex layout pos tc0 norm Declaration pos tc0 norm asm: vs 1.1 dcl_position v0 dcl_normal v1 dcl_texcoord0 v2 mov r0, v0 … HLSL: VS_OUTPUT main ( float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 vTC0 : TEXCOORD0) { … }
vs_2_0 • Old reliable ALU instructions and macros – add, dp3, dp4, mad, max, min, mov, mul, rcp, rsq, sge and slt – exp, frc, log, logp, m3x2, m3x3, m3x4, m4x3 and m4x4 • New ALU instructions – abs, crs, mova – expp, lrp, nrm, pow, sgn, sincos • New control flow instructions – call, callnz, else, endif, endloop, endrep, if, label, loop, rep, ret
- Page 1 and 2: Introduction to the DirectX 9 Shade
- Page 3 and 4: Legacy 1.x Shaders • No discussio
- Page 5: vs_2_0 • Longer programs • Inte
- Page 9 and 10: Changes to the VS numbers • 256 i
- Page 11 and 12: And some smaller details • Loadin
- Page 13 and 14: Setting Vertex Shader Registers •
- Page 15 and 16: Swizzles & Modifiers
- Page 17 and 18: Control Flow Instructions • Subro
- Page 19 and 20: Loops
- Page 21 and 22: HLSL and Conditionals • Initial r
- Page 23 and 24: Original HLSL Compiler Results vs_2
- Page 25 and 26: Begin Sim VS Sim
- Page 27 and 28: Caps for vs_2_x Sim • New D3DVSHA
- Page 29 and 30: Vertex Shader Predication - HLSL Si
- Page 31 and 32: Vertex Shader Predication Details S
- Page 33 and 34: Nested Static Flow Control Sim •
- Page 35 and 36: Dynamic Flow Control - HLSL Sim for
- Page 37 and 38: End Sim VS Sim
- Page 39 and 40: 2.0 Pixel Shader Instruction Set
- Page 41 and 42: Argument Swizzles •.r, .rrrr, .xx
- Page 43 and 44: ps.2.0 Review - Comparison with ps.
- Page 45 and 46: Caps for Pixel Shader 2.x D3DCAPS9
- Page 47 and 48: Pixel Shader 2.x • 512 instructio
- Page 49 and 50: Single Pass Lighting? • Sometimes
- Page 51 and 52: Single-Pass Lighting ? • Detailed
- Page 53 and 54: Single Pass Lighting? • Putting m
- Page 55 and 56: Single Pass Lighting? • It doesn
vs_2_0<br />
• Old reliable ALU instructions and macros<br />
– add, dp3, dp4, mad, max, min, mov, mul, rcp, rsq, sge<br />
and slt<br />
– exp, frc, log, logp, m3x2, m3x3, m3x4, m4x3 and m4x4<br />
• New ALU instructions<br />
– abs, crs, mova<br />
– expp, lrp, nrm, pow, sgn, sincos<br />
• New control flow instructions<br />
– call, callnz, else, endif, endloop, endrep, if, label, loop,<br />
rep, ret