mesa/st: fix number of ubos being declared in a shader
mesa/st: fix number of ubos being declared in a shader

Previously the code used the total number of ubos being declared in the
linked program (so the ubos of all shaders combined), use the number
from the particular shader instead.
This fixes an assertion failure with piglit arb_uniform_buffer_object-maxblocks
seen in llvmpipe since 8a9f5ecdb116d0449d63f7b94efbfa8b205d826f as it now emits
code for each declared buffer, not just the ones actually used.

CC: "10.1 10.2" <59f39c0db42d4479a46b02d4d2bc11120e37bb44@lists.freedesktop.org>
Reviewed-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>

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