I'm a bit confused on what would be the right way to bind the texture when uniforms are using the layout binding.
layout(binding = 0, std140) uniform uCommon
{
mat4 projectionMatrix;
mat4 viewMatrix;
};
layout(binding = 1, std140) uniform uModel
{
mat4 modelViewProjectionMatrix;
};
layout(binding = 3) uniform sampler2D uTexture;
To bind my first texture I should use "GL_TEXTURE0 + 3"?
glActiveTexture(GL_TEXTURE0 + 3);
glBindTexture(GL_TEXTURE_2D, textureId);
Is this the correct way?
EDIT: Or is sampler using a separate binding from other uniforms? Can I use:
layout(binding = 0) uniform sampler2D uTexture;
while still using
layout(binding = 0, std140) uniform uCommon