version 2.2.0 nvidia gpu

77
Version 2.2.0 NVIDIA GPU 2.2.0

Upload: lamngoc

Post on 29-Jan-2017

259 views

Category:

Documents


5 download

TRANSCRIPT

  • VVeerrssiioonn 22..22..00

    NNVVIIDDIIAA GGPPUU 22..22..00

  • NVIDIA , , , , , ( ) . NVIDIA , , , , .

    . , NVIDIA Corporation 3 . NVIDIA Corporation . . . NVIDIA Corporation NVIDIA Corporation .

    NVIDIA, NVIDIA , GeForce, NVIDIA Quadro NVIDIA Corporation . .

    2004 by NVIDIA Corporation. All rights reserved.

    2.2.0 11/16/2004

    ps_3_0

    2.1.0 07/20/2004

    2.0.4 07/15/2004 MRT

    2.0.3 06/25/2004 GPU

    2.0.0 06/01/2004 NV40(GeForce 6 )

    NVIDIA GPU

    1.0.0 07/14/2003 GeForce FX

    2

  • NVIDIA GPU

    3

    Chapter 1. .......................................................................................8

    1.1. .........................................................................................8

    1.2. ...............................................................................9

    Chapter 2. ..............................................................10

    2.1. ................................................................... 10

    2.2. ......................................................................... 11

    2.2.1. 11

    2.2.2. 12

    2.2.3. NVPerfHUD 13

    2.3. : CPU......................................................................... 14

    2.4. : GPU......................................................................... 15

    Chapter 3. GPU ......................................................................17

    3.1. ..................................................................... 17

    3.2. ................................................................................ 20

    3.2.1. 20

    3.3. ......................................................................... 20

    3.3.1. Indexed Primitive Call 20

    3.4. .................................................................................... 21

    3.4.1. 21

    3.4.2. ps_2_a 21

    3.4.3. 22

    3.4.4. 23

    3.4.5. Interpolant 24

  • 3.4.6. 24

    3.4.7. 25

    3.4.8. 25

    3.4.9. 26

    3.4.10. 26

    3.4.11. 27

    3.4.12. mul() 27

    3.4.13. saturate() D3DTADDRESS_CLAMP ( GL_CLAMP_TO_EDGE) 27

    3.4.14. Interpolant 28

    3.5. ................................................................................. 28

    3.5.1. 28

    3.5.2. 28

    3.5.3. 29

    3.6. ....................................................................................... 31

    3.6.1. 2 Z 31

    3.6.2. Z 32

    3.6.3. 32

    3.6.4. 33

    3.7. (Antialiasing) ....................................................... 33

    Chapter 4. GeForce 6 ................................................35

    4.1. Shader Model 3.0 ............................................................. 35

    4.1.1. Pixel Shader 3.0 36

    4.1.2. Vertex Shader 3.0 37

    4.1.3. (Dynamic Branching) 37

    4.1.4. 38

    4.1.5. (Instancing) 38

    4.1.6. 39

    4

  • NVIDIA GPU

    5

    4.2. sRGB ............................................................................ 39

    4.3. .................................................................. 39

    4.4. ............................................................... 40

    4.5. .................................................................. 41

    4.5.1. 41

    4.6. MRT(Multiple Render Target) .................................................... 41

    4.7. ...................................................................... 43

    4.8. ............................................................... 44

    4.9. .................................................................................... 45

    Chapter 5. GeForce FX .........................................................47

    5.1. ......................................................................... 47

    5.2. ..................................................................... 47

    5.3. DirectX ................................................................. 48

    5.4. OpenGL ................................................................ 48

    5.5. 16 ......................................................... 49

    5.6. ............................................................... 50

    5.7. DirectX ps_2_x ps_2_a ......................................... 51

    5.8. ...................................................... 52

    5.9. .................................................................................... 52

    5.10. .................................................................. 52

    5.11. ....................................................................................... 53

    Chapter 6. ..................................................................................55

    6.1. GPU ................................................................................ 55

    6.2. .................................................................. 56

    Chapter 7. NVIDIA SLI GPU ..............................................61

    7.1. SLI ? ...................................................................... 61

    7.2. CPU ...................................................................... 63

    7.3. VSync ( ) ............................................................. 63

  • 7.4. 2 (Lag) ............................................... 64

    7.5. .................. 65

    7.6. ............................................... 66

    7.7. D3DPOOL_MANAGED .................................. 66

    Chapter 8. ..............................................................................67

    8.1. ? ...................................................... 67

    8.2. ............................................................... 68

    8.3. ........................................................ 68

    8.3.1. 68

    8.3.2. 69

    8.3.3. 69

    8.3.4. 3D 2D 70

    8.3.5. 70

    8.3.6. (Dirty Rectangle) 70

    8.3.7. 70

    8.3.8. 70

    8.3.9. 71

    8.3.10. 71

    8.3.11. 71

    8.3.12. 71

    8.3.13. 71

    8.3.14. 71

    8.3.15. 72

    8.4. .................................................................. 72

    8.4.1. 72

    8.4.2. Out of the Monitor 72

    8.4.3. 72

    8.4.4. 73

    8.4.5. 73

    6

  • NVIDIA GPU

    7

    8.5. API ........................................................................... 73

    8.6. ................................................................................ 74

    Chapter 9. .................................................................................75

    9.1. NVPerfHUD.............................................................................. 75

    9.2. NVShaderPerf .......................................................................... 76

    9.3. FX Composer ........................................................................... 76

    9.4. NVIDIA Melody ........................................................................ 77

    9.5. ................................................... 77

  • Chapter 1.

    1.1.

    , API, (GPU) . . [email protected] .

    .

    1 ( ) .

    2 .

    3 . , .

    4 NVIDIA GeForce 6 NV4X Quadro FX GPU . , .

    5 NVIDIA GeForce FX NV3X Quadro FX GPU .

    mailto:[email protected]://www.nvidia.com/page/geforce6.htmlhttp://www.nvidia.com/page/quadrofx_family.htmlhttp://www.nvidia.com/page/fx_desktop.htmlhttp://www.nvidia.com/page/quadrofx_family.html

  • NVIDIA GPU

    9

    1.2.

    , .

    6 NVIDIA GPU , , GPU .

    7 NVIDIA SLI(Scalable Link Interface) . SLI GPU .

    8 . .

    9 NVIDIA .

    10 GPU .

    [email protected] .

    mailto:[email protected]

  • Chapter 2.

    .

    2.1.

    , . , NVPerfHUD ( NVPerfHUD ) (ms) ..

    .

    . , DiretX Debug , .

    . , DLL, DirextX .

    ( ) .

    . , . .

    http://developer.nvidia.com/object/nvperfhud_home.html

  • NVIDIA GPU

    . .

    . , CPU, GPU . .

    11

    2.2.

    2.2.1.

    , . . . . . .

    1.

  • CPU, AGP , GPU 1 ) . . .

    CPU GPU . NVPerfHUD (NVPerfHUD 9.1 ) GPU . GPU 1 , CPU . GPU 1 , CPU GPU , CPU . GPU GPU .

    2.2.2.

    . , .

    . . . Windows , AMD CodeAnalyst(http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604,00.html) VTune (http://www.intel.com/software/products/vtune/) . , .

    CPU GPU . CPU , BIOS . , . CPU , CPU .

    12

    http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604,00.htmlhttp://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604,00.htmlhttp://www.intel.com/software/products/vtune/

  • NVIDIA GPU

    13

    2.2.3.

    GPU . Coolbit( 6 ) . , , , (, ).

    GPU . Coolbit( 6 ) . , (GPU ).

    , CPU , GPU , GPU CPU , GPU . CPU n% n% , CPU . GPU n% n% , GPU .

    NVPerfHUD

    CPU Null Hardware(Null HW) . ( ), GPU . Null HW , CPU .

    NVPerfHUD 2.0 (draw call) Null Hardware Driver . CPU . . NVPerfHUD .

    NVPerfHUD GPU , GPU . NVPerfHUD GPU , GPU .

  • NVPerfHUD . http://developer.nvidia.com/object/nvperfhud_home.html .

    2.3. : CPU

    CPU , CPU . CPU .

    ( DLL )

    (nv4disp.dll, nvoglnt.dll)

    DirectX (d3d9.dll)

    DirectX (hal32.dll)

    CPU CPU , CPU . . , . CPU .

    , . hal32.dll, d3d9.dll , nvoglnt.dll CPU , API . CPU , ? (batch) . .

    http://developer.nvidia.com/docs/IO/8230/BatchBatchBatch.ppt

    http://download.nvidia.com/developer/presentations/GDC_2004/Dx9Optimization.pdf

    14

    http://developer.nvidia.com/object/nvperfhud_home.htmlhttp://developer.nvidia.com/docs/IO/8230/BatchBatchBatch.ppthttp://download.nvidia.com/developer/presentations/GDC_2004/Dx9Optimization.pdfhttp://download.nvidia.com/developer/presentations/GDC_2004/Dx9Optimization.pdf

  • NVIDIA GPU

    15

    2.4.

    NVPerfHUD . ( ), .

    CPU .

    Lock ? Lock CPU GPU , GPU CPU . CPU , . lock CPU .

    CPU GPU ? CPU GPU , GPU ! CPU CPU .

    CPU GPU . GPU ?

    . , 2 2 . Shader Model 3.0 , draw overhead . Shader Model 3.0 4.1 .

    : GPU

    GPU . GPU , . http://developer.nvidia.com/docs/IO/4449/SUPP/GDC2003_PipelinePerformance.ppt .

    NVPerfHUD GPU . , LOD 2 2 . , .

    http://developer.nvidia.com/docs/IO/4449/SUPP/GDC2003_PipelinePerformance.ppthttp://developer.nvidia.com/docs/IO/4449/SUPP/GDC2003_PipelinePerformance.ppt

  • NVPerfHUD .

    GPU , 3 .

    16

  • Chapter 3. GPU

    GeForceFX GeForce 6 GPU . . . .

    GPU , GPU : , , (Programming Techniques, Tips, and Tricks for Real-Time Graphics) . .

    http://developer.nvidia.com/object/gpu_gems_samples.html .

    3.1.

    GeForceFX GeForce 6 GPU . , .

    http://developer.nvidia.com/object/gpu_gems_samples.html

  • GPU

    CPU

    . . http://developer.nvidia.com/object/nv_texture_tools.html

    DirectX , Instancing API SetMatrix, .

    GPU

    Indexed Primitive Call . Use DirectX 9 [ID3DXMesh:OptimizeInplace() ID3DXMesh:Optimize()] .

    Indexed Primitive Call NVTriStrip . http://developer.nvidia.com/object/nvtristrip_library.html

    GPU

    . , . , .

    ps_2_* , ps_2_a profile .

    . half float .

    .

    .

    18

    http://developer.nvidia.com/object/nv_texture_tools.htmlhttp://developer.nvidia.com/object/nvtristrip_library.html

  • NVIDIA GPU

    19

    .

    .

    . .

    FXComposer .

    sincos, log, exp , .

    GPU

    . .

    . . http://developer.nvidia.com/object/nv_texture_tools.html

    . , .

    GPU

    2 Z Z(Z-cull)

    (Antialiasing)

    http://developer.nvidia.com/object/nv_texture_tools.html

  • GPU

    3.2.

    3.2.1.

    3.3.

    (batching) API , API . API . API . , . . GPU , .

    3.3.1. Indexed Primitive Call

    Indexed Primitive Call GPU . , . .

    DirextX , ID3DXMesh class OptimizeInPlace() Optimize() .

    NVTriStrip . NVTriStrip , http://developer.nvidia.com/object/nvtristrip_library.html .

    20

    http://developer.nvidia.com/object/nvtristrip_library.html

  • NVIDIA GPU

    21

    3.4.

    . , . . . GPU 100% . GeForce FX GPU 20 ! GeForce 6 GPU .

    3.4.1.

    3.4.2.

    . , 8 , ps_2_0 .

    ps_2_a

    HLSL (fxc.exe) . GeForce FX GPU ps_2_0 , ps_2_a . ps_2_a GeForce FX ps_2_0 . ps_2_a ps_2_0 . ps_2_a 2003 7 HLSL .

    , fxc (DirectX 9.0c ) . . GeForce 6 GPU , .

  • GPU

    3.4.3.

    . GeForce FX GeForce 6 GPU 32 16 ( float half ) 12 (fixed ) . float s23e8 IEEE . half IEEE , s10e5 . 12 fixed [-2,2] , ps_2_0 . fixed DirextX ps_1_0~ps_1_4 , OpenGL NV_fragment_program extension Cg .

    .

    fixed , .

    , half flat . half 3 , 99% 32 1 LSB() !

    , float ..

    /Gpp (2003 7 HLSL ) 1/2 . , . , . , 1/2 (/Gpp ).

    half fixed , , , , . ps_2_0 DirectX , _pp .

    OpenGL ARB_fragment_program , ARB_precision_hint_fastest

    22

  • NVIDIA GPU

    23

    NV_fragment_program (http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt ).

    fixed half (: tex2D*diffuseColor ).

    OpenGL GeForce FX , ( ) .

    , 1/2 . 1/2 , .

    , , 1/2 .

    3.4.4.

    , . .

    . p = sqrt(Rx + Ry + (Rz + 1) ) 2 2 2

    . p = sqrt(Rx2 + Ry2 + Rz2 + 2Rz + 1)

    (3.4.8 3.4.6 ), 1.0 . . p = sqrt(2 * (Rz + 1)) = 1.414*sqrt(Rz + 1)

    1.414 (3.4.8 ), .

    http://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txthttp://www.nvidia.com/dev_content/nvopenglspecs/GL_NV_fragment_program_option.txt

  • GPU

    (normalize(N), normalize(L)) .

    (N/|N|) dot (L/|L|) . 2 rsq(reciprocal square root) .

    . (N/|N|) dot (L/|L|) = (N dot L) / (|N| * |L|) = (N dot L) / (sqrt( (N dot N) * (L dot L) ) = (N dot L) * rsq( (N dot N) * (L dot L) ) rsq .

    3.4.5.

    3.4.6.

    Interpolant

    . , , 3 q . .

    // Bad practice

    tangent = float4(tangentVec, viewVec.x)

    binormal = float4(binormalVec, viewVec.y)

    normal = float4(normalVec, viewVec.z)

    interpolant .

    . , . float3 reflect(float3 I, float3 N) {

    return (2.0*dot(I,N)/dot(N,N))*N I;

    }

    . ,

    24

  • NVIDIA GPU

    25

    3.4.7.

    3.4.8.

    . , reflect() , , . .

    ( ) . , . . , 1.0 .

    , . , 1.0 ( ), .

    . ( ) , . . half4 main(float2 diffuse : TEXCOORD0,

    uniform sampler2D diffuseTex,

    uniform half4 g_OverbrightColor) {

    return tex2D(diffuseTex, diffuse) * g_OverbrightColor * 2.0;

    }

    g_OverbrightColor CPU 2.0 , .

    . , HLSL CPU .

  • GPU

    , materialColor * lightColor . , CPU .

    GPU CPU . . Zpr (pack row-major) Zpc (pack column-major) .

    3.4.9.

    3.4.10.

    0, 1, 255 . . .

    , . , CPU, AGP , . .

    ? , . .

    ? , . .

    ? , . () 20 ,

    26

  • NVIDIA GPU

    27

    3.4.11.

    3.4.12.

    3.4.13.

    GeForce FX . , . ( 3.4 .) NVShaderPerf . GeForce 6 .

    , . , . .

    , . , (cube map) , .

    mul()

    mul() . , interpolant .

    saturate() D3DTADDRESS_CLAMP ( GL_CLAMP_TO_EDGE)

    saturate() GPU . , [0..1] .

  • GPU

    3.4.14.

    3.5.

    Interpolant

    (TEXCOORD ) . TEXCOORD0 TEXCOORD1, TEXCOORD2 .

    3.5.1.

    , . . 33% . 3D . 30~40% .

    . , . , . , . (NVIDIA ) . http://developer.nvidia.com/object/nv_texture_tools.html .

    3.5.2.

    , . . , . , . ( , ),

    28

    http://developer.nvidia.com/object/nv_texture_tools.html

  • NVIDIA GPU

    29

    . .

    Adobe Photoshop . . http://developer.nvidia.com/object/nv_texture_tools.html . .

    3.5.3.

    . OTF(on-the-fly) . GeForce FX , . FX Composer . FX Composer http://developer.nvidia.com/FXComposer .

    . , log exp ps_2_0 , .

    3.5.3.1.

    2D

    . (N dot L) (N dot H) 2D . (u, v) . max(N dot L,0) + Ks*pow((N dot L>0) ? max(N dot H,0) : 0), n)

    Blinn .

    1D ARGB

    http://developer.nvidia.com/object/nv_texture_tools.htmlhttp://developer.nvidia.com/FXComposer

  • GPU

    (N dot H) 1D ARGB . (N dot H) . .

    ( (N dot H)4, (N dot H)8, (N dot H)12, (N dot H)16 )

    , 4 . GeForce 4- .

    3D

    3D (mix) . 2D () .

    . .

    3.5.3.2.

    ps_1_* shader , . 16 . x y , z .

    V 1 . V . , Taylor (x=1 / sqrt(x)) 1 /||V|| .

    1 / sqrt(x) ~ 1 + (1 - x)

    .

    V / ||V|| = V / sqrt(||V||^2) = V + V (1 - ||V||^2)

    2 .

    dp3_sat r1, r0, r0

    mad_d2 r1, r0, 1-r1, r0_x2

    30

  • NVIDIA GPU

    31

    r0 V r1 V / ||V||. .

    _x2 ps_1_4 . , . dp3_sat r1, r0_bx2, r0_bx2

    mad r1, r0_bias, 1-r1, r0_bx2

    r0 (V + 1) . (V + 1) V [ -1, 1 ] [ 0, 1 ], .

    GeForce 6 GPU fp16 1/2 . fp16 . nrmh .

    Normalization Heuristics and Bump Map Compression . .

    http://developer.nvidia.com/object/normalization_heuristics.html

    http://developer.nvidia.com/object/bump_map_compression.html

    3.5.3.3. sincos()

    , GeForce FX GPU . sincos . .

    3.6.

    3.6.1. 2 Z

    GeForce FX GeForce 6 GPU 2 . .

    .

    http://developer.nvidia.com/object/normalization_heuristics.htmlhttp://developer.nvidia.com/object/bump_map_compression.html

  • GPU

    - .

    Texkill .

    (oDepth, texm3x2depth, texdepth) .

    .

    .

    .

    3.6.2.

    3.6.3.

    Z

    Z ( z-cull ) . , z-cull . z-cull .

    ( , texkill ).

    ( , GPU ).

    GPU z-cull .

    2 . , 2 ( ) . . , . z-cull . .

    32

  • NVIDIA GPU

    33

    3.6.4.

    3.7.

    , . 2 . z-cull .

    Deferred Shading . NVSDK 7.1 .

    (thrashing) , .

    1.

    (width * bpp) . . .

    2.

    3.

    (Antialiasing)

    GeForce FX GeForce 6 . . .

    . .

    DirectX9.0b . StretchRect() .

  • GPU

    , 100 100 4x , 200 200 . 100 100 , StretchRect() , GPU .

    , 100 100 .

    (200 200) (100 100) .

    34

  • Chapter 4. GeForce 6

    GeForce 6 Quadro FX 4xxx GPU . , .

    4.1. Shader Model 3.0

    Microsoft DirectX 9.0 ( 2.0 3.0) . Shader Model 2.0 2002 , GPU Shader Model 2.0 . Shader Model 2.0 , . .

    Pixel Shader 2.0 Vertex Shader 2.0 Shader Model 3.0 . , .

  • GeForce 6

    4.1.1. Pixel Shader 3.0 Pixel Shader 2.0 3.0 .

    Shader 2.0

    Shader 3.0

    96 65535+ , ,

    , .

    8

    32

    4 ,

    8

    fp16-fp32

    Shader Model 3.0 /

    8 10

    36

  • NVIDIA GPU

    37

    4.1.2. Vertex Shader 3.0 Vertex Shader Model 2.0 3.0 .

    Shader 2.0

    Shader 3.0

    256

    65535

    4

    ,

    4.1.3. (Dynamic Branching)

    Shader 3.0 ( ) (Dynamic Branching). , . , , . . , .

    . , ( ) . . .

  • GeForce 6

    4.1.4.

    4.1.5.

    Pixel Shader 2.0 . , , . Shader Model 3.0 , / . .

    (Instancing)

    Shader Model 3.0 Microsoft DirectX Instancing API . , . , CPU . , , . .

    , , . , 1000 , 200 , , . . 200 , .

    http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html .

    38

    http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html

  • NVIDIA GPU

    39

    4.1.6.

    4.2.

    , DirectX 9.0 Shader Model 3.0 , , . , . , CPU .

    sRGB

    sRGB . DXT , .

    GeForce 6 GPU , . .

    sRGB . sRGB .

    4.3.

    GeForce 6 GPU . , . .

  • GeForce 6

    4.4.

    GeForce 6 GPU .

    2D 3D MIP sRGB R8G8B8 N N N N N N N N N A8R8G8B8 Y Y Y Y Y Y Y Y N X8R8G8B8 Y Y Y Y Y Y Y Y N R5G6B5 Y Y Y Y Y Y Y Y N X1R5G5B5 Y Y Y Y Y Y Y Y N A1R5G5B5 Y Y Y Y Y Y N N N A4R4G4B4 Y Y Y Y Y Y N N N R3G3B2 N N N N N N N N N A8 Y Y Y Y Y N/A N N N A8R3G3B2 N N N N N N N N N X4R4G4B4 N N N N N N N N N A2B10G10R10 N N N N N N N N N A8B8G8R8 N N N N N N N N N X8B8G8R8 N N N N N N N N N G16R16 Y Y Y Y Y N N N N A2R10G10B10 N N N N N N N N N A16B16G16R16 N N N N N N N N N A8P8 N N N N N N N N N P8 N N N N N N N N N L8 Y Y Y Y Y N N N N L16 Y Y Y Y Y N N N N A8L8 Y Y Y Y Y N N N N A4L4 N N N N N N N N N float 2D 3D MIP sRGB R16F N N N N N N/A N N N G16R16F Y Y Y Y Y N/A Y N N A16B16G16R16F Y Y Y Y Y N/A Y Y N R32F Y Y Y Y N N/A Y N Y G32R32F N N N N N N/A N N N

    40

  • NVIDIA GPU

    41

    A32B32G32R32F Y Y Y Y N N/A Y N Y 2D 3D MIP sRGB D24X8 Y N N Y Y N/A Y N/A N D24S8 Y N N Y Y N/A Y N/A N D16 Y N N Y Y N/A Y N/A N

    4.5.

    GeForce 6 GPU . 16 (fp16) 32 (fp32) .

    /

    3D

    Non-power-of-2 Textures

    16

    32

    4.5.1.

    4.6.

    R16F . G16R16F . G16R16F R23F A16B16G16R16F . G16R16F .

    MRT(Multiple Render Target)

    GeForce 6 GPU MRT . 4 . 4 float MRT .

  • GeForce 6

    MRT GPGPU . (deferred shading) float4 . , , , . .

    DirectX caps bit NumSimultaneousRTs . GeForce 6 GPU caps bit 4 . MRT SetRenderTarget(index, pRenderTarget) API . . oC0, oC1, oC2, oC3 . MRT 0 3 NULL .

    MRT GPU . , MRT . , , , . GeForce 6 , , 32 64 (, A16R16G16B16F ) 4 , 128 (, A32R32G32B32F ) 4 .

    , D3DMISCCAPS_MRTPOSTPIXELSHADERBLENDING caps bit USAGE_QUERY_POSTPIXELSHADERBLENDING , , , , MRT .

    GeForce 6 MRT . , R32F, G16R16F, and A32R32G32B32F . GeForce 6 GPU(GeForce 6200 ) A16R16G16B16F . DirectX MRT . MRT ( 1 3

    42

  • NVIDIA GPU

    43

    ), oC0.a 4 .

    , MRT . MRT . , 4 A32R32G32B32F A8R8G8B 16 ! , GeForce 6 3 .

    . , MRT MRT . , . MRT (3.6.4 ).

    MRT 3 , . , MRT 4 , MRT 3 . , , (: ). SDK 7.1 ftp://download.nvidia.com/developer/Movies/NV40-LowRes-Clips/Deferred_Shading.avi .

    4.7.

    GeForce 6 GPU , RAM . . . . .

    ftp://download.nvidia.com/developer/Movies/NV40-LowRes-Clips/Deferred_Shading.aviftp://download.nvidia.com/developer/Movies/NV40-LowRes-Clips/Deferred_Shading.avi

  • GeForce 6

    http://developer.nvidia.com/object/using_vertex_textures.html Using Vertex Textures .

    4.8.

    GeForce 6 . .

    . GeForce 6 ( ) 4 . . .

    . GeForce 6 GPU 2 . , GeForce 6 fp16 . 16 . , . , .

    . 4.1.3 , . , ( , 30 x 30 ).

    44

    http://developer.nvidia.com/object/using_vertex_textures.html

  • NVIDIA GPU

    45

    4.9.

    , GeForce 6 CPU .

    N.z = sqrt( 1 N.x*N.x N.y*N.y );

    3-5 . .

    , GeForce 6 GPU DirectX D3DFMT_V8U8 OpenGL GL_LUMINANCE8_ALPHA8 . 16 /, 2:1 .

    . (+) . (-) ( ) (http://developer.nvidia.com/object/mipmapping_normal_maps.html ) .

    http://developer.nvidia.com/object/bump_map_compression.html Bump Map Compression .

    , NVIDIA Melody . Melody . Melody http://developer.nvidia.com/object/melody_home.html .

    http://developer.nvidia.com/object/mipmapping_normal_maps.htmlhttp://developer.nvidia.com/object/bump_map_compression.htmlhttp://developer.nvidia.com/object/melody_home.html

  • Chapter 5. GeForce FX

    GeForce FX . , .

    5.1.

    GeForce FX GeForce FX 5900 2 . . , .

    . API .

    5.2.

    GeForce FX Direct3D 512 OpenGL 1024 . DirectX , ps_2_a ps_2_x .

  • GeForce FX

    OpenGL , GLSL, Cg(arbfp1 fp30 ) ARB_fragment_program .

    Quadro FX 2048 .

    5.3. DirectX

    DirectX 9 ps_2_0 24 ( GeForce FX 32 float ). 16 a _pp .

    HLSL Cg . 32 float 16 half .

    1/2 .

    ps_1_0 ps_1_4 .

    DirectX ps_2_0 . ps_1_1 ps_1_4 , .

    5.4. OpenGL

    ARB_fragment_program 24 . ARB_fragment_program .

    NV_fragment_program. half(16 ) fixed(12 ) .

    48

  • NVIDIA GPU

    49

    5.5.

    ARB_precision_hint_fastest. Unified Compiler , .

    ARB_precision_hint_nicest. float .

    16

    half , float . half 10 () 5 . float 23 8 . V . . half , 0.1%. . , V . .

    half , -2048 2048 , . , . , 4096 4097 , 16 . . INF . . .

    GeForce FX GPU half . half .

    float . . , . ,

  • GeForce FX

    GPU ?

    . . . ( .)

    . . , .

    CPU , , .

    5.6.

    2D 3D MIP sRGB R8G8B8 N N N N N N N N N A8R8G8B8 Y Y Y Y Y Y Y Y N X8R8G8B8 Y Y Y Y Y Y Y Y N R5G6B5 Y Y Y Y Y Y Y Y N X1R5G5B5 Y Y Y Y Y Y Y Y N A1R5G5B5 Y Y Y Y Y Y N N N A4R4G4B4 Y Y Y Y Y Y N N N R3G3B2 N N N N N N N N N A8 N N N N N N/A N N N A8R3G3B2 N N N N N N N N N X4R4G4B4 N N N N N N N N N A2B10G10R10 N N N N N N N N N A8B8G8R8 N N N N N N N N N X8B8G8R8 N N N N N N N N N

    50

  • NVIDIA GPU

    51

    G16R16 Y Y Y Y Y N N N N A2R10G10B10 N N N N N N N N N A16B16G16R16 N N N N N N N N N A8P8 N N N N N N N N N P8 N N N N N N N N N L8 Y Y Y Y Y N N N N L16 Y Y Y Y Y N N N N A8L8 Y Y Y Y Y N N N N A4L4 N N N N N N N N N float 2D 3D MIP sRGB R16F N N N N N N/A N N N G16R16F Y Y Y Y N N/A Y N N A16B16G16R16F* Y N N N N N/A Y N N R32F Y Y Y Y N N/A Y N N G32R32F N N N N N N/A N N N A32B32G32R32F* Y N N N N N/A Y N N 2D 3D MIP sRGB D24X8 Y N N Y Y N/A Y N/A N D24S8 Y N N Y Y N/A Y N/A N D16 Y N N Y Y N/A Y N/A N * (wrapping) DX9.0c

    5.7. DirectX ps_2_x ps_2_a

    GeForce FX ps_2_0 (DDX DDY ), , . 2 . ps_2_x HLSL Cg . . ps_2_a . GeForce FX .

  • GeForce FX

    5.8.

    GeForce FX 64 128 4 1 2 32 .

    OpenGL , NV_float_buffer , NV_fragment_program / . RGBA8 / NEAREST_MIPMAP_NEAREST ( fp32 2 fp16 ).

    GeForce FX , (texel) 32 , .

    5.9.

    GeForce FX, GeForce4, GeForce3 GPU 2 . GPU , CxV8U8 . Z .

    http://developer.nvidia.com/object/bump_map_compression.html Bump Map Compression .

    5.10.

    GeForce FX .

    52

    http://developer.nvidia.com/object/bump_map_compression.html

  • NVIDIA GPU

    53

    5.11.

    . . LOD GeForce FX .

    GeForce 6 GPU float , half . GPU float/half , , .

    GeForce FX GeForce 6 . GeForce FX , .

    , GeForce FX ps_1_* ps_2_* . , ps_1_1 , ps_1_4 ps_2_0 .

  • Chapter 6.

    GPU GPU .

    6.1. GPU

    GPU (Window ) GPU ID . ID . , GeForce 6 GPU . GPU caps bit(DirectX ) (OpenGL ) . OpenGL , NV40 FX (GeForce 6xxx Quadro FX 3400 ).

    ID . ID . GPU , .

    ID . ID .

  • GeForce FX

    ID ID . .

    GeForce 6 GPU . GPU TNT GPU ID . NV4X , .

    ID cap . cap . , cap , .

    . .

    ID , [email protected] Developer Relations .

    NVIDIA GPU ID http://developer.nvidia.com/object/device_ids.html .

    6.2.

    GeForce 3 GPU NVIDIA OpenGL DirectX . (hardware shadow mapping) % . . . , ps_2_0 .

    .

    56

    mailto:[email protected]://developer.nvidia.com/object/device_ids.html

  • NVIDIA GPU

    57

    http://developer.nvidia.com/object/hwshadowmap_paper.html

    http://developer.nvidia.com/object/cedec_shadowmap.html

    http://developer.nvidia.com/object/d3dshadowmap.html

    http://developer.nvidia.com/object/Shadow_Map.html

    Perspective Shadow Maps from SIGGRAPH 2002

    Perspective Shadow Maps: Care and Feeding in GPU Gems: Programming Techniques, Tips, and Tricks for Real-Time Graphics (http://developer.nvidia.com/GPUGems)

    Simon Kozlov GPU Gems Perspective Shadow Maps: Care and Feeding . Kozlov , . SKD 7.0 . http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html .

    Direct X , .

    1) D3DUSAGE_DEPTHSTENCIL .

    2) D3DFMT_D16, D3DFMT_D24X8 ( D3DFMT_D24S8 , ) .

    3) IDirectDrawSurface9 Interface GetSurfaceLevel(0) .

    4) SetDepthStencilSurface() Z .

    5) DirectX , , D3DRS_COLORWRITEENABLE .

    6) z .

    7) .

    8) z .

    9) .

    http://developer.nvidia.com/object/hwshadowmap_paper.htmlhttp://developer.nvidia.com/object/cedec_shadowmap.htmlhttp://developer.nvidia.com/object/d3dshadowmap.htmlhttp://developer.nvidia.com/object/Shadow_Map.htmlhttp://developer.nvidia.com/GPUGemshttp://download.nvidia.com/developer/SDK/Individual_Samples/samples.html

  • GeForce FX

    V = Bias(0.5/TexWidth, 0.5/TexHeight, 0) *

    Bias(0.5, 0.5, 0) *

    Scale(0.5,0.5,1) *

    ViewProjsaved * World * Object * V

    CPU , .

    10) ps_1.0-1.3 , D3DTTFF_COUNT4 | D3DTTFF_PROJECTED .

    11) . 1.4 , .

    12) x y .

    13) z . , 0 ( ). 1 .

    14) , 4 . .

    15) .

    NVIDIA ( 45.23 ) . NVDIA 52.16 . . , ps.2.0 , ( , tex2Dproj(ShadowMapSampler, IN.TexCoord0).rgb ) . w- ! , tex2D(ShadowMapSampler, IN.TexCoord0/IN.TexCoord0.w) .

    58

  • NVIDIA GPU

    59

    , ps1.1-1.3 52.16 ( , SetTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_PROJECTED) .

    : ForceWare 61.71 (tex2D, tex2Dlod ) .

    SDK DirectX OpenGL . http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html .

    http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html

  • Chapter 7. NVIDIA SLI GPU

    NVIDIA SLI GPU . ftp://download.nvidia.com/developer/presentations/2004/GPU_Jackpot/SLI_and_Stereo.pdf .

    7.1. SLI ?

    Scalable Link Interface SLI GPU . SLI x16 2 PCI Express . PCI Express . SLI , SLI -GPU . SLI -GPU 2 . 2 GPU .

    ftp://download.nvidia.com/developer/presentations/2004/GPU_Jackpot/SLI_and_Stereo.pdfftp://download.nvidia.com/developer/presentations/2004/GPU_Jackpot/SLI_and_Stereo.pdf

  • NVIDIA SLI Multi-GPU

    GPU 1.9 . 2 GPU . SLI 2 . , 256MB 256MB . GPU . , GPU 0 GPU 1 .

    SLI , , (AFR) SFR .

    GPU (, GPU ). , SLI .

    AFR , GPU 0 n GPU 1 n+1 . n+2 GPU 0 . (, ) , AFR . , , GPU . ( , ), GPU . 2 .

    SFR , GPU 0 , GPU 1 . GPU 1 , . GPU 2 . GPU 0 GPU 1 GPU .

    62

  • NVIDIA GPU

    63

    7.2.

    SFR . AFR . 2 , AFR .

    (66.93 ) . , SFR GeForce . -GPU .

    API SLI .

    SLI .

    CPU

    CPU , . -GPU CPU . 2 CPU .

    , .

    7.3. VSync ( )

    VSync . -GPU () . VSync .

  • NVIDIA SLI Multi-GPU

    . .

    , 3 . , . .

    2 .

    1. ( , ).

    2. ( ) .

    VSync . DirectX IDirect3D9::CreateDevice() D3DPRESENT_PARAMETERS PresentationInterval D3DPRESENT_INTERVAL_IMMEDIATE .

    7.4. 2 (Lag)

    DirectX 3 . CPU GPU . , . . ( ) 30ms .

    . , , CPU GPU . CPU

    64

  • NVIDIA GPU

    65

    7.5.

    GPU . .

    , -GPU .

    (: DirectX ) . , 1~3 .

    -GPU . , n GPU n .

    . GPU GPU 2 . , GPU 2 ( 15ms ), GPU 1 ( 30ms ) 30ms .

    GPU GPU . nvCPL.dll API SLI , GPU . , NvCplGetDataInt(NVCPL_API_NUMBER_OF_SLI_GPUS, &number) SLI GPU . NVControlPanel_API.pdf NVSDK NvCpl .

    -CPU GPU . , GPU , , . ,

  • NVIDIA SLI Multi-GPU

    . , . , .

    GPU , -GPU . , GPU , ( ) 2 2 .

    , SLI . , 1 GPU GPU .

    7.6.

    , , -GPU (0 ) GPU . , .

    7.7. D3DPOOL_MANAGED

    0 , -GPU GPU . D3DPOOL_MANAGED DirectX , D3DPOOL_DEFAULT . , .

    66

  • Chapter 8.

    NVIDIA 100% .

    8.1. ?

    . . ( ) , NVIDIA .

    , . . .

    , . .

  • 8.2.

    NVIDIA 3D Stereo Driver DirectX OpenGL . 3D Stereo Driver 2 . , . Stereo Driver Display Driver .

    3D , 2 . , . .

    , .

    8.3.

    .

    8.3.1.

    . 3D Stereo Driver , .

    , , . , .

    HUD 3D . 3D , (view frustrum) .

    68

  • NVIDIA GPU

    69

    8.3.2.

    8.3.3.

    HUD . , HUD .

    3D , , , . 3D , . 2 , 2 .

    .

    3D . . 3D , 3D Stereo . . . .

    (, , ) , . 3D .

    2D . , , . 3D , 2D . . 3D Stereo .

    .

  • 8.3.4.

    8.3.5.

    8.3.6.

    8.3.7.

    8.3.8.

    3D 2D

    2D 3D . . 3D Stereo . 2D 3D HUD , . 3D .

    , , , . , .

    (Dirty Rectangle)

    , 3D . .

    . 3D .

    . .

    70

  • NVIDIA GPU

    71

    8.3.9.

    8.3.10.

    8.3.11.

    8.3.12.

    8.3.13.

    8.3.14.

    D3D , RHW .

    NVIDIA 3D Stereo . , 3D Stereo .

    . . , .

    NVIDIA 3D Stereo DirectX OpenGL . API 3D , .

    . .

    3D Stereo . . , . .

  • 8.3.15.

    8.4.

    . .

    .

    8.4.1.

    8.4.2.

    8.4.3.

    3D Stereo . , . IODisplay(http://www.i-glasses.com) . NVIDIA 3D Stereo Driver 2 . 3D , .

    Out of the Monitor

    . . , , . .

    3D . , . , , , !

    72

  • NVIDIA GPU

    73

    8.4.4.

    8.4.5.

    8.5.

    , . , 1 , 3 , .

    3D Stereo Driver . . NVDIA Developer Relations .

    API

    2 API .

    StereoBLT API 3D , .

    IStereoAPI , , . API . .

    OpenGL . NVIDIA Quadro GPU , .

  • 8.6.

    NVIDIA Developer Relations [email protected] Stereo API .

    http://developer.nvidia.com/object/3D_Stereoscopic_Dev.html .

    74

    mailto:[email protected]://developer.nvidia.com/object/3D_Stereoscopic_Dev.html

  • Chapter 9.

    .

    9.1. NVPerfHUD NVPerfHUD DirectX 4 . , . . 256 .

    NVPerfHUD NVIDIA Developer http://developer.nvidia.com/object/nvperfhud_home.html .

    http://developer.nvidia.com/object/nvperfhud_home.html

  • GPU

    9.2. NVShaderPerf NVShaderPerf FX Composer Shader Perf . HLSL, GLSL, Cg, !!FP1.0, !!ARBfp1.0, ps_1_x, ps_2_x. DirectX OpenGL . , , GPU GeForce 6 GeForce FX GPU .

    NVShaderPerfhttp://developer.nvidia.com/object/nvshaderperf_home.html .

    9.3. FX Composer FX Composer . FX Composer , GUI .

    FX Composer .

    .

    76

    http://developer.nvidia.com/object/nvshaderperf_home.html

  • NVIDIA GPU

    GeForce 6 GeForce FX GPU .

    .

    GPU , , , FPS .

    .

    FX Composer http://developer.nvidia.com/fxcomposer .

    9.4. NVIDIA Melody , NVIDIA Melody . Melody . Melody http://developer.nvidia.com/object/melody_home.html

    9.5.

    . [email protected] .

    77

    http://developer.nvidia.com/fxcomposerhttp://developer.nvidia.com/object/melody_home.htmlmailto:[email protected]

    NVPerfHUD

    : CPU: GPU

    GPU

    Indexed Primitive Call

    ps_2_a Interpolant mul() saturate() D3DTADDRESS_CLAMP ( GL_CLAMP_TO_E Interpolant

    2D 1D ARGB 3D

    sincos()

    2 Z Z

    (Antialiasing)

    GeForce 6 Shader Model 3.0 Pixel Shader 3.0Vertex Shader 3.0 (Dynamic Branching) (Instancing)

    sRGB

    MRT(Multiple Render Target)

    GeForce FX DirectX OpenGL 16 DirectX ps_2_x ps_2_a

    GPU

    NVIDIA SLI GPU SLI ?CPU VSync ( ) 2 (Lag) D3DPOOL_MANAGED

    ? 3D 2D (Dirty Rectangle)

    Out of the Monitor

    API

    NVPerfHUDNVShaderPerfFX ComposerNVIDIA Melody