xernobyl
Posts: 26
Joined: Tue Oct 25, 2011 2:03 pm

glDiscardFramebufferEXT crashes

Fri Jul 20, 2012 6:25 pm

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.

User avatar
AndyEsser
Posts: 9
Joined: Tue Jun 19, 2012 7:01 pm
Location: Warwick, United Kingdom
Contact: Website

Re: glDiscardFramebufferEXT crashes

Mon Jul 23, 2012 7:55 am

I'm not familiar with glDiscardFramebufferEXT() myself, but it appears you're trying to discard the native framebuffer? Surely this isn't valid behaviour?

blu
Posts: 55
Joined: Tue Jul 17, 2012 9:57 pm

Re: glDiscardFramebufferEXT crashes

Mon Jul 23, 2012 12:37 pm

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.

xernobyl
Posts: 26
Joined: Tue Oct 25, 2011 2:03 pm

Re: glDiscardFramebufferEXT crashes

Mon Jul 23, 2012 3:10 pm

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.

Return to “OpenGLES”