Problems with floating point texture formats and intel graphics under linux

Started by
6 comments, last by Forlom 12 years, 11 months ago
Hi folks,

I've tried to create a texture with the GL_RGBA32F format. That works fine under windows but returns an GL_INVALID_VALUE error under linux (ubuntu 11.04). the used hardware is an integrated intel 4 graphics series chipset. The driver is the one installed at os installation (i915 is the name I suppose)



GLuint tex;
glGenTextures( 1, &tex );

glBindTexture( GL_TEXTURE_2D, tex );

glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA32F, 128, 128, 0, GL_RGBA, GL_FLOAT, 0);

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

qDebug() << "Error: " << glGetError();




Other floating point format don't work, too.

Has anybody made any experience with linux, this intel integrated graphics and floating point textures? I couldn't figure out what I did wrong.

Thanks in advance

Bye
Forlom
Advertisement
GL_RGBA32F requires a GL 3.0 context. http://www.opengl.org/wiki/Tutorials

Or you need to use GL_RGBA32F_ARB which requires GL_ARB_texture_float
You can find the spec at http://www.opengl.org/registry/
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

GL_RGBA32F requires a GL 3.0 context. http://www.opengl.org/wiki/Tutorials

Or you need to use GL_RGBA32F_ARB which requires GL_ARB_texture_float
You can find the spec at http://www.opengl.org/registry/


Thanks for the fast reply.

I've tried GL_RGBA32F_ARB. It worked on windows, but not on Linux. The GL_ARB_texture_float extension is supported by the chipset, but I don't know if the linux driver supports it.

I'm using Qt and a QGLWidget. I couldn't figure out if it already creates a 3.0 context.




from OpenGL wiki:

Intel does not provide a proper, up-to-date OpenGL implementation for their integrated GPUs. There is nothing that can be done about this. NVIDIA and ATI provide good support for their integrated GPUs.
[/quote]

therefore you should check for the related extensions (use glGetString)

Qt only creates a basic 2.1 context, you should use GLEW to grab the extensions
You just need to call glGetString with Gl_extensions and analyze the string. No need for GLEW.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Thanks for all your answers. I figured out, that the driver doesn't support the needed extension.

Thanks for all your answers. I figured out, that the driver doesn't support the needed extension.

Linux Intel drivers use Mesa to provide OpenGL support. Mesa, being open source software, is not allowed to use floating point textures, as this is a patented feature. You can compile the newest mesa with a specific flag to get floating point support in the base package, but the Intel drivers still won't support it at this time. And even if they did, it is extremely unlikely that this flag will be set by default anytime soon by any major Linux distribution, due to legal concerns. So you could only use FP textures on machines where the user has recompiled both Mesa and the Intel driver on their own, specifically adding said compile flag manually. Rather unlikely to happen in practice.

In short, don't expect to get floating point support anytime soon under Linux open source drivers. Linux closed source drivers from NVidia and AMD are not affected by this, and will provide full FP support.

(and yes, software patents are indeed evil)

[quote name='Forlom' timestamp='1305485794' post='4811175']
Thanks for all your answers. I figured out, that the driver doesn't support the needed extension.

Linux Intel drivers use Mesa to provide OpenGL support. Mesa, being open source software, is not allowed to use floating point textures, as this is a patented feature. You can compile the newest mesa with a specific flag to get floating point support in the base package, but the Intel drivers still won't support it at this time. And even if they did, it is extremely unlikely that this flag will be set by default anytime soon by any major Linux distribution, due to legal concerns. So you could only use FP textures on machines where the user has recompiled both Mesa and the Intel driver on their own, specifically adding said compile flag manually. Rather unlikely to happen in practice.

In short, don't expect to get floating point support anytime soon under Linux open source drivers. Linux closed source drivers from NVidia and AMD are not affected by this, and will provide full FP support.

(and yes, software patents are indeed evil)
[/quote]

Thanks again for the detailed reply. That's pretty interesting.


This topic is closed to new replies.

Advertisement