!UPSTREAM: mesa: Adapt ff_fragment_shader to account for geometry shaders.

The fixed-function fragment shader is built differently depending on
what outputs are generated by the previous stage in the pipeline.
Previously, that stage was known to be the vertex shader.  Now it can
be either the vertex or geometry shader.

TODO:
- Make sure no regressions
- Move to appropriate point in series