Program pipeline objects were introduced as part of the separable shader objects extension, and moved into core OpenGL with version 4.1. They allow programmers to mix and match shader stages from multiple separable shader programs. To understand how this works and why it may be useful, let's go through a hypothetical example.Â
Suppose we have one vertex shader and two fragment shaders. Suppose that the code in the vertex shader will function correctly with both fragment shaders. I could simply create two different shader programs, reusing the OpenGL shader object containing the vertex shader. However, if the vertex shader has a lot of uniform variables, then every time that I switch between the two shader programs, I would (potentially) need to reset some or all of those uniform variables. This is because the uniform variables...