We talked about the GPU pipeline today. We looked at setting GPU state from the CPU and initiating draw calls. We focused on shaders, uniforms, and attributes but there is a lot more state that can be set and managed by the CPU.
Some things we will not be looking at but are good to know about are:
key takeaways
- CPU sets GPU state for each draw
- CPU can upload data to the GPU as buffers
- CPU can upload shaders, GPU programs to run at different phases of the pipeline
- CPU can instruct the GPU to interpret buffers as attributes which connects them to shaders and tells the GPU how many elements to read at a time
- CPU can upload uniforms which are values that are kept constant for all shader invocations
- Vertex shaders produce points in Normalized Device Coordinates (NDC) with optional "output" data associated with each point
- The Rasterizer is a fixed-function process that turns these NDC points into fragments based on CPU provided settings (e.g. primitive type)
- Fragment shaders run for each activated fragment from the rasterizer to compute a final color for that pixel
further reading / viewing