#version 420 core
layout(shared) uniform Camera {
mat4 camViewProj;
mat4 sunViewProj;
mat4 sunViewCoordProj;
};
out mat4 outVar;
void main()
{
//outVar = camViewProj;
}
glGetProgramResourceIndex();
glGetUniformIndices();
#version 420 core
layout(shared) uniform Camera {
mat4 camViewProj;
mat4 sunViewProj;
mat4 sunViewCoordProj;
};
out mat4 outVar;
void main()
{
//outVar = camViewProj;
}
glGetProgramResourceIndex();
glGetUniformIndices();
no ?!? But it's "shared": So it must not be optimized out.
If I'm not understanding right - whats the right approach to get the layout even for variables which are not used?
no ?!? But it's "shared": So it must not be optimized out.
If I'm not understanding right - whats the right approach to get the layout even for variables which are not used?
... I just want to get a valid index/location for all of them - even if they're not used. Because they're shared and not every shader needs all of them.
I think there was a very similar topic a while ago. While the driver cannot just drop the uniform from the uniform block it is under no obligation to supply you with a valid index while the uniform is not used in that particular shader (even though space is reserved for the uniform).
ok! Doesn't sound unreasonable.
But Is there still a mechanic/technique, that allows me to query layout information even though I don't use any variable at all ?