
284 III Bending the Pipeline
11
11 133
11 12
1
2
(a)
15 15 16 17 19 19 19 19
6 7 8 11 14 15 15 15
11235666
00011111
(b)
Figure 20.5. An example of (a) counts and (b) offsets for three triangles.
In step 3, offsets are computed, applying the parallel prefix sum algorithm [Lad-
ner and Fischer 80] to the count data. The offsets are computed in place, overwriting
the counts since the counts can be recalculated as the difference between consecutive
offset values. This algorithm is visualized in Figure 20.4(b), and an example of the
final offset table is shown in Figure 20.5(b). For simplicity, the input data for the
parallel prefix sums is increased to the next power ...