FBO setup failure on ATI X1800

My FBO code has been working on many configurations, but fails for one Windows customer with an ATI Radeon Mobility X1800. The status check returns GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT. The setup code looks like this:


// Create and bind a framebuffer object
glGenFramebuffersEXT( 1, &frameBufferID );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, frameBufferID );

// Create color renderbuffer
glGenRenderbuffersEXT( 1, &colorRenderBufferID );
glBindRenderbufferEXT( GL_RENDERBUFFER_EXT,
	colorRenderBufferID );
glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_RGB,
	inPaneWidth, inPaneHeight );
glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT,
	GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT,
	colorRenderBufferID );

// Create a depth/stencil buffer
glGenRenderbuffersEXT( 1, &depthRenderBufferID );
glBindRenderbufferEXT( GL_RENDERBUFFER_EXT,
	depthRenderBufferID );
glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT,
	GL_DEPTH24_STENCIL8_EXT, inPaneWidth, inPaneHeight );
glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT,
	GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT,
	depthRenderBufferID );
glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT,
	GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT,
	depthRenderBufferID );

GLenum	result = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT );

I tried checking glGetError after each step, and it’s not detecting any error.

The error GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT seems to suggest that neither the color buffer nor the depth/stencil buffer is getting set up correctly, but why? In another thread, someone said “Sometimes, I noticed glCheckFramebufferStatusEXT() reports incorrect(not relevant) FBO status on ATI cards when it failed to complete a FBO.” So maybe GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT is bogus.

My FBO code has been working on many configurations, but fails for one Windows customer with an ATI Radeon Mobility X1800. The status check returns GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT.

Driver bug. If you ever get anything other than GL_FRAMEBUFFER_UNSUPPORTED, and you don’t get it consistently across implementations, then it’s a driver bug.

You can try to use GL_DEPTH_STENCIL_ATTACHMENT_EXT instead of attaching the renderbuffer to both. According to the spec, this should make no difference, but since we’re already in the land of ATI driver bugs, you may as well have a go.

Thanks, good to know…

I can’t find a GL_DEPTH_STENCIL_ATTACHMENT_EXT constant in either the FBO spec or the latest version of glext.h. Are you sure you’re not thinking of something else?

I can’t find a GL_DEPTH_STENCIL_ATTACHMENT_EXT constant in either the FBO spec or the latest version of glext.h. Are you sure you’re not thinking of something else?

Sorry. That’s part of the ARB_framebuffer_object spec. I don’t know why EXT_packed_depth_stencil didn’t include something like that.

Oh, I see. I wasn’t aware of the existence of ARB_framebuffer_object. (In my defense, I do more of my work on the Mac, where no drivers yet support ARB_framebuffer_object.) I’ll give it a shot.

where no drivers yet support ARB_framebuffer_object

Really? I know Apple has this thing about ignoring GL versions past 2.1, but not even allowing drivers to expose ARB_framebuffer_object?

It’s a much better extension overall. Overall, it gets rid of the size limitation, so you can have render targets with various sizes.

If possible, try upgrading your drivers. I think this was fixed around the Catalyst 9.3 time-frame (the last version to support the X1800).

As a test, try disabling the stencil buffer by changing the storage format for the renderbuffer. This code should work then (confirming that this is indeed a driver bug).

The user claims that the driver is the latest (from May 2007).

I’ll see if I can make it fall back to depth but not stencil.