Graphics Pipelines and GPU Hardware : Lab Notes 1

Posted on Sep 11, 2025

Intro

To eventually design a 3D GPU, we must learn about 3D GPU micro-architecture. Since the literature on 3D GPU micro-architecture seems to be sparse, we must infer GPU micro-architecture by programmatically interacting with GPUs via Mesa3D and or OpenGL for example.

Good Resources

Notes

  • gpu specific tooling such as compilers and assemblers in top folders like src/panfrost/compiler
  • should probably consider getting a device that supports panfrost such as RockPi 4C

Simple Triangle with Portable GL

You may have to adjust include and library paths for your platform in the following such that the compiler can find SDL2.

wget https://raw.githubusercontent.com/rswinkle/LearnPortableGL/f76a571af299a687035b59c769f85b99ff4e5109/src/1.getting_started/hello_triangle.cpp
wget https://raw.githubusercontent.com/rswinkle/PortableGL/3fd354efd5d8b591d6d937e45f68a17919765853/portablegl.h
g++ hello_triangle.cpp -I ./ -I/opt/local/include/ -L/opt/local/lib/ -lSDL2 -o hello_triangle
./hello_triangle

You should see something like:

Other Notes

  • OpenGL uses named buffer objects to abstract away the possible differences in GPU memory space vs host memory spaces. This is probably not needed for unified memory architectures, but it is what it is.