OpenGL GLSL 3.30 in Ubuntu 14.10 mesa 10.1.3

◇◆丶佛笑我妖孽 提交于 2019-12-23 01:53:57

问题


when I try to compile a glsl shader with OpenGL in Ubuntu I get the following error: - 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, and 1.00 ES

But when I do a "glxinfo | grep OpenGL" it says:

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD JUNIPER
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:

It appears that the glsl version is right, so I don't know what am I doing wrong

I am developing with lwjgl and Java


回答1:


This is basically telling you that you don't have a core profile context. Mesa is giving you a 3.0 context since it does not support compatibility profiles, and I imagine this is because you did not explicitly ask the framework you used to create your context for a core profile.

Update:

Given lwjgl, when you create your context you need to request a 3.3 core profile.

You can do that like this:

PixelFormat    pixelFormat       = new PixelFormat ();
ContextAttribs contextAtrributes = new ContextAttribs (3, 3).withProfileCore (true);

[...]

Display.create (pixelFormat, contextAtrributes);


来源:https://stackoverflow.com/questions/25951198/opengl-glsl-3-30-in-ubuntu-14-10-mesa-10-1-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!