I have a shader that I use primarily with an FBO that has two color attachments. In this fragment shader so there are two output buffers.
in vec2 vs_tex_coords;
flat in uint vs_id;
out vec4 fs_color;
out uint fs_id;
uniform sampler2D u_texture;
void main()
{
fs_color = texture(u_texture, vs_tex_coords)
fs_id = vs_id;
}
Now, since I'm lazy, I'd like to reuse the same fragment shader also with the default framebuffer. In this case obviously there is only one color attachment (i.e. the screen color buffer). What happens with the second color output? Is it simply ignored or could it cause troubles? Does the standard mention anything about such a case?
I tested that behavior on two devices and it seemed to work fine. It simply ignored the second output buffer. But what can I say about other implementations?