Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
Agenda
Do I need SW vertex processing? The PSGP Using SW vertex processing for maximum performance: memory, batching and render-states SW vertex processing and DirectX*s 8.0 new features
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
Problem: older systems does not support all the eyecandy features Solution1: Disable features for low-end systems Solution2: Use SW vertex processing (at least for the features that you can) and keep some features
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
The PSGP
Fixed function path Transformation Lighting Tex Gen Format data to outputFVF
VB
Map stream to registers Execute vertex shader code
Clipper
IB To
Meltdown 2001
driver
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
PSGP Principles
Use SIMD to process multiple vertices in each iteration
Vertical processing Data is swizzled on the fly
Prefetch input streams to hide memory latency Write output to temporary VBs based on XYZRHW FVF code
In system memory if need to read back transformed vertices In driver memory if no read-back is required More on this later
7
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
Primitive Batching
Batch all the SW processed primitives together SW processes the entire VB range that you submit, if multiple primitives are using the same VB squeeze the vertices range As with HW, bigger primitives are always better (the PSGP have long setup)
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
10
Clipping Render-state
When clipping is enabled, the PSGP
Stores its output to system memory buffer
As it need to read vertices in order to clip
Driver need to copy it across the AGP
Clips
11
Else
Render with clipping on
12
Performance Render-states
Specular very expensive LocalViewer smaller performance impact than HW, but still costs more NormalizeNormals extra work for the PSGP, use only when needed Fog written as specular alpha, can change PSGPs output FVF
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
13
14
Point Sprites
PSGP writes in native FVF format If HW does not support
Each point is expanded to quad, using the point size calculated The quad list is submitted to the driver
15
Tweening
Tween the position and normal before transformation (in SIMD) After tweening continuous the standard PSGP flow Costs very few cycles
But, for tweening and transformation only a vertex shader would run faster Try to compare your exact scenario to a vertex shader
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
16
Indexed Skinning
Transforms all vertices to matrix0 space
Using scalar code, with lookup for the needed matrix
Than continuous the normal PSGP flow DirectX* 7 style skinning is supported by some HW and may run faster, but requires multiple models and DrawPrimitive calls
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
17
Vertex shaders
At vertex shader creation
The shader code is compiled to equivalent IA32 code Using all possible assembly optimizations and instructions available on clients CPU to achieve fastest code
18
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
19
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
Data that you write, is data that the CPU have to calculate
Write only needed data (using the vertex shader write mask) Use the swizzle modifiers, and dont duplicate written data
21
22
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
23
m4x4 oPos, v0, c[2] add r1.xyz, c6,-v0 dp3 r2.w, r1, r1 rsq r2.w, r2.w mul r1.xyz,r1,r2.w dp3 r2.w, v1, r1 max r2.w,r2.w,c8 add oD0.xyz, r2.w, c7 mov oT0, v2
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
24
Questions??
Ronen.Zohar@intel.com Kim.Pallister@intel.com
Intel, Pentium and Xeon are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Copyright 2001 Intel Corp.
Meltdown 2001
25
Backup
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
26
Meltdown 2001
Copyright 2001 Intel Corporation. *Other names and brands may be claimed as the property of others.
27
Meltdown 2001
28
Const register file (x4) 1.0f 1.0f 1.0f 1.0f 2.0f 2.0f 2.0f 2.0f 3.0f 3.0f 3.0f 3.0f
Instruction argument
29