021. The Modern GPU (Part 2)
T&L
As mentioned in the previous section, the primary role of a GPU is to turn a 3D scene into a 2D image. Before GPUs existed, this work was done either by a camera or by the human eye. The main subject involved here is geometry.
The main problems to solve are transform, clipping and lighting, abbreviated as T&L or TCL.
- Transform
This means turning a 3D object into a 2D image. The basic method is projection, including perspective projection and orthographic projection.
This process also involves converting an object’s “object coordinates” into world coordinates, and then into “camera coordinates,” among others. It requires a series of matrix transformations.
- clipping
After a 3D object has been projected onto a 2D plane—or during the projection process—some parts may be found that should not be visible. These parts must be clipped according to occlusion information and other factors.
- lighting
Simply projecting a 3D object onto a 2D plane does not give people a sufficient sense of realism. It may even produce a confusing jumble of pixels that makes the object impossible to recognize, because lighting information is missing from the projection process. The same geometry may display very different colors depending on the lighting angle and material. The human eye needs these changes in color or brightness to distinguish the spatial relationships between objects.
Before graphics cards were invented, some game companies had already discovered this theory. In 1993, an arcade company implemented hardware capable of T&L, and in 1997 Nintendo’s game console also gained dedicated T&L hardware. On PCs, because people believed PC CPUs were powerful enough, T&L was implemented in software for a long time. It was not until 1999 that NVIDIA’s GeForce 256 introduced hardware T&L support.
In this section, we will examine that history.
RCP
RCP, or Reality Coprocessor, was developed by Silicon Graphics for Nintendo. It consists of two parts, the RSP and RDP: the Reality Signal Processor and Reality Display Processor.
RSP
The RSP’s main job is geometric computation, corresponding to the T and L in T&L.
The RDP’s main role is rasterization and texture mapping.

The RSP is a MIPS CPU. Its firmware implements a program that can read a sequence of instructions, parse the instructions in that sequence, and execute the corresponding operations. These instructions are called microcode, or micro code. Programmers organize a series of microcode instructions into a list called a display list or command list, which the RSP then executes.

RSP microcode looks like C function calls, but in reality the calls may be macros that package binary bitstreams. Readers familiar with OpenGL may find them somewhat similar to the OpenGL API.
The operating model is also very similar to OpenGL: first, vertices, transformation matrices, and textures must be specified. The corresponding APIs are as follows:
gsSPMatrix(Mtx *m, unsigned int p)
gsSPVertex(Vtx *v, unsigned int n, unsigned int v0)
gsSPTexture(int s, int t, int levels, int tile, int on)
gsSPClipRatio(FRUSTRATIO_3),
Lights3 light_structure1 = gdSPDefLights3(
ambient_red, ambient_green, ambient_blue,
light1red, light1green, light1blue,
light1x, light1y, light1z,
light2red, light2green, light2blue,
light2x, light2y, light2z,
light3red, light3green, light3blue,
light3x, light3y, light3z);
gsSPSetGeometryMode(G_LIGHTING),
gsSPSetLights3(material1_light),
gsSPVertex( /* define vertices for object 1 */ );
/* render object 1 here */
gsSPLight(&material2_light.l[0], LIGHT_1),
gsSPLight(&material2_light.a, LIGHT_2),
gsSPVertex( /* define vertices for object 2 */ );
/* render object 2 here */
guLookAtHilite(&throw_away_matrix, &lookat, &hilite,
Eyex, Eyey, Eyez,
Objectx, Objecty, Objectz,
Upx, Upy, Upz,
light1x, light1y, light1z,
light2x, light2y, light2z,
tex_width, tex_height);
gsDPLoadTextureBlock_4b(hilight_texture, G_IM_FMT_I,
tex_width, tex_height, 0,
G_TX_WRAP | G_TX_NOMIRROR,
G_TX_WRAP | G_TX_NOMIRROR,
tex_width_power2,
tex_height_power2,
G_TX_NOLOD, G_TX_NOLOD),
For details, see:
http://level42.ca/projects/ultra64/Documentation/man/pro-man/pro11/index11.6.html
The RCP takes vertices, texture coordinates, lighting conditions, and other data as input, and outputs polygons.
These polygons enter the RDP for further processing.
RDP
Reality Display Processor.
Its role is to rasterize polygons, with the input being high-quality, Silicon Graphics style pixels that are textured, antialiased, and z-buffered.
Broadly speaking, these are pixels to which textures have already been mapped, antialiasing has been applied, and z-buffer—or depth—information has been added. They are almost the same thing as fragments in OpenGL.
The RDP processes these fragments in a fixed sequence. The steps in one mode are shown below:

In this mode, it can process only one pixel per cycle; in some other modes, it can process two pixels per cycle.
The RCP already closely resembled a fixed-function pipeline GPU. Its main shortcoming was that the RSP portion used a MIPS processor, which made it considerably slower.
| Block | Functionality |
|---|---|
| RS | Generates pixel and its attribute covered by the interior of the primitive. |
| TX | Generates 4 texels nearest to this pixel in a texture map. |
| TF | Bilinear filters 4 texels into 1 texel,or performs step 1 of YUV-to-RGB conversion. |
| CC | Combines various colors into a single color,or performs step 2 of YUV-to-RGB conversion. |
| BL | Blends the pixel with framebuffer memory pixel, or fogs the pixel for writing to framebuffer. |
| MI | Fetches and writes pixels from and to the framebuffer memory. |
GeForce 256

This GPU supports DirectX 7 and is known as the world’s first GPU.
NVIDIA was so proud of this chip that its official website still has a page for it:
https://www.nvidia.com/page/geforce256.html
At the time, a GPU was defined as a single-chip processor with integrated transform, lighting, triangle setup/clipping, and rendering engines that is capable of processing a minimum of 10 million polygons per second.
That means it could process 10 million polygons per second.
The “256” means a “256-bit, four-pipeline rendering engine.” It was equivalent to a four-core GPU and could process four pixels per cycle.
Unlike the RCP, all processing was performed by hardwired logic rather than, as with the RCP, by firmware running on a CPU.
Worthy of its status as the world’s first GPU, NVIDIA’s chip had all the characteristics of a modern GPU:
- hardware T&L
- Multiple cores
- Support for a 3D API.
Hardware support for T&L can be considered the dividing line between GPUs and non-GPUs, while DirectX 7 marks the dividing line between fixed-function pipeline GPUs and non-fixed-function pipeline GPUs. By the time DirectX 8 appeared, vertex shader and fragment shader were already available, marking the arrival of non-fixed-function pipeline GPUs.
It is too late tonight, so I will stop here for today.
I found a good article that I have not finished reading; it is provided here for reference:
https://www.techspot.com/article/653-history-of-the-gpu-part-2/
Comments