liveBook · Manning

GPU

As explained in Systems Programming with Zig

A graphics processing unit is a processor specialized for highly parallel graphics and compute operations.

A graphics processing unit (GPU) is specialized hardware for graphics. Hardware acceleration uses specialized hardware to perform a task more efficiently; OpenGL provides a standard interface to graphics hardware through device drivers. section 7.1 section 7.1

In rasterization, geometry becomes an image through these stages:

  • A draw call submits geometry, typically vertices represented by floating-point numbers. section 7.1.2
  • A vertex shader processes vertices, from simple movement to 3D projection. section 7.1.2
  • The rasterizer turns shapes into fragments; a fragment shader assigns each visible pixel a color. section 7.1.2
  • The fragments are reassembled into an image. Shaders are programmable pipeline components, not just lighting tools. section 7.1.2
Figure 7.1 The rasterization pipeline
CH07 F01 hinsonhasty

Use the pipeline diagram to follow geometry from draw call to finished image. section 7.1.2

Graphics programming also involves operating-system components, resource lifetimes, systems libraries, and memory—and comes with graphics-API-specific footguns. section 7.0

How Systems Programming with Zig covers it

How deep it goes
Traces rasterization from draw call through vertex processing, fragment generation, shading, and image assembly.
Examples
Uses floating-point vertices, draw calls, vertex transformations, and per-pixel color shaders as pipeline examples.
What it assumes
Assumes systems knowledge of operating systems, resource lifetimes, systems libraries, and memory management for graphics work.
What you can do after
Understand how geometry moves through a rasterization pipeline to become an image.
How it connects
Connects GPU graphics to hardware acceleration, OpenGL, device drivers, rasterization, and shaders.

Also explained in

Compare how 19 books explain GPU →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Systems Programming with Zig. The section links point to the parts of the book it draws on.