A fbo may have a color attachment bound with a variety of different functions, including: glFramebufferRenderbuffer, glFramebufferTexture2D, glFramebufferTexture2DMultisampleEXT.
To clear the color attachment, is it safe to just always use glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENTX, GL_RENDERBUFFER, 0) or does it have to be cleared with the same function it was originally bound with? If it’s the latter then it raises some questions like what should be passed for the number of samples in the Texture2DMultisample case.
This sentence in the ES reference makes me think that maybe it’s OK to just use FramebufferRenderbuffer?
“If renderbuffer is 0, the current image, if any, attached to the attachment logical buffer of the currently bound framebuffer object is detached.”