【问题标题】:OpenGL GLSL 3.30 in Ubuntu 14.10 mesa 10.1.3Ubuntu 14.10 台面 10.1.3 中的 OpenGL GLSL 3.30
【发布时间】:2014-09-20 16:59:33
【问题描述】:

当我尝试在 Ubuntu 中使用 OpenGL 编译 glsl 着色器时,出现以下错误: - 0:1(10):错误:不支持 GLSL 3.30。支持的版本有:1.10、1.20、1.30 和 1.00 ES

但是当我执行“glxinfo | grep OpenGL”时,它会说:

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:

看来glsl版本是对的,所以不知道自己做错了什么

我正在使用 lwjgl 和 Java 进行开发

【问题讨论】:

    标签: opengl ubuntu glsl lwjgl mesa


    【解决方案1】:

    这基本上是在告诉您您没有核心 配置文件上下文。 Mesa 为您提供 3.0 上下文,因为它不支持兼容性配置文件,我想这是因为您没有明确询问用于为核心配置文件创建上下文的框架。

    更新:

    鉴于 lwjgl,当您创建上下文时,您需要请求 3.3 核心配置文件。

    你可以这样做:

    PixelFormat    pixelFormat       = new PixelFormat ();
    ContextAttribs contextAtrributes = new ContextAttribs (3, 3).withProfileCore (true);
    
    [...]
    
    Display.create (pixelFormat, contextAtrributes);
    

    【讨论】:

    • 我正在使用 lwjgl 和 Java
    • 它不再崩溃,但在 Windows 中它不会渲染任何东西。将自行调查并将其标记为已解决,谢谢
    • 您的代码可能依赖于当时已弃用的内容。您可能想通过 gDEBugger 运行它,看看它是否会生成任何弃用警告。
    • 这个解决方案对我有用(c++ 用户)。您可能需要安装适当的附加驱动程序,例如 NVIDIA-331 或其他,然后使用 [ g++ -L/usr/lib/nvidia-331/ your-file.cc -lglut -lGLEW -lGL ] 编译选项重新启动计算机编译你的文件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-22
    • 1970-01-01
    • 2012-12-16
    • 2015-05-15
    • 2016-03-10
    • 2015-07-20
    相关资源
    最近更新 更多