i
i
i
i
i
i
i
i
14 2. The Graphics Rendering Pipeline
we could compute the rendering speed. Assume, for example, that the
bottleneck stage takes 20 ms (milliseconds) to execute; the rendering speed
then would be 1/0.020 = 50 Hz. However, this is true only if the output
device can update at this particular speed; otherwise, the true output rate
will be slower. In other pipelining contexts, the term throughput is used
instead of rendering speed.
E
XAMPLE:RENDERING SPEED. Assume that our output device’s maximum
update frequency is 60 Hz, and that the bottleneck of the rendering pipeline
has been found. Timings show that this stage takes 62.5 ms to execute.
The rendering speed is then computed as follows. First, ignoring the output
device, we get a maximum rendering speed of 1/0.0625 = 16 fps. Second,
adjust this value to the frequency of the output device: 60 Hz implies that
rendering speed can be 60 Hz, 60/2=30Hz,60/3=20Hz,60/4=15Hz,
60/5 = 12 Hz, and so forth. This means that we can expect the rendering
speed to be 15 Hz, since this is the maximum constant speed the output
device can manage that is less than 16 fps.
As the name implies, the application stage is driven by the applica-
tion and is therefore implemented in software running on general-purpose
CPUs. These CPUs commonly include multiple cores that are capable
of processing multiple threads of execution in parallel. This enables the
CPUs to efficiently run the large variety of tasks that are the responsi-
bility of the application stage. Some of the tasks traditionally performed
on the CPU include collision detection, global acceleration algorithms, an-
imation, physics simulation, and many others, depending on the type of
application. The next step is the geometry stage, which deals with trans-
forms, projections, etc. This stage computes what is to be drawn, how
it should be drawn, and where it should be drawn. The geometry stage
is typically performed on a graphics processing unit (GPU) that contains
many programmable cores as well as fixed-operation hardware. Finally,
the rasterizer stage draws (renders) an image with use of the data that
the previous stage generated, as well as any per-pixel computation de-
sired. The rasterizer stage is processed completely on the GPU. These
stages and their internal pipelines will be discussed in the next three sec-
tions. More details on how the GPU processes these stages are given in
Chapter 3.
2.2 The Application Stage
The developer has full control over what happens in the application stage,
since it executes on the CPU. Therefore, the developer can entirely de-
termine the implementation and can later modify it in order to improve