If the fragment shader has no other uniforms, we would expect to see 2 uniforms come out of this code. And on both NVIDIA and AMD drivers, I do. The problem is what they’re named.
On AMD, they’re called “a_name” and “instance_name.a_name”. On NVIDIA, they’re called “a_name” and “BlockName.a_name”.
From the GLSL 4.30 spec revision 7, page 52:
Outside the shading language (i.e., in the API), members are similarly identified except the block name is
always used in place of the instance name (API accesses are to interfaces, not to shaders). If there is no
instance name, then the API does not use the block name to access a member, just the member name.
I knew I had seen that somewhere; I just couldn’t find it. That’s a really odd place for it though. Especially since 7.3.1 in the 4.3 spec lists how everything is named except for members of uniform blocks. It talks about array elements, struct members, etc. Just not direct members of uniform blocks.
The names of the first block should be ‘uViewMatrix’ / ‘uProjectionMatrix’ as the block is unnamed and the second ‘exampleblocknamed.uViewMatrix’ / ‘exampleblocknamed.uProjectionMatrix’ as the block is named. However, on MacOS you always get the blockname, here ‘exampleblock.uViewMatrix’ / ‘exampleblock.uProjectionMatrix’ in the first case…
Seems like 3 implementors managed to get 3 different implementations…
(Bug ID is 11335828, open since april 2012, let’s see if AMD fixes it faster )