Whoops, should have used offset of 1
Change emit_vertex to add to offset so that GS with many outputs works correctly with cut bits
Fixup message len for thread end considering the possibility of EndPrimitive
Fixup EndPrimitive to not use immed in a prohibited position
Bug fix: it turns out that cut N indicates whether there is a cut *after* vertex N.
!UPSTREAM: vbo: Update vbo_count_tessellated_primitives for new primitive types.

TODO: test.
!UPSTREAM: i965: Add new primitive types.

TODO: test.
!UPSTREAM: Debug optimization passes
Fix r0.2
!UPSTREAM: Hack: avoid rounding errors in computation of atan

TODO:

- Rather than clamp the argument to asin to [-1, 1], it would be far
  better to use the formula:

    atan(x) = pi/2 - atan(1/x)

  when x > 1

  (and similar when x < -1).

  But I want to write better tests first.
!UPSTREAM: i965: Initialize all elements of ctx->ShaderCompilerOptions

Otherwise any GS that requires lowering (e.g. one that uses
gl_ClipDistance or gl_ClipDistanceIn) will fail to work.

TODO:
- Move into appropriate place in series.
!UPSTREAM: Fix up GS handling of gl_ClipDistance/gl_ClipVertex linkage rules.

TODO:
- Test
- Squash into appropriate commit.
!UPSTREAM: i965: Fix some vec4 gs key setup

TODO:
- Test thoroughly
- Squash into the appropriate patch
!UPSTREAM: Handle GS_OPCODE_THREAD_END in implied_mrf_writes()

TODO:
- Verify that this is the correct value to return
- Squash into the appropriate patch
gallivm: Fix indirect input fetches for gs.
gallium/draw: Pass primitive ID as integer to the shader.

The shader interprets the value as an integer.
mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.

ARB_geometry_shader4 spec Errors:
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname>
is GEOMETRY_VERTICES_OUT_ARB and <value> is negative."

Reviewed-by: Paul Berry <stereotype441@gmail.com>
mesa: Validate the drawing primitive against the geometry shader input primitive type.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
mesa/st: Allow geometry shaders without gl_Position export.

From the ARB_geometry_shader4 spec (section Geometry Shader outputs):
"The built-in special variable gl_Position is intended to hold the
homogeneous vertex position. Writing gl_Position is optional."
glsl/linker: Fail to link geometry shader without vertex shader.

ARB_geometry_shader4 spec 2.16:
"A program object that includes a geometry shader must also include a vertex
shader; otherwise a link error will occur."

Reviewed-by: Paul Berry <stereotype441@gmail.com>