I've run across a change in the Nvidia 319/320 series drivers with regards to std140/packed uniform buffer objects that is causing havoc in our application.

Code :
#version 150
layout(shared) uniform scene
     float A;
     float B;
     float C;
out float result;
void main()
     result = A + B;

In the above shader, when the number of uniforms is queried via glGetActiveUniformBlockiv(... GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS) it is returning "2". This is a change from previous Nvidia drivers where the same code returned "3". While this seems to be in line with the whole notion of active uniforms, it isn't terribly convenient when applied to shared uniform blocks, especially when different shaders may use subsets of the uniforms within the uniform block.

The reason this is causing problems for our application is that it queries all the offsets, names, and sizes of the shared uniform block from the shader and caches them in a C++ object representing the uniform block (backed by a buffer). While I can make modifications to allow piecemeal caching of the various active uniforms' data used by shaders as the object is reused, I'd rather not unless this is truly the intent of the GL spec. The GLSL and GL specs talk mostly about memory layout when discussing shared and std140 uniform blocks, while the OpenGL wiki seems to indicate that all uniforms should be considered active and not optimized out for packed/std140 (http://www.opengl.org/wiki/Interface...#Memory_layout).

So, should I be submitting this as a driver bug, or is this proper behaviour?