PDA

View Full Version : GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT



PickleWorld
01-28-2010, 02:29 PM
I have some FBO code that works fine on several machines but on my HP laptop I get the "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" error when I call glCheckFramebufferStatusEXT().

I am assume this is a driver/gfx card issue as the code does work on other machines. Can anyone confirm that is what this error means?

The driver claims to support OpenGL 2.1 and it claims to support Frame Buffer Objects (via glGet calls)?

p.s. The laptop has an ATI FireGl V5725 graphics card.

dletozeun
01-28-2010, 02:47 PM
Something seems to be wrong in your color attachment. Could we see how you create your fbo and how you render to it then?

You may have messed up something in your color attachment points? Are all attached texture, renderbuffers correctly created and allocated in memory?

PickleWorld
01-28-2010, 03:05 PM
Trying to create an FBO with a Color buffer with texture and packed depth and stencil buffer with texture...



// Create the FBO
glGenFramebuffersEXT( 1, &m_fboID );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, m_fboID );

// Create the Color Texture
glGenTextures( 1, &m_colorRB );
glBindTexture( target, m_colorRB );
glTexImage2D( target, 0, GL_RGBA8,
m_width, m_height,
0, GL_RGBA, GL_UNSIGNED_BYTE, 0 );
glTexParameteri( target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
glTexParameteri( target, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glGenerateMipmapEXT( target );

glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, m_colorRB, 0 );

// Now Depth texture
glGenTextures( 1, &m_depthStencilTextureRB );
glBindTexture( target, m_depthStencilTextureRB );

glTexParameteri( target, GL_TEXTURE_MIN_FILTER, GL_NEAREST );

glTexImage2D( target, 0,
GL_DEPTH24_STENCIL8_EXT,
m_width,
m_height,
0,
GL_DEPTH_STENCIL_EXT,
GL_UNSIGNED_INT_24_8_EXT,
0 );

glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT,
GL_DEPTH_ATTACHMENT_EXT,
target,
m_depthStencilTextureRB,
0 );


glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT,
GL_STENCIL_ATTACHMENT_EXT,
target,
m_depthStencilTextureRB, 0 );

status = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT );


Status returns GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT.

And like I said, this code works fine on my Nvidia workstation.

Alfonse Reinheart
01-28-2010, 03:08 PM
I have some FBO code that works fine on several machines but on my HP laptop I get the "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" error when I call glCheckFramebufferStatusEXT().

This is not possible. Except for GL_FRAMEBUFFER_UNSUPPORTED, all incomplete errors are the result of improper code.

This means that either the "several machines" that worked have buggy implementations, or your HP laptop does. How recent are your laptop drivers?

The specific error means that the draw buffer specified by glDrawBuffer (or glDrawBuffers if you're doing MRT) does not have a image attached to it. It's unlikely that you simply missed this, so I'm guessing your laptop drivers are the culprit.

dletozeun
01-29-2010, 11:08 AM
I noticed that you allocate depth and stencil buffers storage in the same texture, using the alpha component for stencil. Do you need to fetch these two textures? If not, try to allocate two different renderbuffers for depth and stencil buffers.

Also you may try to allocate two textures for depth and stencil buffers. Maybe you can find a work around to this apparent driver bug or unsupported feature this way.

Alfonse Reinheart
01-29-2010, 11:46 AM
If not, try to allocate two different renderbuffers for depth and stencil buffers.

That never works. Don't do this. You're doing the right thing making a Depth/Stencil renderbuffer.

dletozeun
01-29-2010, 09:16 PM
That never works.

Never say never! ;) I am not telling him that he is doing wrong. But drivers bugs may lead to not elegant workarounds sometimes.