OpenGL着色器版本编译错误 [英] OpenGL Shader Version Compile Error

查看:1650
本文介绍了OpenGL着色器版本编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在OpenGL中编译一个简单的顶点着色器时遇到问题,我收到以下错误信息:

I have a problem when compiling a simple vertex shader in OpenGL, I get the following error messages:


  • GL2不支持版本号

  • 错误(#279)无效的布局限定词位置

我假设我必须使用错误的GL2版本,但我不知道如何找到我的版本号或去哪里升级(是的,我试图搜索一个答案。)附上是我的副本着色器代码仅供参考和我的openGL信息。

I assume that I must be using the wrong version of GL2, but I have no idea how to find my version number or where to go for an upgrade (and yes I tried to search for an answer.) Attached is a copy of my shader code just for reference and my openGL information.

#version 330 core

layout(location = 0) in vec3 Position;

void main() {
    gl_Position.xyz = Position;
}




  • 供应商:ATI Technologies Inc。

  • 渲染器:ATI Radeon HD 5700系列

  • 版本:3.2.9756兼容性配置文件上下文

  • 推荐答案

    #version 330 core
    

    这说明你的着色器使用GLSL 3.30版。

    This says that your shader uses GLSL version 3.30.

    这样:

    版本:3.2.9756兼容性配置文件上下文

    Version: 3.2.9756 Compatibility Profile Context

    意味着您的OpenGL版本是3.2。 与OpenGL 3.2对应的GLSL版本为1.50. 小于3.30。因此缺乏编译。

    Means that your OpenGL version is 3.2. The GLSL version that corresponds with OpenGL 3.2 is 1.50. Which is less than 3.30. Hence the lack of compilation.

    更新您的驱动程序;那些是非常老的。您的卡应该能够支持GL 4.2。

    Update your drivers; those are extremely old. Your card should be able to support GL 4.2.

    这篇关于OpenGL着色器版本编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆