I have a two programs, one is a fixed pipeline emulator, and the other is an extension that adds additional functionality to it. I want to share the same state (matrices, light, etc...), so i put all these uniforms in a one big uniform block (std140), and shared it with the other program.
I have a uniform (the modelview inverse matrix) that is used only in the second program, i used std140 layout so that uniform will not be removed by optimization, and it worked in nVidia 310.xx but not the latest versions (the second program doesn't see that uniform).

Am I doing the right thing for sharing UBO ?