Segmentation fault when calling glGenerateMipmap()

I’m trying to generate a mipmap from a FBO render target on the Nokia N9 (SGX530). Generating a mipmap from a texture uploaded into video memory works, but binding a texture that has been rendered to via a FBO and calling glGenerateMipmap() fails with a segmentation fault.

Since this works on a linux PC with GLES2 emulation, I’m guessing it’s a driver bug. It has already been reported [1] and filed under “BRN33822” (I can’t find any bug tracker around here, though). Texture size is 512x512. Uploading dummy data instead of passing NULL to glTexImage2D() or changing the filter modes, when setting up the render target, didn’t help.

Has there been any advancment on this issue?

$ cat /proc/pvr/version
Version 1.4.14.2514 (release)
System Version String: SGX revision = 1.2.5

[1] https://www.imgtec.com/forum/forum_posts.asp?TID=1336

Hi Bert,

This issue has been fixed in our DDK, but is unlikely to filter down to the Nokia N9 any time soon (it’s up to OEMs to update their drivers and this is out of our control unfortunately).

However, there is a simple work around you can do - if you set the minification filter for the texture to involve MIP Maps right from the start, the driver should ensure it sets up MIP Maps correctly. So for example:

GLint texture;
glGenTextures(1,&texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);

and then using this texture in your FBO and generating MIP Maps should get around the problem. I’ll update the original post so that future developers can see this as well.

Thanks,

Tobias



Hey Tobias!

Great! That worked! But to be more precise: setting the GL_TEXTURE_MIN_FILTER anytime after allocating the texture and its MIP map again, also produces a segementation fault. So if you want renderable MIP maps, it must be and can only be set in advance to allocation.

Hi Bert,

Glad that got it working for you! You’re right - it needs to be before the texture allocation (glTexImage2D etc.) sorry that wasn’t clear :slight_smile:

Thanks,

Tobias



Tobias,

What version of the driver has the fix?  Is there a way I can use a combination of glGetString(GL_VENDOR) and glGetString(GL_VERSION) to check?  In other words, does the value returned by GL_VERSION generally correspond to an internal IMG version number?

Thanks,
James




Hi James,

Sorry it's taken so long to get back to you - as far as I can tell this only happens on some 1.5 and earlier drivers. Any 1.6 drivers that have shipped should be fine.

You should be able to get the vendor string and version string to give you useful information, but some of our OEMs choose to hide this information from the user, so you'll just have to try it and see what you get. The GL_VERSION should contain something along the lines of "1.6.16.nnnn", if the VENDOR string contains "Imagination Technologies".

Thanks,

Tobias



Tobias2012-07-27 11:18:58

Tobias,

Indeed, on my hardware, glGetString(GL_VERSION) returns “OpenGL ES 2.0” instead of the driver version number.  Back to the drawing board, I guess…

~James