mesa: Fix computation of transform feedback num_components.
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 <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>

zeux/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,jbarczak/glsl-optimizer,mcanthony/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,metora/MesaGLSLCompiler,benaadams/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,djreep81/glsl-optimizer