mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.
authorPaul Berry <stereotype441@gmail.com>
Wed, 4 Jan 2012 21:57:52 +0000 (13:57 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 11 Jan 2012 15:57:56 +0000 (07:57 -0800)
commit642e5b413e0890b2070ba78fde42db381eaf02e5
treee17e0e11a9addc41172a3863e92198500abfe690
parentbe4e9f7a0ccb7aa0edef5e5b589bdbbfd4eab3cb
mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.

On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), we need to handle transform feedback of gl_ClipDistance
specially, to account for the fact that the hardware represents it as
an array of vec4's rather than an array of floats.

The previous way this was accounted for (translating the request for
gl_ClipDistance[n] to a request for a component of
gl_ClipDistanceMESA[n/4]) doesn't work when performing transform
feedback on the whole unsubscripted array, because we need to keep
track of the size of the gl_ClipDistance array prior to the lowering
pass.  So I replaced it with a boolean is_clip_distance_mesa, which
switches on the special logic that is needed to handle the lowered
version of gl_ClipDistance.

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript".

Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/linker.cpp
src/mesa/main/mtypes.h