glsl/gs: Fix transform feedback of gl_ClipDistance.
authorPaul Berry <stereotype441@gmail.com>
Wed, 23 Oct 2013 19:55:24 +0000 (12:55 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 25 Oct 2013 04:59:39 +0000 (21:59 -0700)
commit44b7ebe52d6f4b220a1c943bac2e571bb593f7e1
treec8bc49ddc35435b1afdb9fdc23fec82b4fcf17bf
parentfe36154ff3b2c095cf21462dd7ed6b5ae374fccc
glsl/gs: Fix transform feedback of gl_ClipDistance.

Since gl_ClipDistance is lowered from an array of floats to an array
of vec4's during compilation, transform feedback has special logic to
keep track of the pre-lowered array size so that attempting to perform
transform feedback on gl_ClipDistance produces a result with the
correct size.

Previously, this special logic always consulted the vertex shader's
size for gl_ClipDistance.  This patch fixes it so that it uses the
geometry shader's size for gl_ClipDistance when a geometry shader is
in use.

Fixes piglit test spec/glsl-1.50/transform-feedback-type-and-size.

v2: Change the type of LastClipDistanceArraySize to "unsigned", and
clarify the comment above it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/link_varyings.cpp
src/glsl/linker.cpp
src/mesa/main/mtypes.h