Introduction to the DirectX 9 Shader Models - Nvidia
Introduction to the DirectX 9 Shader Models - Nvidia Introduction to the DirectX 9 Shader Models - Nvidia
Vertex Shader Predication - ASM Sim With Predication : def c0, 0.0f, 0.0f, 0.0f, 0.0f . . . setp_gt p0, r1.w, c0.w p0 add r0, r0, r2 Without Predication : def c0, 0.0f, 0.0f, 0.0f, 0.0f . . . sgt r3.w, r1.w, c0.w mad r0, r3.w, r2, r0
Vertex Shader Predication Details Sim • Predication requires fewer temporaries • Can use predication on any math instruction • Predication – 4D Predication register : p0 • SETP, then call instructions with _PRED • BREAK_PRED, CALLNZ_PRED, IF_PRED – Can invert predication using “not” (!) – Predication very useful for short IF / ELSEIF blocks
- Page 1 and 2: Introduction to the DirectX 9 Shade
- Page 3 and 4: Legacy 1.x Shaders • No discussio
- Page 5 and 6: vs_2_0 • Longer programs • Inte
- Page 7 and 8: vs_2_0 • Old reliable ALU instruc
- 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: Vertex Shader Predication - HLSL Si
- 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
- Page 57 and 58: Lighting Render Loop • Per Light
- Page 59 and 60: Lighting Render Loop • Per-Object
- Page 61 and 62: Lighting Render Loop Summary • Go
- Page 63 and 64: Predication • Essentially a desti
- Page 65 and 66: Caveats for Conditional Instruction
- Page 67 and 68: Texture fetch with gradients • Gr
- Page 69 and 70: Arbitrary swizzling • Extremely u
- Page 71 and 72: Pixel Shader Precision • Low Prec
- Page 73 and 74: How to use fp16 • In HLSL or Cg,
- Page 75 and 76: Precision Pitfalls • An IEEE-like
- Page 77 and 78: Precision Pitfalls • Most precisi
- Page 79 and 80: Fully Fragment Shading? • Doing t
Vertex <strong>Shader</strong> Predication Details<br />
Sim<br />
• Predication requires fewer temporaries<br />
• Can use predication on any math<br />
instruction<br />
• Predication<br />
– 4D Predication register : p0<br />
• SETP, <strong>the</strong>n call instructions with _PRED<br />
• BREAK_PRED, CALLNZ_PRED, IF_PRED<br />
– Can invert predication using “not” (!)<br />
– Predication very useful for short IF / ELSEIF<br />
blocks