!UPSTREAM: Fix gl_ClipVertex for GS

The uniform registers for clip planes need to be assigned before we
try to emit the dot products that convert gl_ClipVertex into
gl_ClipDistance.

In vertex shaders the dot products are emitted by the call
emit_thread_end(), so it is safe to wait until just before that call
to set up the uniform registers for clip planes.  But in geometry
shaders, the dot products are emitted as we're traversing the IR
(since they happen during the shader's call to EmitVertex()).  So we
need to make sure the uniform registers are set up before then.

TODO:
- Move to appropriate part of patch series.