summaryrefslogtreecommitdiff
path: root/src/gallium/docs/source/pipeline.txt
blob: fd1fbe9c76fe68b36b486ea036163ff2eb632596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
XXX this could be converted/formatted for Sphinx someday.
XXX do not use tabs in this file.



            position                     ]
            primary/secondary colors     ]
            generics (normals,           ]
               texcoords, fog)           ] User vertices / arrays
            point size                   ]
            edge flag                    ]
            primitive ID                 } System-generated values
            vertex ID                    }
              | | |
              V V V
      +-------------------+
      |  Vertex shader    |
      +-------------------+
              | | |
              V V V
            position
            clip distance
            generics
            front/back & primary/secondary colors
            point size
            edge flag
            primitive ID
              | | |
              V V V
      +------------------------+
      |     Geometry shader    |
      | (consume vertex ID)    |
      | (may change prim type) |
      +------------------------+
              | | |
              V V V
            [...]
            fb layer
              | | |
              V V V
      +--------------------------+
      |         Clipper          |
      | (consume clip distances) |
      +--------------------------+
              | | |
              V V V
      +-------------------+
      |  Polygon Culling  |
      +-------------------+
              | | |
              V V V
      +-----------------------+
      |    Choose front or    |
      |    back face color    |
      | (consume other color) |
      +-----------------------+
              | | |
              V V V
            [...]
            primary/secondary colors only
              | | |
              V V V
      +-------------------+
      |   Polygon Offset  |
      +-------------------+
              | | |
              V V V
      +----------------------+
      | Unfilled polygons    |
      | (consume edge flags) |
      | (change prim type)   |
      +----------------------+
              | | |
              V V V
            position
            generics
            primary/secondary colors
            point size
            primitive ID
            fb layer
              | | |
              V V V
  +---------------------------------+ 
  | Optional Draw module helpers    |
  | * Polygon Stipple               |
  | * Line Stipple                  |
  | * Line AA/smooth (as tris)      |
  | * Wide lines (as tris)          |
  | * Wide points/sprites (as tris) |
  | * Point AA/smooth (as tris)     |
  | (NOTE: these stages may emit    |
  |  new/extra generic attributes   |
  |  such as texcoords)             |
  +---------------------------------+
              | | |
              V V V
            position                     ]
            generics (+ new/extra ones)  ]
            primary/secondary colors     ] Software rast vertices
            point size                   ]
            primitive ID                 ]
            fb layer                     ]
              | | |
              V V V
      +---------------------+
      | Triangle/Line/Point |
      |    Rasterization    |
      +---------------------+
              | | |
              V V V
            generic attribs
            primary/secondary colors
            primitive ID
            fragment win coord pos   } System-generated values
            front/back face flag     }
              | | |
              V V V
      +-------------------+
      |  Fragment shader  |
      +-------------------+
              | | |
              V V V
            zero or more colors
            zero or one Z value


NOTE: The instance ID is not shown.  It can be imagined to be a global variable
accessible to all shader stages.