mesa: Fix computation of transform feedback num_components.
authorPaul Berry <stereotype441@gmail.com>
Wed, 4 Jan 2012 20:21:55 +0000 (12:21 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 11 Jan 2012 15:57:56 +0000 (07:57 -0800)
commitbe4e9f7a0ccb7aa0edef5e5b589bdbbfd4eab3cb
tree3c9e367606a58cdbf86da35ffc04d2f7ccb4a97e
parentc62e02000d11e29e70a1000d32cb08d9a450485f
mesa: Fix computation of transform feedback num_components.

The function tfeedback_decl::num_components() was not correctly
accounting for transform feedback of whole arrays and gl_ClipDistance.
The bug was hard to notice in tests, because it only affected the
checks for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS.

This patch fixes the computation, and adds an assertion to verify
num_components() even when MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
and MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS are not exceeded.

The assertion requires keeping track of components_so_far in
tfeedback_decl::store(); this will be useful in a future patch to fix
non-multiple-of-4-sized gl_ClipDistance.

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