Querying default framebuffer color bits (OpenGL 3)

Hi,
How do you query the the number of bits used by the color/depth/stencil buffers in the default framebuffer in OpenGL 3.1+? (prior to 3.1 could use glGetIntegerv(GL_RED_BITS, @Result))

I tried:
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, @Result);

but I get an “invalid enumerant” error on NVidia 182.52 drivers.

Is this a driver bug, or am I doing something wrong?

I have the same question: How can i get the internal rgba bitsizes?
I tried glGetFramebufferAttachmentParameter
and glGetRenderBufferAttachmentParameter.
I also tried the same on the BACK_LEFT and BACK_RIGHT buffers.

Does anyone know how to do this by now?

This should (specification defines it to) work.
If it doesn’t, its a driver bug.

but I get an “invalid enumerant” error on NVidia 182.52 drivers.

182.52? Those are two year old drivers. GL 3.0 was still fairly new then. Upgrade to some newer ones. However, there may be some issues with the most recent, so get a slightly older version than those.

The question was asked 2 years ago, but out of interest I thought I’d check it again.

On NVidia 257.15 + 270.61 drivers, and also on ATI 11.3 drivers, querying the default framebuffer in this way still returns INVALID_ENUMERANT.

Calling glGetIntegerv(GL_RED_BITS, @Result) in a core profile also returns INVALID_ENUMERANT, so you can’t query the default framebuffer properties at all unless you use compatibility profile.

Calling glGetIntegerv(GL_RED_BITS, @Result) in a core profile also returns INVALID_ENUMERANT, so you can’t query the default framebuffer properties at all unless you use compatibility profile.

For the default framebuffer, you could use wglGetPixelFormatAttribivARB(). Unfortunately, this won’t return actual format identifiers…just number of bits and so on.

I just installed the latest Nvidia drivers (280.26)and it seems that this is still broken?

Calls to:
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER,GL_DEPTH,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, …)
or
glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,GL_STENCIL,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE,…)

Both generate GL_INVALID_ENUM (have checked that there is no FBO bound)