Page 1 of 1

glDiscardFramebufferEXT crashes

Posted: Fri Jul 20, 2012 6:25 pm
by xernobyl

Code: Select all

static const GLenum attachments[3] =
{
	GL_COLOR_EXT,
	GL_DEPTH_EXT,
	GL_STENCIL_EXT
};

glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments);
Has anyone managed to use glDiscardFramebufferEXT? The above code gives segfault.

Re: glDiscardFramebufferEXT crashes

Posted: Mon Jul 23, 2012 7:55 am
by AndyEsser
I'm not familiar with glDiscardFramebufferEXT() myself, but it appears you're trying to discard the native framebuffer? Surely this isn't valid behaviour?

Re: glDiscardFramebufferEXT crashes

Posted: Mon Jul 23, 2012 12:37 pm
by blu
Discarding attachments from the default framebuffer is a valid op.

EXT_discard_framebuffer

"4.5 Discarding Framebuffer Contents
...
If the default framebuffer is bound to <target>, then <attachment> may
contain COLOR, identifying the color buffer; DEPTH, identifying the depth
buffer; or STENCIL, identifying the stencil buffer."

What is not apparent is whether all three can be discarded at the same time, but that seems like a natural conclusion to me.

Re: glDiscardFramebufferEXT crashes

Posted: Mon Jul 23, 2012 3:10 pm
by xernobyl
In the specification is stated that you can use it with the default framebuffer, it can have no effect if the specified buffer is not available (I've also tried with just GL_COLOR_EXT), but even then in under no circumstances the function should crash! At most it should have no effect. I'll try it with other framebuffers instead of the default to see what happens.
I forgot to mention that the extension is correctly initialized, at least if my code works on windows and linux there's no reason it shouldn't work here on the pi (...and I've also checked the pointer value and it's correct), so my guess is that this is a driver bug.

On an unrelated note I still didn't check other extensions like buffer mapping but I might do it soon.