Graphics Reference
In-Depth Information
Graphics Card Capabilities
The first thing we should understand when we think of a language to support
graphics shaders is that graphics cards, or GPUs, are not like standard CPUs in
several ways. In some ways they are much more advanced than most proces-
sors, and in some ways they are more restricted. GPUs are meant to operate on
streaming data, transforming it and passing it along a pipeline of processing
stages. They hate exceptions, and exceptions can force a whole pipeline to be
flushed and restarted. The GLSL shader language has added features that take
advantage of graphics card capabilities, especially features that come from the
increasingly general-purpose architecture of these cards. These changes are
described throughout this chapter.
Parallelism in Graphics Cards
One of the main differences between graphics cards and standard processors is
that graphics cards can be parallel processors. Certainly there are some kinds
of data-level parallelism in modern processors and, in fact, it has become com-
mon for systems to offer parallelism through multiple processors or cores. But
these are different kinds of parallelism. Today's graphics cards typically per-
form parallelism at four levels:
1. Device-Level Parallelism—multiple processors or multiple graphics
cards can exist in the same system.
2. Core-Level Parallelism—each processor typically has multiple cores that
are capable of independent execution.
3. Thread-Level Parallelism—each core can run multiple threads, that is, can
have multiple instruction streams.
4. Data-Level Parallelism—
many instructions can act on mul-
tiple data elements at once.
Much of the time, the details of
these modes of parallelism are abstracted
away from the application programmer,
and are used as shown in Figure 5.1. This
is a good thing. Most of the time, we
don't care where or how the processing
takes place, just that it happens with suf-
ficient parallelism to handle the increas-
ing demands of today's complex render-
ing tasks.
Figure 5.1. Abstracted parallelism in graphics processors.
Search WWH ::




Custom Search