PDA

View Full Version : FBO setup failure on ATI X1800



James W. Walker
10-19-2009, 11:40 AM
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.

Alfonse Reinheart
10-19-2009, 12:37 PM
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.

James W. Walker
10-19-2009, 01:09 PM
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.

Thanks, good to know...


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.


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?

Alfonse Reinheart
10-19-2009, 01:20 PM
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.

James W. Walker
10-19-2009, 02:44 PM
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.

Alfonse Reinheart
10-19-2009, 02:52 PM
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.

Stephen A
10-20-2009, 07:19 AM
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).

James W. Walker
10-20-2009, 02:16 PM
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.