(win7 x64)
I'm trying to use uniform blocks to share data between shader programs, but am confused about some aspects of them.
I have 2 shader programs, with for example the vertex shaders as:
Vertex shader for program 1
Code :layout(std140) uniform Block1 { vec4 var1; vec4 var2; } etc.
Vertex shader for program 2
Code :layout(std140) uniform Block1 { // different variable types and/or names float var1; vec4 var3; } etc.
I actually expected this to not compile, because the uniform block definitions do not match up.
Why does it compile?
And what's the best way to distinguish between same-named-but-different uniform blocks?



